diff options
Diffstat (limited to 'yapp/message_pump.cpp')
-rw-r--r-- | yapp/message_pump.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/yapp/message_pump.cpp b/yapp/message_pump.cpp index 535f8fc..db84f64 100644 --- a/yapp/message_pump.cpp +++ b/yapp/message_pump.cpp @@ -16,8 +16,8 @@ HANDLE hMPEvent; // from popups, popup2 implementation, slightly modified
// return true if there is a full-screen application (e.g. game) running
bool is_full_screen() {
- int w = GetSystemMetrics(SM_CXFULLSCREEN);
- int h = GetSystemMetrics(SM_CYFULLSCREEN);
+ int w = GetSystemMetrics(SM_CXSCREEN);
+ int h = GetSystemMetrics(SM_CYSCREEN);
// use ClientRect instead of WindowRect so that it works normally for maximized applications - thx Nikto
RECT ClientRect;
HWND hWnd = 0;
@@ -106,6 +106,7 @@ DWORD CALLBACK MessagePumpThread(LPVOID param) { if((options.disable_full_screen && is_full_screen()) || is_workstation_locked())
enabled = false;
+ PopupData *pd = (PopupData *)hwndMsg.lParam;
if(enabled && num_popups < MAX_POPUPS) {
//HWND hwnd = CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_TOPMOST, POP_WIN_CLASS, _T("Popup"), WS_POPUP, 0, 0, 0, 0, GetDesktopWindow(), 0, hInst, (LPVOID)hwndMsg.lParam);
HWND hwnd = CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_TOPMOST, POP_WIN_CLASS, _T("Popup"), WS_POPUP, 0, 0, 0, 0, 0, 0, hInst, (LPVOID)hwndMsg.lParam);
@@ -113,7 +114,9 @@ DWORD CALLBACK MessagePumpThread(LPVOID param) { if(hwndMsg.wParam) // set notifyer handle
SendMessage(hwnd, PUM_SETNOTIFYH, hwndMsg.wParam, 0);
} else {
- free((void *)hwndMsg.lParam);
+ if(pd && pd->pwzTitle) free(pd->pwzTitle);
+ if(pd && pd->pwzText) free(pd->pwzText);
+ if(pd) free(pd);
}
}
break;
@@ -172,7 +175,7 @@ void PostMPMessage(UINT msg, WPARAM wParam, LPARAM lParam) { // will post a message to the message queue which will set the hwnd value
// and then set the event...so create an event, call this function and then wait on the event
// when the event is signalled, the hwnd will be valid
-void FindWindow(POPUPDATAW *pd, HANDLE hEvent, HWND *hwnd);
+void FindWindow(PopupData *pd, HANDLE hEvent, HWND *hwnd);
void InitMessagePump() {
WNDCLASS popup_win_class = {0};
@@ -192,6 +195,5 @@ void InitMessagePump() { }
void DeinitMessagePump() {
-
PostMPMessage(WM_QUIT, 0, 0);
}
|