From: <sv...@op...> - 2024-08-25 21:40:42
|
Author: sagamusix Date: Sun Aug 25 23:40:30 2024 New Revision: 21523 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21523 Log: [Fix] IPC: Selecting the last used OpenMPT instance didn't work with the "simple" FindIPCWindow overload. Modified: trunk/OpenMPT/mptrack/IPCWindow.cpp trunk/OpenMPT/mptrack/IPCWindow.h Modified: trunk/OpenMPT/mptrack/IPCWindow.cpp ============================================================================== --- trunk/OpenMPT/mptrack/IPCWindow.cpp Sun Aug 25 15:58:45 2024 (r21522) +++ trunk/OpenMPT/mptrack/IPCWindow.cpp Sun Aug 25 23:40:30 2024 (r21523) @@ -152,11 +152,6 @@ return ::SendMessage(ipcWnd, WM_COPYDATA, 0, reinterpret_cast<LPARAM>(©Data)); } - HWND FindIPCWindow() - { - return ::FindWindow(ClassName, nullptr); - } - struct EnumWindowState { uintptr_t lastActive = 0; @@ -227,8 +222,6 @@ return state.result; } - - bool SendToIPC(const std::vector<mpt::PathString> &filenames, bool autoplay) { HWND ipcWnd = FindIPCWindow(); Modified: trunk/OpenMPT/mptrack/IPCWindow.h ============================================================================== --- trunk/OpenMPT/mptrack/IPCWindow.h Sun Aug 25 15:58:45 2024 (r21522) +++ trunk/OpenMPT/mptrack/IPCWindow.h Sun Aug 25 23:40:30 2024 (r21523) @@ -39,16 +39,15 @@ enum InstanceRequirements { + None = 0x00u, SamePath = 0x01u, SameSettings = 0x02u, SameArchitecture = 0x04u, - SameVersion = 0x08u + SameVersion = 0x08u, }; MPT_DECLARE_ENUM(InstanceRequirements) - HWND FindIPCWindow(); - - HWND FindIPCWindow(FlagSet<InstanceRequirements> require); + HWND FindIPCWindow(FlagSet<InstanceRequirements> require = None); // Send file open requests to other OpenMPT instance, if there is one bool SendToIPC(const std::vector<mpt::PathString> &filenames, bool autoplay); |