Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
55
Src/external_dependencies/openmpt-trunk/mptrack/IPCWindow.h
Normal file
55
Src/external_dependencies/openmpt-trunk/mptrack/IPCWindow.h
Normal file
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* IPCWindow.h
|
||||
* -----------
|
||||
* Purpose: Hidden window to receive file open commands from another OpenMPT instance
|
||||
* Notes : (currently none)
|
||||
* Authors: OpenMPT Devs
|
||||
* The OpenMPT source code is released under the BSD license. Read LICENSE for more details.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "openmpt/all/BuildSettings.hpp"
|
||||
|
||||
OPENMPT_NAMESPACE_BEGIN
|
||||
|
||||
namespace IPCWindow
|
||||
{
|
||||
|
||||
enum class Function : ULONG
|
||||
{
|
||||
Open = 0x01,
|
||||
SetWindowForeground = 0x02,
|
||||
GetVersion = 0x03, // returns Version::GewRawVersion()
|
||||
GetArchitecture = 0x04, // returns mpt::OS::Windows::Architecture
|
||||
HasSameBinaryPath = 0x05,
|
||||
HasSameSettingsPath = 0x06
|
||||
};
|
||||
|
||||
void Open(HINSTANCE hInstance);
|
||||
|
||||
void Close();
|
||||
|
||||
LRESULT SendIPC(HWND ipcWnd, Function function, mpt::const_byte_span data = mpt::const_byte_span());
|
||||
|
||||
template <typename Tdata> LRESULT SendIPC(HWND ipcWnd, Function function, mpt::span<const Tdata> data) { return SendIPC(ipcWnd, function, mpt::const_byte_span(reinterpret_cast<const std::byte*>(data.data()), data.size() * sizeof(Tdata))); }
|
||||
|
||||
enum InstanceRequirements
|
||||
{
|
||||
SamePath = 0x01u,
|
||||
SameSettings = 0x02u,
|
||||
SameArchitecture = 0x04u,
|
||||
SameVersion = 0x08u
|
||||
};
|
||||
MPT_DECLARE_ENUM(InstanceRequirements)
|
||||
|
||||
HWND FindIPCWindow();
|
||||
|
||||
HWND FindIPCWindow(FlagSet<InstanceRequirements> require);
|
||||
|
||||
// Send file open requests to other OpenMPT instance, if there is one
|
||||
bool SendToIPC(const std::vector<mpt::PathString> &filenames);
|
||||
|
||||
}
|
||||
|
||||
OPENMPT_NAMESPACE_END
|
Loading…
Add table
Add a link
Reference in a new issue