mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-10-14 03:20:22 +00:00
[host] windows: directly invoke ChangeWindowMessageFilterEx
This requires bumping the minimum Windows version to Windows 7, but I don't think we care about Vista anyways.
This commit is contained in:
@@ -65,15 +65,6 @@ struct AppState
|
||||
static struct AppState app = {0};
|
||||
HWND MessageHWND;
|
||||
|
||||
// linux mingw64 is missing this
|
||||
#ifndef MSGFLT_RESET
|
||||
#define MSGFLT_RESET (0)
|
||||
#define MSGFLT_ALLOW (1)
|
||||
#define MSGFLT_DISALLOW (2)
|
||||
#endif
|
||||
typedef WINBOOL WINAPI (*PChangeWindowMessageFilterEx)(HWND hwnd, UINT message, DWORD action, void * pChangeFilterStruct);
|
||||
PChangeWindowMessageFilterEx _ChangeWindowMessageFilterEx = NULL;
|
||||
|
||||
CreateProcessAsUserA_t f_CreateProcessAsUserA = NULL;
|
||||
|
||||
bool windowsSetupAPI(void)
|
||||
@@ -425,10 +416,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||
app.exitThreadEvent = CreateEvent(NULL, FALSE, FALSE, 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);
|
||||
ChangeWindowMessageFilterEx(app.messageWnd, app.trayRestartMsg, MSGFLT_ALLOW, NULL);
|
||||
|
||||
// set the global
|
||||
MessageHWND = app.messageWnd;
|
||||
|
Reference in New Issue
Block a user