mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-25 23:07:18 +00:00
[host] windows: fix linux crosscompile
This commit is contained in:
parent
10d9678b3d
commit
ecd73aa670
@ -57,6 +57,10 @@ HWND MessageHWND;
|
|||||||
typedef NTSTATUS (__stdcall *ZwSetTimerResolution_t)(ULONG RequestedResolution, BOOLEAN Set, PULONG ActualResolution);
|
typedef NTSTATUS (__stdcall *ZwSetTimerResolution_t)(ULONG RequestedResolution, BOOLEAN Set, PULONG ActualResolution);
|
||||||
static ZwSetTimerResolution_t ZwSetTimerResolution = NULL;
|
static ZwSetTimerResolution_t ZwSetTimerResolution = NULL;
|
||||||
|
|
||||||
|
// linux mingw64 is missing this
|
||||||
|
typedef WINBOOL WINAPI (*PChangeWindowMessageFilterEx)(HWND hwnd, UINT message, DWORD action, PCHANGEFILTERSTRUCT pChangeFilterStruct);
|
||||||
|
PChangeWindowMessageFilterEx _ChangeWindowMessageFilterEx = NULL;
|
||||||
|
|
||||||
static void RegisterTrayIcon()
|
static void RegisterTrayIcon()
|
||||||
{
|
{
|
||||||
// register our TrayIcon
|
// register our TrayIcon
|
||||||
@ -232,7 +236,12 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
|||||||
app.trayRestartMsg = RegisterWindowMessage("TaskbarCreated");
|
app.trayRestartMsg = RegisterWindowMessage("TaskbarCreated");
|
||||||
|
|
||||||
app.messageWnd = CreateWindowEx(0, MAKEINTATOM(class), NULL, 0, 0, 0, 0, 0, NULL, NULL, hInstance, NULL);
|
app.messageWnd = CreateWindowEx(0, MAKEINTATOM(class), NULL, 0, 0, 0, 0, 0, NULL, NULL, hInstance, NULL);
|
||||||
ChangeWindowMessageFilterEx(app.messageWnd, app.trayRestartMsg, MSGFLT_ALLOW, NULL);
|
|
||||||
|
// this is needed so that unprivileged processes can send us this message
|
||||||
|
HMODULE user32 = GetModuleHandle("user32.dll");
|
||||||
|
_ChangeWindowMessageFilterEx = (PChangeWindowMessageFilterEx)GetProcAddress(user32, "ChangeWindowMessageFilterEx");
|
||||||
|
if (_ChangeWindowMessageFilterEx)
|
||||||
|
_ChangeWindowMessageFilterEx(app.messageWnd, app.trayRestartMsg, MSGFLT_ALLOW, NULL);
|
||||||
|
|
||||||
// set the global
|
// set the global
|
||||||
MessageHWND = app.messageWnd;
|
MessageHWND = app.messageWnd;
|
||||||
|
Loading…
Reference in New Issue
Block a user