From 783ba1f8e28e5ce0bb50e0b90a6e390095c2053a Mon Sep 17 00:00:00 2001 From: sje Date: Mon, 29 Jan 2007 22:40:51 +0000 Subject: dynamic load of MonitorFromRect func - not available on NT4 git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@88 4f64403b-2f21-0410-a795-97e2b3489a10 --- yapp/popwin.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'yapp/popwin.cpp') diff --git a/yapp/popwin.cpp b/yapp/popwin.cpp index 3e327b3..4edb028 100644 --- a/yapp/popwin.cpp +++ b/yapp/popwin.cpp @@ -7,6 +7,7 @@ HMODULE hUserDll; BOOL (WINAPI *MySetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD) = 0; BOOL (WINAPI *MyAnimateWindow)(HWND hWnd,DWORD dwTime,DWORD dwFlags) = 0; +HMONITOR (WINAPI *MyMonitorFromRect)(LPCRECT rect, DWORD flags) = 0; #define ID_CLOSETIMER 0x0101 #define ID_MOVETIMER 0x0102 @@ -16,11 +17,11 @@ int global_mouse_in = 0; void SetStartValues() { RECT wa_rect; - if(options.use_mim_monitor) { + if(options.use_mim_monitor && MyMonitorFromRect) { RECT clr; HMONITOR hMonitor; GetWindowRect((HWND)CallService(MS_CLUI_GETHWND, 0, 0), &clr); - hMonitor = MonitorFromRect(&clr, MONITOR_DEFAULTTONEAREST); + hMonitor = MyMonitorFromRect(&clr, MONITOR_DEFAULTTONEAREST); MONITORINFO mi; mi.cbSize = sizeof(mi); @@ -726,6 +727,7 @@ void InitWindowStack() { if (hUserDll) { MySetLayeredWindowAttributes = (BOOL (WINAPI *)(HWND,COLORREF,BYTE,DWORD))GetProcAddress(hUserDll, "SetLayeredWindowAttributes"); MyAnimateWindow=(BOOL (WINAPI*)(HWND,DWORD,DWORD))GetProcAddress(hUserDll,"AnimateWindow"); + MyMonitorFromRect=(HMONITOR (WINAPI*)(LPCRECT,DWORD))GetProcAddress(hUserDll, "MonitorFromRect"); } } -- cgit v1.2.3