summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--yapp/message_pump.cpp10
-rw-r--r--yapp/message_pump.h2
-rw-r--r--yapp/popups2_9.vcproj2
-rw-r--r--yapp/popwin.cpp7
4 files changed, 8 insertions, 13 deletions
diff --git a/yapp/message_pump.cpp b/yapp/message_pump.cpp
index 2ece03c..1d88388 100644
--- a/yapp/message_pump.cpp
+++ b/yapp/message_pump.cpp
@@ -4,7 +4,7 @@
#include "services.h"
#include "options.h"
-DWORD message_pump_thread_id = 0;
+unsigned message_pump_thread_id = 0;
int num_popups = 0;
HANDLE hMPEvent;
@@ -72,9 +72,7 @@ bool is_workstation_locked()
}
-DWORD CALLBACK MessagePumpThread(LPVOID param) {
- CallService(MS_SYSTEM_THREAD_PUSH, 0, 0);
-
+unsigned __stdcall MessagePumpThread(void* param) {
InitWindowStack();
if(param) SetEvent((HANDLE)param);
@@ -154,8 +152,6 @@ DWORD CALLBACK MessagePumpThread(LPVOID param) {
DeinitOptions();
DeinitServices();
- CallService(MS_SYSTEM_THREAD_POP, 0, 0);
-
return 0;
}
@@ -180,7 +176,7 @@ void InitMessagePump() {
InitServices();
hMPEvent = CreateEvent(0, TRUE, 0, 0);
- CloseHandle(CreateThread(0, 0, MessagePumpThread, hMPEvent, 0, &message_pump_thread_id));
+ CloseHandle(mir_forkthreadex(MessagePumpThread, hMPEvent, 0, &message_pump_thread_id));
WaitForSingleObject(hMPEvent, INFINITE);
CloseHandle(hMPEvent);
}
diff --git a/yapp/message_pump.h b/yapp/message_pump.h
index 52f7970..70671b1 100644
--- a/yapp/message_pump.h
+++ b/yapp/message_pump.h
@@ -1,7 +1,7 @@
#ifndef _MESSAGE_PUMP_INC
#define _MESSAGE_PUMP_INC
-extern DWORD message_pump_thread_id;
+extern unsigned message_pump_thread_id;
void PostMPMessage(UINT msg, WPARAM, LPARAM);
#define MUM_CREATEPOPUP (WM_USER + 0x011)
diff --git a/yapp/popups2_9.vcproj b/yapp/popups2_9.vcproj
index 8cf6d3c..4668ea3 100644
--- a/yapp/popups2_9.vcproj
+++ b/yapp/popups2_9.vcproj
@@ -375,7 +375,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="./docs;../../include"
+ AdditionalIncludeDirectories="./docs;../../../include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;POPUPS2_EXPORTS;_UNICODE;UNICODE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
diff --git a/yapp/popwin.cpp b/yapp/popwin.cpp
index cceee79..64ed48c 100644
--- a/yapp/popwin.cpp
+++ b/yapp/popwin.cpp
@@ -633,9 +633,9 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if(ace && (ace->dwFlags & AVS_BITMAP_VALID) && !(ace->dwFlags & AVS_HIDEONCLIST)) {
if(ace->bmHeight >= ace->bmWidth) {
pwd->real_av_height = options.av_size;
- pwd->real_av_width = (int)(options.av_size * (ace->bmWidth / (double)ace->bmHeight));
+ pwd->real_av_width = options.av_size * ace->bmWidth / ace->bmHeight;
} else {
- pwd->real_av_height = (int)(options.av_size * (ace->bmHeight / (double)ace->bmWidth));
+ pwd->real_av_height = options.av_size * ace->bmHeight / ace->bmWidth;
pwd->real_av_width = options.av_size;
}
pwd->have_av = true;
@@ -762,7 +762,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
void InitWindowStack() {
- hUserDll = LoadLibrary(_T("user32.dll"));
+ hUserDll = GetModuleHandle(_T("user32.dll"));
if (hUserDll) {
MySetLayeredWindowAttributes = (BOOL (WINAPI *)(HWND,COLORREF,BYTE,DWORD))GetProcAddress(hUserDll, "SetLayeredWindowAttributes");
MyAnimateWindow=(BOOL (WINAPI*)(HWND,DWORD,DWORD))GetProcAddress(hUserDll,"AnimateWindow");
@@ -777,6 +777,5 @@ void InitWindowStack() {
void DeinitWindowStack() {
ClearStack();
- if(hUserDll) FreeLibrary(hUserDll);
}