From 555ce4dfcc5b028219da4e6401a32f7f976044ae Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Tue, 24 Sep 2013 18:08:07 +0000 Subject: plugins cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@6211 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Scriver/scriver_10.vcxproj | 1 - plugins/Scriver/scriver_10.vcxproj.filters | 3 - plugins/Scriver/scriver_11.vcxproj | 1 - plugins/Scriver/scriver_11.vcxproj.filters | 3 - plugins/Scriver/src/globals.cpp | 3 +- plugins/Scriver/src/msgoptions.cpp | 26 +- plugins/Scriver/src/msgs.cpp | 5 - plugins/Scriver/src/msgs.h | 3 - plugins/Scriver/src/msgwindow.cpp | 6 +- plugins/Scriver/src/multimon.h | 381 ----------------------------- plugins/SmileyAdd/src/imagecache.cpp | 11 +- plugins/TooltipNotify/src/Tooltip.cpp | 13 +- plugins/Weather/src/weather_mwin.cpp | 16 +- plugins/WebView/src/webview_datawnd.cpp | 14 +- plugins/YAPP/src/message_pump.cpp | 2 - plugins/YAPP/src/popwin.cpp | 43 +--- plugins/YAPP/src/popwin.h | 1 - 17 files changed, 33 insertions(+), 499 deletions(-) delete mode 100644 plugins/Scriver/src/multimon.h (limited to 'plugins') diff --git a/plugins/Scriver/scriver_10.vcxproj b/plugins/Scriver/scriver_10.vcxproj index cab93a63bd..c75c25bcdc 100644 --- a/plugins/Scriver/scriver_10.vcxproj +++ b/plugins/Scriver/scriver_10.vcxproj @@ -250,7 +250,6 @@ - diff --git a/plugins/Scriver/scriver_10.vcxproj.filters b/plugins/Scriver/scriver_10.vcxproj.filters index 7c1cca3200..b6e855c27f 100644 --- a/plugins/Scriver/scriver_10.vcxproj.filters +++ b/plugins/Scriver/scriver_10.vcxproj.filters @@ -122,9 +122,6 @@ Header Files - - Header Files - Header Files diff --git a/plugins/Scriver/scriver_11.vcxproj b/plugins/Scriver/scriver_11.vcxproj index e30c09d19d..e294bc5749 100644 --- a/plugins/Scriver/scriver_11.vcxproj +++ b/plugins/Scriver/scriver_11.vcxproj @@ -253,7 +253,6 @@ - diff --git a/plugins/Scriver/scriver_11.vcxproj.filters b/plugins/Scriver/scriver_11.vcxproj.filters index 7c1cca3200..b6e855c27f 100644 --- a/plugins/Scriver/scriver_11.vcxproj.filters +++ b/plugins/Scriver/scriver_11.vcxproj.filters @@ -122,9 +122,6 @@ Header Files - - Header Files - Header Files diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index 1afbfd9c24..ce3d071f5b 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -24,7 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "commonheaders.h" GlobalMessageData g_dat; -extern PSLWA pSetLayeredWindowAttributes; static int ackevent(WPARAM wParam, LPARAM lParam); @@ -388,7 +387,7 @@ void ReloadGlobals() if (db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWTYPINGSWITCH, SRMSGDEFSET_SHOWTYPINGSWITCH)) g_dat.flags2 |= SMF2_SHOWTYPINGSWITCH; - if (LOBYTE(LOWORD(GetVersion())) >= 5 && pSetLayeredWindowAttributes != NULL) { + if (LOBYTE(LOWORD(GetVersion())) >= 5) { if (db_get_b(NULL, SRMMMOD, SRMSGSET_USETRANSPARENCY, SRMSGDEFSET_USETRANSPARENCY)) g_dat.flags2 |= SMF2_USETRANSPARENCY; g_dat.activeAlpha = db_get_dw(NULL, SRMMMOD, SRMSGSET_ACTIVEALPHA, SRMSGDEFSET_ACTIVEALPHA); diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index 262171f5d6..2a9354c5f1 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -510,23 +510,13 @@ static INT_PTR CALLBACK DlgProcLayoutOptions(HWND hwndDlg, UINT msg, WPARAM wPar SendDlgItemMessage(hwndDlg, IDC_INPUTLINESSPIN, UDM_SETRANGE, 0, MAKELONG(100, 1)); SendDlgItemMessage(hwndDlg, IDC_INPUTLINESSPIN, UDM_SETPOS, 0, db_get_dw(NULL, SRMMMOD, SRMSGSET_AUTORESIZELINES, SRMSGDEFSET_AUTORESIZELINES)); - if (pSetLayeredWindowAttributes == NULL) { - EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSPARENCY), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_ATRANSPARENCYVALUE), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_ATRANSPARENCYPERC), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_ITRANSPARENCYVALUE), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_ITRANSPARENCYPERC), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSPARENCYTEXT1), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSPARENCYTEXT2), FALSE); - } else { - bChecked = IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENCY); - EnableWindow(GetDlgItem(hwndDlg, IDC_ATRANSPARENCYVALUE), bChecked); - EnableWindow(GetDlgItem(hwndDlg, IDC_ATRANSPARENCYPERC), bChecked); - EnableWindow(GetDlgItem(hwndDlg, IDC_ITRANSPARENCYVALUE), bChecked); - EnableWindow(GetDlgItem(hwndDlg, IDC_ITRANSPARENCYPERC), bChecked); - EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSPARENCYTEXT1), bChecked); - EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSPARENCYTEXT2), bChecked); - } + bChecked = IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENCY); + EnableWindow(GetDlgItem(hwndDlg, IDC_ATRANSPARENCYVALUE), bChecked); + EnableWindow(GetDlgItem(hwndDlg, IDC_ATRANSPARENCYPERC), bChecked); + EnableWindow(GetDlgItem(hwndDlg, IDC_ITRANSPARENCYVALUE), bChecked); + EnableWindow(GetDlgItem(hwndDlg, IDC_ITRANSPARENCYPERC), bChecked); + EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSPARENCYTEXT1), bChecked); + EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSPARENCYTEXT2), bChecked); CheckDlgButton(hwndDlg, IDC_STATUSWIN, db_get_b(NULL, SRMMMOD, SRMSGSET_STATUSICON, SRMSGDEFSET_STATUSICON)); CheckDlgButton(hwndDlg, IDC_SHOWPROGRESS, db_get_b(NULL, SRMMMOD, SRMSGSET_SHOWPROGRESS, SRMSGDEFSET_SHOWPROGRESS)); @@ -537,7 +527,7 @@ static INT_PTR CALLBACK DlgProcLayoutOptions(HWND hwndDlg, UINT msg, WPARAM wPar case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_TRANSPARENCY: - if (pSetLayeredWindowAttributes != NULL) { + { int bChecked = IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENCY); EnableWindow(GetDlgItem(hwndDlg, IDC_ATRANSPARENCYVALUE), bChecked); EnableWindow(GetDlgItem(hwndDlg, IDC_ATRANSPARENCYPERC), bChecked); diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index 8872f21165..7c00117e84 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -29,8 +29,6 @@ HGENMENU hMsgMenuItem; extern HWND GetParentWindow(HANDLE hContact, BOOL bChat); -PSLWA pSetLayeredWindowAttributes; - #define EVENTTYPE_SCRIVER 2010 #define SCRIVER_DB_GETEVENTTEXT "Scriver/GetText" @@ -524,9 +522,6 @@ int OnLoadModule(void) return 0; } - HMODULE hDLL = GetModuleHandle(_T("user32")); - pSetLayeredWindowAttributes = (PSLWA) GetProcAddress(hDLL,"SetLayeredWindowAttributes"); - InitGlobals(); RichUtil_Load(); OleInitialize(NULL); diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h index f39b3eb115..db6cec558f 100644 --- a/plugins/Scriver/src/msgs.h +++ b/plugins/Scriver/src/msgs.h @@ -27,9 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define MSGERROR_RETRY 1 #define MSGERROR_DONE 2 -typedef DWORD (WINAPI *PSLWA)(HWND, DWORD, BYTE, DWORD); -extern PSLWA pSetLayeredWindowAttributes; - typedef struct ToolbarButtonStruct { TCHAR *name; diff --git a/plugins/Scriver/src/msgwindow.cpp b/plugins/Scriver/src/msgwindow.cpp index 99029f9758..abe6b0ac84 100644 --- a/plugins/Scriver/src/msgwindow.cpp +++ b/plugins/Scriver/src/msgwindow.cpp @@ -439,7 +439,7 @@ static void SetContainerWindowStyle(ParentWindowData *dat) ws |= dat->flags2 & SMF2_USETRANSPARENCY ? WS_EX_LAYERED : 0; SetWindowLongPtr(dat->hwnd , GWL_EXSTYLE , ws); if (dat->flags2 & SMF2_USETRANSPARENCY) - pSetLayeredWindowAttributes(dat->hwnd, RGB(255,255,255), (BYTE)(255-g_dat.inactiveAlpha), LWA_ALPHA); + SetLayeredWindowAttributes(dat->hwnd, RGB(255,255,255), (BYTE)(255-g_dat.inactiveAlpha), LWA_ALPHA); ws = GetWindowLongPtr(dat->hwndTabs, GWL_STYLE) & ~(TCS_BOTTOM | 0x2000); if (dat->flags2 & SMF2_TABSATBOTTOM) @@ -755,7 +755,7 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR ws |= dat->flags2 & SMF2_USETRANSPARENCY ? WS_EX_LAYERED : 0; SetWindowLongPtr(hwndDlg , GWL_EXSTYLE , ws); if (dat->flags2 & SMF2_USETRANSPARENCY) { - pSetLayeredWindowAttributes(hwndDlg, RGB(255,255,255), (BYTE)(255-g_dat.inactiveAlpha), LWA_ALPHA); + SetLayeredWindowAttributes(hwndDlg, RGB(255,255,255), (BYTE)(255-g_dat.inactiveAlpha), LWA_ALPHA); // RedrawWindow(hwndDlg, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN); } break; @@ -773,7 +773,7 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR ws |= dat->flags2 & SMF2_USETRANSPARENCY ? WS_EX_LAYERED : 0; SetWindowLongPtr(hwndDlg , GWL_EXSTYLE , ws); if (dat->flags2 & SMF2_USETRANSPARENCY) - pSetLayeredWindowAttributes(hwndDlg, RGB(255,255,255), (BYTE)(255-g_dat.activeAlpha), LWA_ALPHA); + SetLayeredWindowAttributes(hwndDlg, RGB(255,255,255), (BYTE)(255-g_dat.activeAlpha), LWA_ALPHA); break; case WM_LBUTTONDOWN: diff --git a/plugins/Scriver/src/multimon.h b/plugins/Scriver/src/multimon.h deleted file mode 100644 index 8498b775bd..0000000000 --- a/plugins/Scriver/src/multimon.h +++ /dev/null @@ -1,381 +0,0 @@ -//#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500) - -//============================================================================= -// -// MULTIMON -// stub module that "stubs" multiple monitor APIs on pre-Memphis Win32 OSes -// -// By using this header your code will work unchanged on Win95, -// you will get back correct values from GetSystemMetrics() for new metrics -// and the new APIs will act like only one display is present. -// -// exactly one source must include this with COMPILE_MULTIMON_STUBS defined -// -//============================================================================= - -#ifdef __cplusplus -extern "C" { /* Assume C declarations for C++ */ -#endif /* __cplusplus */ - -// -// if we are building on Win95/NT4 headers we need to declare this stuff ourselves -// -#ifndef SM_SAMEDISPLAYFORMAT -#define SM_SAMEDISPLAYFORMAT 81 -#endif - -#ifndef SM_CMONITORS -#ifndef MONITORINFOF_PRIMARY - -#define SM_XVIRTUALSCREEN 76 -#define SM_YVIRTUALSCREEN 77 -#define SM_CXVIRTUALSCREEN 78 -#define SM_CYVIRTUALSCREEN 79 -#define SM_CMONITORS 80 - -DECLARE_HANDLE(HMONITOR); - -typedef struct tagMONITORINFO -{ - DWORD cbSize; - RECT rcMonitor; - RECT rcWork; - DWORD dwFlags; -} MONITORINFO, *LPMONITORINFO; - -#define CCHDEVICENAME 32 -#endif // SM_CMONITORS - -#define MONITORINFOF_PRIMARY 0x00000001 - -#ifndef MONITOR_DEFAULTTONULL -#define MONITOR_DEFAULTTONULL 0x00000000 -#endif -#ifndef MONITOR_DEFAULTTOPRIMARY -#define MONITOR_DEFAULTTOPRIMARY 0x00000001 -#endif -#ifndef MONITOR_DEFAULTTONEAREST -#define MONITOR_DEFAULTTONEAREST 0x00000002 -#endif - -typedef BOOL (CALLBACK* MONITORENUMPROC)(HMONITOR, HDC, LPRECT, LPARAM); - - #ifdef __cplusplus - typedef struct tagMONITORINFOEX : public tagMONITORINFO - { - TCHAR szDevice[CCHDEVICENAME]; - } MONITORINFOEX, *LPMONITORINFOEX; - #else - typedef struct - { - MONITORINFO; - TCHAR szDevice[CCHDEVICENAME]; - } MONITORINFOEX, *LPMONITORINFOEX; - #endif - - -#ifndef DISPLAY_DEVICE_ATTACHED_TO_DESKTOP - -typedef struct { - DWORD cb; - CHAR DeviceName[32]; - CHAR DeviceString[128]; - DWORD StateFlags; -} DISPLAY_DEVICE; - -#define DISPLAY_DEVICE_ATTACHED_TO_DESKTOP 0x00000001 -#define DISPLAY_DEVICE_MULTI_DRIVER 0x00000002 -#define DISPLAY_DEVICE_PRIMARY_DEVICE 0x00000004 -#define DISPLAY_DEVICE_MIRRORING_DRIVER 0x00000008 - -#endif -#endif -#define DISPLAY_DEVICE_VGA 0x00000010 - -#ifndef ENUM_CURRENT_SETTINGS -#define ENUM_CURRENT_SETTINGS ((DWORD)-1) -#define ENUM_REGISTRY_SETTINGS ((DWORD)-2) -#endif - -#undef GetMonitorInfo -#undef GetSystemMetrics -#undef MonitorFromWindow -#undef MonitorFromRect -#undef MonitorFromPoint -#undef EnumDisplayMonitors -#undef EnumDisplayDevices - -// -// define this to compile the stubs -// otherwise you get the declarations -// -#ifdef COMPILE_MULTIMON_STUBS - - //--------------------------------------------------------------------------- - // - // Implement the API stubs. - // - //--------------------------------------------------------------------------- - - int (WINAPI* g_pfnGetSystemMetrics)(int); - HMONITOR (WINAPI* g_pfnMonitorFromWindow)(HWND, BOOL); - HMONITOR (WINAPI* g_pfnMonitorFromRect)(LPCRECT, BOOL); - HMONITOR (WINAPI* g_pfnMonitorFromPoint)(POINT, BOOL); - BOOL (WINAPI* g_pfnGetMonitorInfo)(HMONITOR, LPMONITORINFO); - BOOL (WINAPI* g_pfnEnumDisplayMonitors)(HDC, LPCRECT, - MONITORENUMPROC, LPARAM); - BOOL (WINAPI *g_pfnEnumDisplayDevices)(LPVOID, int, - DISPLAY_DEVICE *,DWORD); - - BOOL InitMultipleMonitorStubs(void) - { - HMODULE hUser32; - static BOOL fInitDone; - - if (fInitDone) - { - return g_pfnGetMonitorInfo != NULL; - } - - if ((hUser32 = GetModuleHandle(TEXT("USER32"))) && - (*(FARPROC*)&g_pfnGetSystemMetrics = GetProcAddress(hUser32,"GetSystemMetrics")) && - (*(FARPROC*)&g_pfnMonitorFromWindow = GetProcAddress(hUser32,"MonitorFromWindow")) && - (*(FARPROC*)&g_pfnMonitorFromRect = GetProcAddress(hUser32,"MonitorFromRect")) && - (*(FARPROC*)&g_pfnMonitorFromPoint = GetProcAddress(hUser32,"MonitorFromPoint")) && - (*(FARPROC*)&g_pfnEnumDisplayMonitors = GetProcAddress(hUser32,"EnumDisplayMonitors")) && - (*(FARPROC*)&g_pfnGetMonitorInfo = GetProcAddress(hUser32,"GetMonitorInfoW")) && - (*(FARPROC*)&g_pfnEnumDisplayDevices = GetProcAddress(hUser32,"EnumDisplayDevicesW")) && - (GetSystemMetrics(SM_CXVIRTUALSCREEN) >= GetSystemMetrics(SM_CXSCREEN)) && - (GetSystemMetrics(SM_CYVIRTUALSCREEN) >= GetSystemMetrics(SM_CYSCREEN))) - { - fInitDone = TRUE; - return TRUE; - } - else - { - g_pfnGetSystemMetrics = NULL; - g_pfnMonitorFromWindow = NULL; - g_pfnMonitorFromRect = NULL; - g_pfnMonitorFromPoint = NULL; - g_pfnGetMonitorInfo = NULL; - g_pfnEnumDisplayMonitors = NULL; - g_pfnEnumDisplayDevices = NULL; - - fInitDone = TRUE; - return FALSE; - } - } - - //--------------------------------------------------------------------------- - // - // "stubbed" implementations of Monitor APIs that work with the primary // display - // - //--------------------------------------------------------------------------- - - int WINAPI - xGetSystemMetrics(int nIndex) - { - if (InitMultipleMonitorStubs()) - return g_pfnGetSystemMetrics(nIndex); - - switch (nIndex) { - case SM_CMONITORS: - case SM_SAMEDISPLAYFORMAT: - return 1; - - case SM_XVIRTUALSCREEN: - case SM_YVIRTUALSCREEN: - return 0; - - case SM_CXVIRTUALSCREEN: - nIndex = SM_CXSCREEN; - break; - - case SM_CYVIRTUALSCREEN: - nIndex = SM_CYSCREEN; - break; - } - - return GetSystemMetrics(nIndex); - } - - #define xPRIMARY_MONITOR ((HMONITOR)0x42) - - HMONITOR WINAPI - xMonitorFromRect(LPCRECT lprcScreenCoords, UINT uFlags) - { - if (InitMultipleMonitorStubs()) - return g_pfnMonitorFromRect(lprcScreenCoords, uFlags); - - if ((uFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) || - ((lprcScreenCoords->right > 0) && - (lprcScreenCoords->bottom > 0) && - (lprcScreenCoords->left < GetSystemMetrics(SM_CXSCREEN)) && - (lprcScreenCoords->top < GetSystemMetrics(SM_CYSCREEN)))) - { - return xPRIMARY_MONITOR; - } - - return NULL; - } - - HMONITOR WINAPI - xMonitorFromWindow(HWND hWnd, UINT uFlags) - { - RECT rc; - - if (InitMultipleMonitorStubs()) - return g_pfnMonitorFromWindow(hWnd, uFlags); - - if (uFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) - return xPRIMARY_MONITOR; - - if (GetWindowRect(hWnd, &rc)) - return xMonitorFromRect(&rc, uFlags); - - return NULL; - } - - HMONITOR WINAPI - xMonitorFromPoint(POINT ptScreenCoords, UINT uFlags) - { - if (InitMultipleMonitorStubs()) - return g_pfnMonitorFromPoint(ptScreenCoords, uFlags); - - if ((uFlags & (MONITOR_DEFAULTTOPRIMARY | MONITOR_DEFAULTTONEAREST)) || - ((ptScreenCoords.x >= 0) && - (ptScreenCoords.x < GetSystemMetrics(SM_CXSCREEN)) && - (ptScreenCoords.y >= 0) && - (ptScreenCoords.y < GetSystemMetrics(SM_CYSCREEN)))) - { - return xPRIMARY_MONITOR; - } - - return NULL; - } - - BOOL WINAPI - xGetMonitorInfo(HMONITOR hMonitor, LPMONITORINFO lpMonitorInfo) - { - RECT rcWork; - - if (InitMultipleMonitorStubs()) - return g_pfnGetMonitorInfo(hMonitor, lpMonitorInfo); - - if ((hMonitor == xPRIMARY_MONITOR) && lpMonitorInfo && - (lpMonitorInfo->cbSize >= sizeof(MONITORINFO)) && - SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWork, 0)) - { - lpMonitorInfo->rcMonitor.left = 0; - lpMonitorInfo->rcMonitor.top = 0; - lpMonitorInfo->rcMonitor.right = GetSystemMetrics(SM_CXSCREEN); - lpMonitorInfo->rcMonitor.bottom = GetSystemMetrics(SM_CYSCREEN); - lpMonitorInfo->rcWork = rcWork; - lpMonitorInfo->dwFlags = MONITORINFOF_PRIMARY; - - if (lpMonitorInfo->cbSize >= sizeof(MONITORINFOEX)) - lstrcpy(((MONITORINFOEX*)lpMonitorInfo)->szDevice, - TEXT("DISPLAY")); - - return TRUE; - } - - return FALSE; - } - - BOOL WINAPI - xEnumDisplayMonitors( - HDC hdc, - LPCRECT lprcIntersect, - MONITORENUMPROC lpfnEnumProc, - LPARAM lData) - { - RECT rcCallback, rcLimit; - - if (InitMultipleMonitorStubs()) - return g_pfnEnumDisplayMonitors(hdc, lprcIntersect, lpfnEnumProc, - lData); - - if (!lpfnEnumProc) - return FALSE; - - rcLimit.left = 0; - rcLimit.top = 0; - rcLimit.right = GetSystemMetrics(SM_CXSCREEN); - rcLimit.bottom = GetSystemMetrics(SM_CYSCREEN); - - if (hdc) - { - RECT rcClip; - HWND hWnd; - - if ((hWnd = WindowFromDC(hdc)) == NULL) - return FALSE; - - switch (GetClipBox(hdc, &rcClip)) { - default: - MapWindowPoints(NULL, hWnd, (LPPOINT)&rcLimit, 2); - if (IntersectRect(&rcCallback, &rcClip, &rcLimit)) - break; - //fall thru - case NULLREGION: - return TRUE; - case ERROR: - return FALSE; - } - - rcLimit = rcCallback; - } - - if (!lprcIntersect || - IntersectRect(&rcCallback, lprcIntersect, &rcLimit)) - { - lpfnEnumProc(xPRIMARY_MONITOR, hdc, &rcCallback, lData); - } - - return TRUE; - } - - BOOL WINAPI - xEnumDisplayDevices(LPVOID lpReserved, int iDeviceNum, -DISPLAY_DEVICE * pDisplayDevice, DWORD dwFlags) - { - if (InitMultipleMonitorStubs()) - return g_pfnEnumDisplayDevices(lpReserved, iDeviceNum, - pDisplayDevice, dwFlags); - - return FALSE; - } - - #undef xPRIMARY_MONITOR - #undef COMPILE_MULTIMON_STUBS - -#else // COMPILE_MULTIMON_STUBS - - extern int WINAPI xGetSystemMetrics(int); - extern HMONITOR WINAPI xMonitorFromWindow(HWND, UINT); - extern HMONITOR WINAPI xMonitorFromRect(LPCRECT, UINT); - extern HMONITOR WINAPI xMonitorFromPoint(POINT, UINT); - extern BOOL WINAPI xGetMonitorInfo(HMONITOR, LPMONITORINFO); - extern BOOL WINAPI xEnumDisplayMonitors(HDC, LPCRECT, MONITORENUMPROC, - LPARAM); - extern BOOL WINAPI xEnumDisplayDevices(LPVOID, int, DISPLAY_DEVICE *,DWORD); - -#endif // COMPILE_MULTIMON_STUBS - -// -// build defines that replace the regular APIs with our versions -// -#define GetSystemMetrics xGetSystemMetrics -#define MonitorFromWindow xMonitorFromWindow -#define MonitorFromRect xMonitorFromRect -#define MonitorFromPoint xMonitorFromPoint -#define GetMonitorInfo xGetMonitorInfo -#define EnumDisplayMonitors xEnumDisplayMonitors -#define EnumDisplayDevices xEnumDisplayDevices - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -//#endif /* !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0500) */ \ No newline at end of file diff --git a/plugins/SmileyAdd/src/imagecache.cpp b/plugins/SmileyAdd/src/imagecache.cpp index 28de0704b8..9d6fff549c 100644 --- a/plugins/SmileyAdd/src/imagecache.cpp +++ b/plugins/SmileyAdd/src/imagecache.cpp @@ -18,9 +18,6 @@ along with this program. If not, see . #include "general.h" -typedef BOOL (WINAPI *tAlphaBlend)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION); -static tAlphaBlend pAlphaBlend; - static FI_INTERFACE *fei; static HANDLE g_hMutexIm; @@ -492,12 +489,12 @@ void ImageFType::DrawInternal(HDC hdc, int x, int y, int sizeX, int sizeY) BITMAP bm; GetObject(m_bmp, sizeof(bm), &bm); - if (bm.bmBitsPixel == 32 && pAlphaBlend) + if (bm.bmBitsPixel == 32) { BLENDFUNCTION bf = {0}; bf.SourceConstantAlpha = 255; bf.AlphaFormat = AC_SRC_ALPHA; - pAlphaBlend(hdc, x, y, sizeX, sizeY, hdcImg, 0, 0, bm.bmWidth, bm.bmHeight, bf); + GdiAlphaBlend(hdc, x, y, sizeX, sizeY, hdcImg, 0, 0, bm.bmWidth, bm.bmHeight, bf); } else { @@ -707,10 +704,6 @@ void InitImageCache(void) { g_hMutexIm = CreateMutex(NULL, FALSE, NULL); CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM) &fei); - - pAlphaBlend = (tAlphaBlend) GetProcAddress(GetModuleHandleA("gdi32"), "GdiAlphaBlend"); - if (pAlphaBlend == NULL) - pAlphaBlend = (tAlphaBlend) GetProcAddress(LoadLibraryA("msimg32"), "AlphaBlend"); } void DestroyImageCache(void) diff --git a/plugins/TooltipNotify/src/Tooltip.cpp b/plugins/TooltipNotify/src/Tooltip.cpp index 9821af1232..ccb92c15c5 100644 --- a/plugins/TooltipNotify/src/Tooltip.cpp +++ b/plugins/TooltipNotify/src/Tooltip.cpp @@ -169,17 +169,8 @@ void CTooltip::Hide() void CTooltip::set_Translucency(BYTE bAlpha) { - typedef BOOL (WINAPI *pfnSetLayeredWindowAttributes_t)(HWND, COLORREF, BYTE, DWORD); - pfnSetLayeredWindowAttributes_t pfnSetLayeredWindowAttributes; - - pfnSetLayeredWindowAttributes = reinterpret_cast - (GetProcAddress(GetModuleHandle(_T("user32.dll")), "SetLayeredWindowAttributes")); - - if (pfnSetLayeredWindowAttributes && - SetWindowLongPtr(m_hWnd, GWL_EXSTYLE, GetWindowLongPtr(m_hWnd, GWL_EXSTYLE) | WS_EX_LAYERED) != 0) - { - pfnSetLayeredWindowAttributes(m_hWnd, RGB(0,0,0), bAlpha, LWA_ALPHA); - } + if (SetWindowLongPtr(m_hWnd, GWL_EXSTYLE, GetWindowLongPtr(m_hWnd, GWL_EXSTYLE) | WS_EX_LAYERED) != 0) + SetLayeredWindowAttributes(m_hWnd, RGB(0,0,0), bAlpha, LWA_ALPHA); } void CTooltip::set_TransparentInput(BOOL bOnOff) diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index c127214999..0d4ba8317a 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -23,9 +23,6 @@ along with this program. If not, see . #define MS_TOOLTIP_SHOWTIP "mToolTip/ShowTip" #define MS_TOOLTIP_HIDETIP "mToolTip/HideTip" -typedef BOOL (WINAPI *ft_TrackMouseEvent) (LPTRACKMOUSEEVENT lpEventTrack); - -static ft_TrackMouseEvent f_TrackMouseEvent = NULL; static HANDLE hMwinWindowList; static HANDLE hFontHook; @@ -72,20 +69,19 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara break; case WM_MOUSEMOVE: - if (f_TrackMouseEvent) { TRACKMOUSEEVENT tme = {0}; tme.cbSize = sizeof(TRACKMOUSEEVENT); tme.hwndTrack = hwnd; tme.dwFlags = TME_QUERY; - f_TrackMouseEvent(&tme); + TrackMouseEvent(&tme); if (tme.dwFlags == 0) { tme.dwFlags = TME_HOVER | TME_LEAVE; tme.hwndTrack = hwnd; tme.dwHoverTime = CallService(MS_CLC_GETINFOTIPHOVERTIME, 0, 0); - f_TrackMouseEvent(&tme); + TrackMouseEvent(&tme); } } break; @@ -326,12 +322,8 @@ int RedrawFrame(WPARAM wParam, LPARAM lParam) void InitMwin(void) { - HMODULE hUser = GetModuleHandle(_T("user32.dll")); - - if ( !ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) return; - - f_TrackMouseEvent = (ft_TrackMouseEvent)GetProcAddress(hUser, "TrackMouseEvent"); - + if ( !ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) + return; hMwinWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST,0,0); diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp index 6a8ae4e6d1..cfaae10b78 100644 --- a/plugins/WebView/src/webview_datawnd.cpp +++ b/plugins/WebView/src/webview_datawnd.cpp @@ -508,25 +508,15 @@ void SavewinSettings(void) /*****************************************************************************/ void ValidatePosition(HWND hwndDlg) { - typedef HMONITOR WINAPI MyMonitorFromPoint(POINT, DWORD); - typedef BOOL WINAPI MyGetMonitorInfo(HMONITOR, LPMONITORINFO); - - HMODULE hUserInstance = GetModuleHandle(_T("user32")); - RECT r; SystemParametersInfo(SPI_GETWORKAREA, 0, &r, 0); - MyGetMonitorInfo *LPMyGetMonitorInfo = (MyGetMonitorInfo*)GetProcAddress(hUserInstance, "GetMonitorInfoA"); - MyMonitorFromPoint *LPMyMonitorFromPoint = (MyMonitorFromPoint*)GetProcAddress(hUserInstance, "MonitorFromPoint"); - if (LPMyMonitorFromPoint == NULL || LPMyGetMonitorInfo == NULL) - return; - POINT pt = { 0, 0 }; - HMONITOR hMonitor = LPMyMonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST); // always + HMONITOR hMonitor = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST); // always MONITORINFO monitorInfo; monitorInfo.cbSize = sizeof(MONITORINFO); - if ( LPMyGetMonitorInfo(hMonitor, &monitorInfo)) + if ( GetMonitorInfo(hMonitor, &monitorInfo)) CopyMemory(&r, &monitorInfo.rcMonitor, sizeof(RECT)); // /window going off right of screen* diff --git a/plugins/YAPP/src/message_pump.cpp b/plugins/YAPP/src/message_pump.cpp index a54c2cbba9..a08fb213f7 100644 --- a/plugins/YAPP/src/message_pump.cpp +++ b/plugins/YAPP/src/message_pump.cpp @@ -69,8 +69,6 @@ bool is_workstation_locked() unsigned __stdcall MessagePumpThread(void* param) { - InitWindowStack(); - if (param) SetEvent((HANDLE)param); MSG hwndMsg = {0}; diff --git a/plugins/YAPP/src/popwin.cpp b/plugins/YAPP/src/popwin.cpp index 5e2a766daf..abb3ba2010 100644 --- a/plugins/YAPP/src/popwin.cpp +++ b/plugins/YAPP/src/popwin.cpp @@ -1,11 +1,5 @@ #include "common.h" -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; -BOOL (WINAPI *MyGetMonitorInfo)(HMONITOR hMonitor, LPMONITORINFO mi) = 0; - #define ID_CLOSETIMER 0x0101 #define ID_MOVETIMER 0x0102 @@ -85,16 +79,16 @@ void AddWindowToStack(HWND hwnd) { RECT wa_rect; SystemParametersInfo(SPI_GETWORKAREA, 0, &wa_rect, 0); - if (options.use_mim_monitor && MyMonitorFromRect && MyGetMonitorInfo) + if (options.use_mim_monitor) { RECT clr; GetWindowRect((HWND)CallService(MS_CLUI_GETHWND, 0, 0), &clr); - HMONITOR hMonitor = MyMonitorFromRect(&clr, MONITOR_DEFAULTTONEAREST); + HMONITOR hMonitor = MonitorFromRect(&clr, MONITOR_DEFAULTTONEAREST); if (hMonitor) { MONITORINFO mi; mi.cbSize = sizeof(mi); - if (MyGetMonitorInfo(hMonitor, &mi)) + if (GetMonitorInfo(hMonitor, &mi)) wa_rect = mi.rcWork; } } @@ -276,16 +270,14 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa #endif #ifdef LWA_ALPHA - if (MySetLayeredWindowAttributes) { - MySetLayeredWindowAttributes(hwnd, RGB(0,0,0), (int)(options.opacity / 100.0 * 255), LWA_ALPHA); - if (options.trans_bg) { - COLORREF bg; - if (pd->colorBack == pd->colorText) - bg = colBg; - else - bg = pd->colorBack; - MySetLayeredWindowAttributes(hwnd, bg, 0, LWA_COLORKEY); - } + SetLayeredWindowAttributes(hwnd, RGB(0,0,0), (int)(options.opacity / 100.0 * 255), LWA_ALPHA); + if (options.trans_bg) { + COLORREF bg; + if (pd->colorBack == pd->colorText) + bg = colBg; + else + bg = pd->colorBack; + SetLayeredWindowAttributes(hwnd, bg, 0, LWA_COLORKEY); } #endif PostMessage(hwnd, UM_INITPOPUP, (WPARAM)hwnd, 0); @@ -746,19 +738,6 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa return DefWindowProc(hwnd, uMsg, wParam, lParam); } -void InitWindowStack() -{ - 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"); - MyMonitorFromRect=(HMONITOR (WINAPI*)(LPCRECT,DWORD))GetProcAddress(hUserDll, "MonitorFromRect"); - MyGetMonitorInfo=(BOOL (WINAPI*)(HMONITOR,LPMONITORINFO))GetProcAddress(hUserDll, "GetMonitorInfoW"); - } -} - -/////////////////////////////////////////////////////////////////////////////// - void PopupData::SetIcon(HICON hNewIcon) { if (flags & PDF_ICOLIB) { diff --git a/plugins/YAPP/src/popwin.h b/plugins/YAPP/src/popwin.h index d4b49b308c..c206ea2176 100644 --- a/plugins/YAPP/src/popwin.h +++ b/plugins/YAPP/src/popwin.h @@ -19,7 +19,6 @@ #define ANIMATE_HORZ 1 #define ANIMATE_VERT 2 -void InitWindowStack(); void DeinitWindowStack(); void BroadcastMessage(UINT msg, WPARAM wParam, LPARAM lParam); -- cgit v1.2.3