mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-09 06:17:03 +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:
parent
2fc1d3cae6
commit
88fc1a6d24
@ -13,8 +13,8 @@ add_library(platform_Windows STATIC
|
||||
src/delay.c
|
||||
)
|
||||
|
||||
# allow use of functions for Windows Vista or later
|
||||
add_compile_definitions(WINVER=0x0600 _WIN32_WINNT=0x0600)
|
||||
# allow use of functions for Windows 7 or later
|
||||
add_compile_definitions(WINVER=0x0601 _WIN32_WINNT=0x0601)
|
||||
|
||||
add_subdirectory("capture")
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user