summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/commonheaders.h1
-rw-r--r--src/core/miranda.cpp89
-rw-r--r--src/core/miranda.h61
-rw-r--r--src/miranda32_10.vcxproj8
-rw-r--r--src/miranda32_11.vcxproj8
-rw-r--r--src/modules/button/button.cpp40
-rw-r--r--src/modules/clist/Docking.cpp17
-rw-r--r--src/modules/clist/clc.cpp2
-rw-r--r--src/modules/clist/clistmenus.cpp2
-rw-r--r--src/modules/clist/clistmod.cpp14
-rw-r--r--src/modules/clist/clisttray.cpp12
-rw-r--r--src/modules/clist/clui.cpp114
-rw-r--r--src/modules/clist/genmenu.cpp5
-rw-r--r--src/modules/clist/genmenuopt.cpp3
-rw-r--r--src/modules/database/profilemanager.cpp5
-rw-r--r--src/modules/findadd/findadd.cpp14
-rw-r--r--src/modules/icolib/skin2opts.cpp3
-rw-r--r--src/modules/ignore/ignore.cpp2
-rw-r--r--src/modules/netlib/netlibopenconn.cpp8
-rw-r--r--src/modules/netlib/netlibsock.cpp33
-rw-r--r--src/modules/options/headerbar.cpp6
-rw-r--r--src/modules/options/iconheader.cpp22
-rw-r--r--src/modules/options/options.cpp51
-rw-r--r--src/modules/plugins/pluginopts.cpp2
-rw-r--r--src/modules/skin/hotkey_opts.cpp2
-rw-r--r--src/modules/utils/hyperlink.cpp15
-rw-r--r--src/modules/utils/path.cpp4
-rw-r--r--src/modules/utils/utils.cpp25
-rw-r--r--src/modules/visibility/visibility.cpp2
29 files changed, 176 insertions, 394 deletions
diff --git a/src/core/commonheaders.h b/src/core/commonheaders.h
index 2071149f19..e37660c06f 100644
--- a/src/core/commonheaders.h
+++ b/src/core/commonheaders.h
@@ -38,6 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <uxtheme.h>
#include <commctrl.h>
#include <vssym32.h>
+#include <Shlwapi.h>
#include <map>
#include <vector>
diff --git a/src/core/miranda.cpp b/src/core/miranda.cpp
index 20d841f528..4ec80c2fe5 100644
--- a/src/core/miranda.cpp
+++ b/src/core/miranda.cpp
@@ -31,37 +31,8 @@ int LoadDefaultModules(void);
void UnloadNewPluginsModule(void);
void UnloadDefaultModules(void);
-pfnMyMonitorFromPoint MyMonitorFromPoint;
-pfnMyMonitorFromRect MyMonitorFromRect;
-pfnMyMonitorFromWindow MyMonitorFromWindow;
-pfnMyGetMonitorInfo MyGetMonitorInfo;
-
-typedef DWORD (WINAPI *pfnMsgWaitForMultipleObjectsEx)(DWORD, CONST HANDLE*, DWORD, DWORD, DWORD);
-pfnMsgWaitForMultipleObjectsEx msgWaitForMultipleObjectsEx;
-
-pfnSHAutoComplete shAutoComplete;
-pfnSHGetSpecialFolderPathA shGetSpecialFolderPathA;
-pfnSHGetSpecialFolderPathW shGetSpecialFolderPathW;
-
-pfnOpenInputDesktop openInputDesktop;
-pfnCloseDesktop closeDesktop;
-
-pfnAnimateWindow animateWindow;
-pfnSetLayeredWindowAttributes setLayeredWindowAttributes;
-
-pfnOpenThemeData openThemeData;
-pfnIsThemeBackgroundPartiallyTransparent isThemeBackgroundPartiallyTransparent;
-pfnDrawThemeParentBackground drawThemeParentBackground;
-pfnDrawThemeBackground drawThemeBackground;
-pfnDrawThemeText drawThemeText;
pfnDrawThemeTextEx drawThemeTextEx;
-pfnGetThemeBackgroundContentRect getThemeBackgroundContentRect;
-pfnGetThemeFont getThemeFont;
-pfnCloseThemeData closeThemeData;
-pfnEnableThemeDialogTexture enableThemeDialogTexture;
-pfnSetWindowTheme setWindowTheme;
pfnSetWindowThemeAttribute setWindowThemeAttribute;
-pfnIsThemeActive isThemeActive;
pfnBufferedPaintInit bufferedPaintInit;
pfnBufferedPaintUninit bufferedPaintUninit;
pfnBeginBufferedPaint beginBufferedPaint;
@@ -71,11 +42,6 @@ pfnGetBufferedPaintBits getBufferedPaintBits;
pfnDwmExtendFrameIntoClientArea dwmExtendFrameIntoClientArea;
pfnDwmIsCompositionEnabled dwmIsCompositionEnabled;
-LPFN_GETADDRINFO MyGetaddrinfo;
-LPFN_FREEADDRINFO MyFreeaddrinfo;
-LPFN_WSASTRINGTOADDRESSA MyWSAStringToAddress;
-LPFN_WSAADDRESSTOSTRINGA MyWSAAddressToString;
-
ITaskbarList3 * pTaskbarInterface;
HANDLE hOkToExitEvent, hModulesLoadedEvent;
@@ -232,45 +198,16 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR cmdLine, int)
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif
- HINSTANCE hUser32 = GetModuleHandleA("user32");
- openInputDesktop = (pfnOpenInputDesktop)GetProcAddress (hUser32, "OpenInputDesktop");
- closeDesktop = (pfnCloseDesktop)GetProcAddress (hUser32, "CloseDesktop");
- msgWaitForMultipleObjectsEx = (pfnMsgWaitForMultipleObjectsEx)GetProcAddress(hUser32, "MsgWaitForMultipleObjectsEx");
- animateWindow = (pfnAnimateWindow)GetProcAddress(hUser32, "AnimateWindow");
- setLayeredWindowAttributes = (pfnSetLayeredWindowAttributes)GetProcAddress(hUser32, "SetLayeredWindowAttributes");
-
- MyMonitorFromPoint = (pfnMyMonitorFromPoint)GetProcAddress(hUser32, "MonitorFromPoint");
- MyMonitorFromRect = (pfnMyMonitorFromRect)GetProcAddress(hUser32, "MonitorFromRect");
- MyMonitorFromWindow = (pfnMyMonitorFromWindow)GetProcAddress(hUser32, "MonitorFromWindow");
- MyGetMonitorInfo = (pfnMyGetMonitorInfo)GetProcAddress(hUser32, "GetMonitorInfoW");
-
- HINSTANCE hShFolder = GetModuleHandleA("shell32");
- shGetSpecialFolderPathA = (pfnSHGetSpecialFolderPathA)GetProcAddress(hShFolder, "SHGetSpecialFolderPathA");
- shGetSpecialFolderPathW = (pfnSHGetSpecialFolderPathW)GetProcAddress(hShFolder, "SHGetSpecialFolderPathW");
- if (shGetSpecialFolderPathA == NULL) {
- HINSTANCE hShFolder = LoadLibraryA("ShFolder.dll");
- shGetSpecialFolderPathA = (pfnSHGetSpecialFolderPathA)GetProcAddress(hShFolder, "SHGetSpecialFolderPathA");
- shGetSpecialFolderPathW = (pfnSHGetSpecialFolderPathW)GetProcAddress(hShFolder, "SHGetSpecialFolderPathW");
- }
-
- shAutoComplete = (pfnSHAutoComplete)GetProcAddress(GetModuleHandleA("shlwapi"), "SHAutoComplete");
-
- if ( IsWinVerXPPlus()) {
+ if ( IsWinVerVistaPlus()) {
+ HINSTANCE hDwmApi = LoadLibraryA("dwmapi.dll");
+ if (hDwmApi) {
+ dwmExtendFrameIntoClientArea = (pfnDwmExtendFrameIntoClientArea)GetProcAddress(hDwmApi, "DwmExtendFrameIntoClientArea");
+ dwmIsCompositionEnabled = (pfnDwmIsCompositionEnabled)GetProcAddress(hDwmApi, "DwmIsCompositionEnabled");
+ }
HINSTANCE hThemeAPI = LoadLibraryA("uxtheme.dll");
if (hThemeAPI) {
- openThemeData = (pfnOpenThemeData)GetProcAddress(hThemeAPI, "OpenThemeData");
- isThemeBackgroundPartiallyTransparent = (pfnIsThemeBackgroundPartiallyTransparent)GetProcAddress(hThemeAPI, "IsThemeBackgroundPartiallyTransparent");
- drawThemeParentBackground = (pfnDrawThemeParentBackground)GetProcAddress(hThemeAPI, "DrawThemeParentBackground");
- drawThemeBackground = (pfnDrawThemeBackground)GetProcAddress(hThemeAPI, "DrawThemeBackground");
- drawThemeText = (pfnDrawThemeText)GetProcAddress(hThemeAPI, "DrawThemeText");
drawThemeTextEx = (pfnDrawThemeTextEx)GetProcAddress(hThemeAPI, "DrawThemeTextEx");
- getThemeBackgroundContentRect = (pfnGetThemeBackgroundContentRect)GetProcAddress(hThemeAPI , "GetThemeBackgroundContentRect");
- getThemeFont = (pfnGetThemeFont)GetProcAddress(hThemeAPI, "GetThemeFont");
- closeThemeData = (pfnCloseThemeData)GetProcAddress(hThemeAPI, "CloseThemeData");
- enableThemeDialogTexture = (pfnEnableThemeDialogTexture)GetProcAddress(hThemeAPI, "EnableThemeDialogTexture");
- setWindowTheme = (pfnSetWindowTheme)GetProcAddress(hThemeAPI, "SetWindowTheme");
setWindowThemeAttribute = (pfnSetWindowThemeAttribute)GetProcAddress(hThemeAPI, "SetWindowThemeAttribute");
- isThemeActive = (pfnIsThemeActive)GetProcAddress(hThemeAPI, "IsThemeActive");
bufferedPaintInit = (pfnBufferedPaintInit)GetProcAddress(hThemeAPI, "BufferedPaintInit");
bufferedPaintUninit = (pfnBufferedPaintUninit)GetProcAddress(hThemeAPI, "BufferedPaintUninit");
beginBufferedPaint = (pfnBeginBufferedPaint)GetProcAddress(hThemeAPI, "BeginBufferedPaint");
@@ -279,20 +216,6 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR cmdLine, int)
}
}
- if ( IsWinVerVistaPlus()) {
- HINSTANCE hDwmApi = LoadLibraryA("dwmapi.dll");
- if (hDwmApi) {
- dwmExtendFrameIntoClientArea = (pfnDwmExtendFrameIntoClientArea)GetProcAddress(hDwmApi, "DwmExtendFrameIntoClientArea");
- dwmIsCompositionEnabled = (pfnDwmIsCompositionEnabled)GetProcAddress(hDwmApi, "DwmIsCompositionEnabled");
- }
- }
-
- HMODULE hWinSock = GetModuleHandleA("ws2_32");
- MyGetaddrinfo = (LPFN_GETADDRINFO)GetProcAddress(hWinSock, "getaddrinfo");
- MyFreeaddrinfo = (LPFN_FREEADDRINFO)GetProcAddress(hWinSock, "freeaddrinfo");
- MyWSAStringToAddress = (LPFN_WSASTRINGTOADDRESSA)GetProcAddress(hWinSock, "WSAStringToAddressA");
- MyWSAAddressToString = (LPFN_WSAADDRESSTOSTRINGA)GetProcAddress(hWinSock, "WSAAddressToStringA");
-
if (bufferedPaintInit)
bufferedPaintInit();
diff --git a/src/core/miranda.h b/src/core/miranda.h
index c34ea56ad1..4b5f3b053f 100644
--- a/src/core/miranda.h
+++ b/src/core/miranda.h
@@ -23,72 +23,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define OPTIONPAGE_OLD_SIZE offsetof(OPTIONSDIALOGPAGE,hLangpack)
-typedef HMONITOR (WINAPI *pfnMyMonitorFromPoint)(POINT, DWORD);
-extern pfnMyMonitorFromPoint MyMonitorFromPoint;
-
-typedef HMONITOR (WINAPI *pfnMyMonitorFromRect)(LPCRECT, DWORD);
-extern pfnMyMonitorFromRect MyMonitorFromRect;
-
-typedef HMONITOR(WINAPI *pfnMyMonitorFromWindow) (HWND, DWORD);
-extern pfnMyMonitorFromWindow MyMonitorFromWindow;
-
-typedef BOOL(WINAPI *pfnMyGetMonitorInfo) (HMONITOR, LPMONITORINFO);
-extern pfnMyGetMonitorInfo MyGetMonitorInfo;
-
-typedef HRESULT (STDAPICALLTYPE *pfnSHAutoComplete)(HWND, DWORD);
-extern pfnSHAutoComplete shAutoComplete;
-
-typedef HRESULT (STDAPICALLTYPE *pfnSHGetSpecialFolderPathA)(HWND, LPSTR, int, BOOL);
-typedef HRESULT (STDAPICALLTYPE *pfnSHGetSpecialFolderPathW)(HWND, LPWSTR, int, BOOL);
-extern pfnSHGetSpecialFolderPathA shGetSpecialFolderPathA;
-extern pfnSHGetSpecialFolderPathW shGetSpecialFolderPathW;
-
-#define shGetSpecialFolderPath shGetSpecialFolderPathW
-
-typedef HDESK (WINAPI* pfnOpenInputDesktop)(DWORD, BOOL, DWORD);
-extern pfnOpenInputDesktop openInputDesktop;
-
-typedef HDESK (WINAPI* pfnCloseDesktop)(HDESK);
-extern pfnCloseDesktop closeDesktop;
-
-typedef BOOL (WINAPI* pfnAnimateWindow)(HWND, DWORD, DWORD);
-extern pfnAnimateWindow animateWindow;
-
-typedef BOOL (WINAPI * pfnSetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD);
-extern pfnSetLayeredWindowAttributes setLayeredWindowAttributes;
-
-typedef HTHEME (STDAPICALLTYPE *pfnOpenThemeData)(HWND, LPCWSTR);
-typedef HRESULT (STDAPICALLTYPE *pfnIsThemeBackgroundPartiallyTransparent)(HTHEME, int, int);
-typedef HRESULT (STDAPICALLTYPE *pfnDrawThemeParentBackground)(HWND, HDC, const RECT *);
-typedef HRESULT (STDAPICALLTYPE *pfnDrawThemeBackground)(HTHEME, HDC, int, int, const RECT *, const RECT *);
-typedef HRESULT (STDAPICALLTYPE *pfnDrawThemeText)(HTHEME, HDC, int, int, LPCWSTR, int, DWORD, DWORD, const RECT *);
typedef HRESULT (STDAPICALLTYPE *pfnDrawThemeTextEx)(HTHEME, HDC, int, int, LPCWSTR, int, DWORD, LPRECT, const struct _DTTOPTS *);
-typedef HRESULT (STDAPICALLTYPE *pfnGetThemeBackgroundContentRect)(HTHEME, HDC, int, int, LPCRECT, LPRECT);
-typedef HRESULT (STDAPICALLTYPE *pfnGetThemeFont)(HTHEME, HDC, int, int, int, LOGFONT *);
-typedef HRESULT (STDAPICALLTYPE *pfnCloseThemeData)(HTHEME);
-typedef HRESULT (STDAPICALLTYPE *pfnEnableThemeDialogTexture)(HWND hwnd, DWORD dwFlags);
-typedef HRESULT (STDAPICALLTYPE *pfnSetWindowTheme)(HWND, LPCWSTR, LPCWSTR);
typedef HRESULT (STDAPICALLTYPE *pfnSetWindowThemeAttribute)(HWND, enum WINDOWTHEMEATTRIBUTETYPE, PVOID, DWORD);
-typedef BOOL (STDAPICALLTYPE *pfnIsThemeActive)();
typedef HRESULT (STDAPICALLTYPE *pfnBufferedPaintInit)(void);
typedef HRESULT (STDAPICALLTYPE *pfnBufferedPaintUninit)(void);
typedef HANDLE (STDAPICALLTYPE *pfnBeginBufferedPaint)(HDC, RECT *, BP_BUFFERFORMAT, BP_PAINTPARAMS *, HDC *);
typedef HRESULT (STDAPICALLTYPE *pfnEndBufferedPaint)(HANDLE, BOOL);
typedef HRESULT (STDAPICALLTYPE *pfnGetBufferedPaintBits)(HANDLE, RGBQUAD **, int *);
-extern pfnOpenThemeData openThemeData;
-extern pfnIsThemeBackgroundPartiallyTransparent isThemeBackgroundPartiallyTransparent;
-extern pfnDrawThemeParentBackground drawThemeParentBackground;
-extern pfnDrawThemeBackground drawThemeBackground;
-extern pfnDrawThemeText drawThemeText;
extern pfnDrawThemeTextEx drawThemeTextEx;
-extern pfnGetThemeBackgroundContentRect getThemeBackgroundContentRect;
-extern pfnGetThemeFont getThemeFont;
-extern pfnCloseThemeData closeThemeData;
-extern pfnEnableThemeDialogTexture enableThemeDialogTexture;
-extern pfnSetWindowTheme setWindowTheme;
extern pfnSetWindowThemeAttribute setWindowThemeAttribute;
-extern pfnIsThemeActive isThemeActive;
extern pfnBufferedPaintInit bufferedPaintInit;
extern pfnBufferedPaintUninit bufferedPaintUninit;
extern pfnBeginBufferedPaint beginBufferedPaint;
@@ -103,11 +47,6 @@ typedef HRESULT (STDAPICALLTYPE *pfnDwmIsCompositionEnabled)(BOOL *);
extern pfnDwmExtendFrameIntoClientArea dwmExtendFrameIntoClientArea;
extern pfnDwmIsCompositionEnabled dwmIsCompositionEnabled;
-extern LPFN_GETADDRINFO MyGetaddrinfo;
-extern LPFN_FREEADDRINFO MyFreeaddrinfo;
-extern LPFN_WSASTRINGTOADDRESSA MyWSAStringToAddress;
-extern LPFN_WSAADDRESSTOSTRINGA MyWSAAddressToString;
-
/**** database.cpp *********************************************************************/
extern MIDatabase* currDb;
diff --git a/src/miranda32_10.vcxproj b/src/miranda32_10.vcxproj
index e9850e16b8..c0bb64200b 100644
--- a/src/miranda32_10.vcxproj
+++ b/src/miranda32_10.vcxproj
@@ -91,7 +91,7 @@
<AdditionalIncludeDirectories>..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;winmm.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;winmm.lib;version.lib;UxTheme.lib;Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;type=%27win32%27 name=%27Microsoft.Windows.Gdiplus%27 version=%271.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@@ -127,7 +127,7 @@
<AdditionalIncludeDirectories>..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;winmm.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;winmm.lib;version.lib;UxTheme.lib;Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;type=%27win32%27 name=%27Microsoft.Windows.Gdiplus%27 version=%271.0.0.0%27 processorArchitecture=%27amd64%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@@ -160,7 +160,7 @@
<AdditionalIncludeDirectories>..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;winmm.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;winmm.lib;version.lib;UxTheme.lib;Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;type=%27win32%27 name=%27Microsoft.Windows.Gdiplus%27 version=%271.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@@ -190,7 +190,7 @@
<AdditionalIncludeDirectories>..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;winmm.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;winmm.lib;version.lib;UxTheme.lib;Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;type=%27win32%27 name=%27Microsoft.Windows.Gdiplus%27 version=%271.0.0.0%27 processorArchitecture=%27amd64%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
diff --git a/src/miranda32_11.vcxproj b/src/miranda32_11.vcxproj
index 973d7d78e5..aed9777a24 100644
--- a/src/miranda32_11.vcxproj
+++ b/src/miranda32_11.vcxproj
@@ -95,7 +95,7 @@
<AdditionalIncludeDirectories>..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;winmm.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;winmm.lib;version.lib;UxTheme.lib;Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;type=%27win32%27 name=%27Microsoft.Windows.Gdiplus%27 version=%271.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@@ -130,7 +130,7 @@
<AdditionalIncludeDirectories>..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;winmm.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;winmm.lib;version.lib;UxTheme.lib;Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;type=%27win32%27 name=%27Microsoft.Windows.Gdiplus%27 version=%271.0.0.0%27 processorArchitecture=%27amd64%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@@ -162,7 +162,7 @@
<AdditionalIncludeDirectories>..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;winmm.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;winmm.lib;version.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;type=%27win32%27 name=%27Microsoft.Windows.Gdiplus%27 version=%271.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@@ -193,7 +193,7 @@
<AdditionalIncludeDirectories>..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;winmm.lib;version.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;winmm.lib;version.lib;UxTheme.lib;Shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;type=%27win32%27 name=%27Microsoft.Windows.Gdiplus%27 version=%271.0.0.0%27 processorArchitecture=%27amd64%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
diff --git a/src/modules/button/button.cpp b/src/modules/button/button.cpp
index 1a2ae3f695..c99048f3db 100644
--- a/src/modules/button/button.cpp
+++ b/src/modules/button/button.cpp
@@ -44,27 +44,23 @@ static BOOL bModuleInitialized = FALSE;
static void DestroyTheme(MButtonCtrl *ctl)
{
- if (closeThemeData) {
- if (ctl->hThemeButton) {
- closeThemeData(ctl->hThemeButton);
- ctl->hThemeButton = NULL;
- }
- if (ctl->hThemeToolbar) {
- closeThemeData(ctl->hThemeToolbar);
- ctl->hThemeToolbar = NULL;
- }
- ctl->bIsThemed = false;
+ if (ctl->hThemeButton) {
+ CloseThemeData(ctl->hThemeButton);
+ ctl->hThemeButton = NULL;
}
+ if (ctl->hThemeToolbar) {
+ CloseThemeData(ctl->hThemeToolbar);
+ ctl->hThemeToolbar = NULL;
+ }
+ ctl->bIsThemed = false;
}
static void LoadTheme(MButtonCtrl *ctl)
{
DestroyTheme(ctl);
- if (openThemeData) {
- ctl->hThemeButton = openThemeData(ctl->hwnd, L"BUTTON");
- ctl->hThemeToolbar = openThemeData(ctl->hwnd, L"TOOLBAR");
- ctl->bIsThemed = true;
- }
+ ctl->hThemeButton = OpenThemeData(ctl->hwnd, L"BUTTON");
+ ctl->hThemeToolbar = OpenThemeData(ctl->hwnd, L"TOOLBAR");
+ ctl->bIsThemed = true;
}
static void SetHwndPropInt(MButtonCtrl* bct, DWORD idObject, DWORD idChild, MSAAPROPID idProp, int val)
@@ -115,9 +111,9 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint)
if (ctl->bIsFlat) {
if (ctl->hThemeToolbar && ctl->bIsThemed) {
int state = IsWindowEnabled(ctl->hwnd)?(ctl->stateId == PBS_NORMAL && ctl->bIsDefault ? PBS_DEFAULTED : ctl->stateId):PBS_DISABLED;
- if (isThemeBackgroundPartiallyTransparent(ctl->hThemeToolbar, TP_BUTTON, TBStateConvert2Flat(state)))
- drawThemeParentBackground(ctl->hwnd, hdcMem, &rcClient);
- drawThemeBackground(ctl->hThemeToolbar, hdcMem, TP_BUTTON, TBStateConvert2Flat(state), &rcClient, &rcClient);
+ if (IsThemeBackgroundPartiallyTransparent(ctl->hThemeToolbar, TP_BUTTON, TBStateConvert2Flat(state)))
+ DrawThemeParentBackground(ctl->hwnd, hdcMem, &rcClient);
+ DrawThemeBackground(ctl->hThemeToolbar, hdcMem, TP_BUTTON, TBStateConvert2Flat(state), &rcClient, &rcClient);
}
else {
HBRUSH hbr;
@@ -150,10 +146,10 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint)
if (ctl->hThemeButton && ctl->bIsThemed) {
int state = IsWindowEnabled(ctl->hwnd)?(ctl->stateId == PBS_NORMAL && ctl->bIsDefault ? PBS_DEFAULTED : ctl->stateId) : PBS_DISABLED;
- if (isThemeBackgroundPartiallyTransparent(ctl->hThemeButton, BP_PUSHBUTTON, state))
- drawThemeParentBackground(ctl->hwnd, hdcMem, &rcClient);
+ if (IsThemeBackgroundPartiallyTransparent(ctl->hThemeButton, BP_PUSHBUTTON, state))
+ DrawThemeParentBackground(ctl->hwnd, hdcMem, &rcClient);
- drawThemeBackground(ctl->hThemeButton, hdcMem, BP_PUSHBUTTON, state, &rcClient, &rcClient);
+ DrawThemeBackground(ctl->hThemeButton, hdcMem, BP_PUSHBUTTON, state, &rcClient, &rcClient);
}
else {
UINT uState = DFCS_BUTTONPUSH | ((ctl->stateId == PBS_HOT) ? DFCS_HOT : 0) | ((ctl->stateId == PBS_PRESSED) ? DFCS_PUSHED : 0);
@@ -183,7 +179,7 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint)
iy++;
}
- HIMAGELIST hImageList = ImageList_Create(g_cxsmIcon, g_cysmIcon, ILC_MASK | (IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16), 1, 0);
+ HIMAGELIST hImageList = ImageList_Create(g_cxsmIcon, g_cysmIcon, ILC_MASK | ILC_COLOR32, 1, 0);
ImageList_AddIcon(hImageList, ctl->hIcon);
HICON hIconNew = ImageList_GetIcon(hImageList, 0, ILD_NORMAL);
DrawState(hdcMem, NULL, NULL, (LPARAM) hIconNew, 0, ix, iy, g_cxsmIcon, g_cysmIcon, DST_ICON | (IsWindowEnabled(ctl->hwnd) ? DSS_NORMAL : DSS_DISABLED));
diff --git a/src/modules/clist/Docking.cpp b/src/modules/clist/Docking.cpp
index 323ca4829d..2186e5237c 100644
--- a/src/modules/clist/Docking.cpp
+++ b/src/modules/clist/Docking.cpp
@@ -36,17 +36,14 @@ static POINT dockPos;
static void Docking_GetMonitorRectFromPoint(LPPOINT pt, LPRECT rc)
{
- if (MyMonitorFromPoint)
- {
- MONITORINFO monitorInfo;
- HMONITOR hMonitor = MyMonitorFromPoint(*pt, MONITOR_DEFAULTTONEAREST); // always returns a valid value
- monitorInfo.cbSize = sizeof(monitorInfo);
+ MONITORINFO monitorInfo;
+ HMONITOR hMonitor = MonitorFromPoint(*pt, MONITOR_DEFAULTTONEAREST); // always returns a valid value
+ monitorInfo.cbSize = sizeof(monitorInfo);
- if (MyGetMonitorInfo(hMonitor, &monitorInfo))
- {
- *rc = monitorInfo.rcMonitor;
- return;
- }
+ if (GetMonitorInfo(hMonitor, &monitorInfo))
+ {
+ *rc = monitorInfo.rcMonitor;
+ return;
}
// "generic" win95/NT support, also serves as failsafe
diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp
index 33e0c49989..24bd9c992d 100644
--- a/src/modules/clist/clc.cpp
+++ b/src/modules/clist/clc.cpp
@@ -347,7 +347,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
ReleaseDC(hwnd, hdc);
if (dat->himlHighlight)
ImageList_Destroy(dat->himlHighlight);
- dat->himlHighlight = ImageList_Create(rc.right, rc.bottom, (IsWinVerXPPlus()? ILC_COLOR32 : ILC_COLOR16) | ILC_MASK, 1, 1);
+ dat->himlHighlight = ImageList_Create(rc.right, rc.bottom, ILC_COLOR32 | ILC_MASK, 1, 1);
ImageList_Add(dat->himlHighlight, hBmp, hBmpMask);
DeleteObject(hBmpMask);
DeleteObject(hBmp);
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp
index 76f65f5601..3540aee387 100644
--- a/src/modules/clist/clistmenus.cpp
+++ b/src/modules/clist/clistmenus.cpp
@@ -490,7 +490,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM)
mi.fMask = MIIM_STRING | MIIM_STATE;
if (timi->iconId != -1) {
mi.fMask |= MIIM_BITMAP;
- if (IsWinVerVistaPlus() && isThemeActive()) {
+ if (IsWinVerVistaPlus() && IsThemeActive()) {
if (timi->hBmp == NULL)
timi->hBmp = ConvertIconToBitmap(NULL, timi->parent->m_hMenuIcons, timi->iconId);
mi.hbmpItem = timi->hBmp;
diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp
index 9fa264df86..7d5fb02e43 100644
--- a/src/modules/clist/clistmod.cpp
+++ b/src/modules/clist/clistmod.cpp
@@ -325,13 +325,11 @@ int fnGetWindowVisibleState(HWND hWnd, int iStepX, int iStepY)
GetWindowRect(hWnd, &rcWin);
SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, FALSE);
- if (MyMonitorFromWindow) {
- HMONITOR hMon = MyMonitorFromWindow(hWnd, MONITOR_DEFAULTTONEAREST);
- MONITORINFO mi;
- mi.cbSize = sizeof(mi);
- if (MyGetMonitorInfo(hMon, &mi))
- rcWorkArea = mi.rcWork;
- }
+ HMONITOR hMon = MonitorFromWindow(hWnd, MONITOR_DEFAULTTONEAREST);
+ MONITORINFO mi;
+ mi.cbSize = sizeof(mi);
+ if (GetMonitorInfo(hMon, &mi))
+ rcWorkArea = mi.rcWork;
IntersectRect(&rc, &rcWin, &rcWorkArea);
@@ -520,7 +518,7 @@ int LoadContactListModule2(void)
InitGroupServices();
cli.pfnInitTray();
- hCListImages = ImageList_Create(16, 16, ILC_MASK | (IsWinVerXPPlus()? ILC_COLOR32 : ILC_COLOR16), 13, 0);
+ hCListImages = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 13, 0);
HookEvent(ME_SKIN_ICONSCHANGED, CListIconsChanged);
CreateServiceFunction(MS_CLIST_GETICONSIMAGELIST, GetIconsImageList);
diff --git a/src/modules/clist/clisttray.cpp b/src/modules/clist/clisttray.cpp
index 97a0d9d08d..321ceb54d1 100644
--- a/src/modules/clist/clisttray.cpp
+++ b/src/modules/clist/clisttray.cpp
@@ -865,18 +865,6 @@ int fnCListTrayNotify(MIRANDASYSTRAYNOTIFY* msn)
/////////////////////////////////////////////////////////////////////////////////////////
-typedef struct _DllVersionInfo
-{
- DWORD cbSize;
- DWORD dwMajorVersion; // Major version
- DWORD dwMinorVersion; // Minor version
- DWORD dwBuildNumber; // Build number
- DWORD dwPlatformID; // DLLVER_PLATFORM_*
-}
- DLLVERSIONINFO;
-
-typedef HRESULT(CALLBACK * DLLGETVERSIONPROC) (DLLVERSIONINFO *);
-
static DLLVERSIONINFO dviShell;
static INT_PTR pfnCListTrayNotifyStub(WPARAM, LPARAM lParam)
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp
index 30722e00ff..e03d2daf18 100644
--- a/src/modules/clist/clui.cpp
+++ b/src/modules/clist/clui.cpp
@@ -287,8 +287,7 @@ int LoadCLUIModule(void)
wndclass.hIconSm = NULL;
RegisterClassEx(&wndclass);
- wndclass.style = CS_HREDRAW | CS_VREDRAW | ((IsWinVerXPPlus() &&
- db_get_b(NULL, "CList", "WindowShadow", 0) == 1) ? CS_DROPSHADOW : 0);
+ wndclass.style = CS_HREDRAW | CS_VREDRAW | ((db_get_b(NULL, "CList", "WindowShadow", 0) == 1) ? CS_DROPSHADOW : 0);
wndclass.lpfnWndProc = ContactListWndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
@@ -381,61 +380,47 @@ int LoadCLUIModule(void)
void fnDrawMenuItem(DRAWITEMSTRUCT *dis, HICON hIcon, HICON eventIcon)
{
- if ( !IsWinVerXPPlus()) {
+ HBRUSH hBr;
+ BOOL bfm = FALSE;
+ SystemParametersInfo(SPI_GETFLATMENU, 0, &bfm, 0);
+ if (bfm) {
+ /* flat menus: fill with COLOR_MENUHILIGHT and outline with COLOR_HIGHLIGHT, otherwise use COLOR_MENUBAR */
+ if (dis->itemState & ODS_SELECTED || dis->itemState & ODS_HOTLIGHT) {
+ /* selected or hot lighted, no difference */
+ hBr = GetSysColorBrush(COLOR_MENUHILIGHT);
+ FillRect(dis->hDC, &dis->rcItem, hBr);
+ DeleteObject(hBr);
+ /* draw the frame */
+ hBr = GetSysColorBrush(COLOR_HIGHLIGHT);
+ FrameRect(dis->hDC, &dis->rcItem, hBr);
+ DeleteObject(hBr);
+ } else {
+ /* flush the DC with the menu bar colour (only supported on XP) and then draw the icon */
+ hBr = GetSysColorBrush(COLOR_MENUBAR);
+ FillRect(dis->hDC, &dis->rcItem, hBr);
+ DeleteObject(hBr);
+ } //if
+ /* draw the icon */
+ if (eventIcon != 0) {
+ DrawState(dis->hDC, NULL, NULL, (LPARAM) eventIcon, 0, 2, (dis->rcItem.bottom + dis->rcItem.top - g_IconHeight) / 2 + (dis->itemState & ODS_SELECTED ? 1 : 0), 0, 0, DST_ICON | (dis->itemState & ODS_INACTIVE ? DSS_DISABLED : DSS_NORMAL));
+ DrawState(dis->hDC, NULL, NULL, (LPARAM) hIcon, 0, 4 + g_IconWidth, (dis->rcItem.bottom + dis->rcItem.top - g_IconHeight) / 2 + (dis->itemState & ODS_SELECTED ? 1 : 0), 0, 0, DST_ICON | (dis->itemState & ODS_INACTIVE ? DSS_DISABLED : DSS_NORMAL));
+ }
+ else DrawState(dis->hDC, NULL, NULL, (LPARAM) hIcon, 0, (dis->rcItem.right + dis->rcItem.left - g_IconWidth) / 2 + (dis->itemState & ODS_SELECTED ? 1 : 0), (dis->rcItem.bottom + dis->rcItem.top - g_IconHeight) / 2 + (dis->itemState & ODS_SELECTED ? 1 : 0), 0, 0, DST_ICON | (dis->itemState & ODS_INACTIVE ? DSS_DISABLED : DSS_NORMAL));
+ }
+ else {
+ /* non-flat menus, flush the DC with a normal menu colour */
FillRect(dis->hDC, &dis->rcItem, GetSysColorBrush(COLOR_MENU));
if (dis->itemState & ODS_HOTLIGHT)
DrawEdge(dis->hDC, &dis->rcItem, BDR_RAISEDINNER, BF_RECT);
else if (dis->itemState & ODS_SELECTED)
DrawEdge(dis->hDC, &dis->rcItem, BDR_SUNKENOUTER, BF_RECT);
+
if (eventIcon != 0) {
DrawState(dis->hDC, NULL, NULL, (LPARAM) eventIcon, 0, 2, (dis->rcItem.bottom + dis->rcItem.top - g_IconHeight) / 2 + (dis->itemState & ODS_SELECTED ? 1 : 0), 0, 0, DST_ICON | (dis->itemState & ODS_INACTIVE ? DSS_DISABLED : DSS_NORMAL));
DrawState(dis->hDC, NULL, NULL, (LPARAM) hIcon, 0, 4 + g_IconWidth, (dis->rcItem.bottom + dis->rcItem.top - g_IconHeight) / 2 + (dis->itemState & ODS_SELECTED ? 1 : 0), 0, 0, DST_ICON | (dis->itemState & ODS_INACTIVE ? DSS_DISABLED : DSS_NORMAL));
}
else DrawState(dis->hDC, NULL, NULL, (LPARAM) hIcon, 0, (dis->rcItem.right + dis->rcItem.left - g_IconWidth) / 2 + (dis->itemState & ODS_SELECTED ? 1 : 0), (dis->rcItem.bottom + dis->rcItem.top - g_IconHeight) / 2 + (dis->itemState & ODS_SELECTED ? 1 : 0), 0, 0, DST_ICON | (dis->itemState & ODS_INACTIVE ? DSS_DISABLED : DSS_NORMAL));
}
- else {
- HBRUSH hBr;
- BOOL bfm = FALSE;
- SystemParametersInfo(SPI_GETFLATMENU, 0, &bfm, 0);
- if (bfm) {
- /* flat menus: fill with COLOR_MENUHILIGHT and outline with COLOR_HIGHLIGHT, otherwise use COLOR_MENUBAR */
- if (dis->itemState & ODS_SELECTED || dis->itemState & ODS_HOTLIGHT) {
- /* selected or hot lighted, no difference */
- hBr = GetSysColorBrush(COLOR_MENUHILIGHT);
- FillRect(dis->hDC, &dis->rcItem, hBr);
- DeleteObject(hBr);
- /* draw the frame */
- hBr = GetSysColorBrush(COLOR_HIGHLIGHT);
- FrameRect(dis->hDC, &dis->rcItem, hBr);
- DeleteObject(hBr);
- } else {
- /* flush the DC with the menu bar colour (only supported on XP) and then draw the icon */
- hBr = GetSysColorBrush(COLOR_MENUBAR);
- FillRect(dis->hDC, &dis->rcItem, hBr);
- DeleteObject(hBr);
- } //if
- /* draw the icon */
- if (eventIcon != 0) {
- DrawState(dis->hDC, NULL, NULL, (LPARAM) eventIcon, 0, 2, (dis->rcItem.bottom + dis->rcItem.top - g_IconHeight) / 2 + (dis->itemState & ODS_SELECTED ? 1 : 0), 0, 0, DST_ICON | (dis->itemState & ODS_INACTIVE ? DSS_DISABLED : DSS_NORMAL));
- DrawState(dis->hDC, NULL, NULL, (LPARAM) hIcon, 0, 4 + g_IconWidth, (dis->rcItem.bottom + dis->rcItem.top - g_IconHeight) / 2 + (dis->itemState & ODS_SELECTED ? 1 : 0), 0, 0, DST_ICON | (dis->itemState & ODS_INACTIVE ? DSS_DISABLED : DSS_NORMAL));
- }
- else DrawState(dis->hDC, NULL, NULL, (LPARAM) hIcon, 0, (dis->rcItem.right + dis->rcItem.left - g_IconWidth) / 2 + (dis->itemState & ODS_SELECTED ? 1 : 0), (dis->rcItem.bottom + dis->rcItem.top - g_IconHeight) / 2 + (dis->itemState & ODS_SELECTED ? 1 : 0), 0, 0, DST_ICON | (dis->itemState & ODS_INACTIVE ? DSS_DISABLED : DSS_NORMAL));
- }
- else {
- /* non-flat menus, flush the DC with a normal menu colour */
- FillRect(dis->hDC, &dis->rcItem, GetSysColorBrush(COLOR_MENU));
- if (dis->itemState & ODS_HOTLIGHT)
- DrawEdge(dis->hDC, &dis->rcItem, BDR_RAISEDINNER, BF_RECT);
- else if (dis->itemState & ODS_SELECTED)
- DrawEdge(dis->hDC, &dis->rcItem, BDR_SUNKENOUTER, BF_RECT);
-
- if (eventIcon != 0) {
- DrawState(dis->hDC, NULL, NULL, (LPARAM) eventIcon, 0, 2, (dis->rcItem.bottom + dis->rcItem.top - g_IconHeight) / 2 + (dis->itemState & ODS_SELECTED ? 1 : 0), 0, 0, DST_ICON | (dis->itemState & ODS_INACTIVE ? DSS_DISABLED : DSS_NORMAL));
- DrawState(dis->hDC, NULL, NULL, (LPARAM) hIcon, 0, 4 + g_IconWidth, (dis->rcItem.bottom + dis->rcItem.top - g_IconHeight) / 2 + (dis->itemState & ODS_SELECTED ? 1 : 0), 0, 0, DST_ICON | (dis->itemState & ODS_INACTIVE ? DSS_DISABLED : DSS_NORMAL));
- }
- else DrawState(dis->hDC, NULL, NULL, (LPARAM) hIcon, 0, (dis->rcItem.right + dis->rcItem.left - g_IconWidth) / 2 + (dis->itemState & ODS_SELECTED ? 1 : 0), (dis->rcItem.bottom + dis->rcItem.top - g_IconHeight) / 2 + (dis->itemState & ODS_SELECTED ? 1 : 0), 0, 0, DST_ICON | (dis->itemState & ODS_INACTIVE ? DSS_DISABLED : DSS_NORMAL));
- }
- }
DestroyIcon(hIcon);
return;
@@ -491,8 +476,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (cluiopt.transparent) {
SetWindowLongPtr(hwnd, GWL_EXSTYLE, GetWindowLongPtr(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
- if (setLayeredWindowAttributes)
- setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) cluiopt.alpha, LWA_ALPHA);
+ SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) cluiopt.alpha, LWA_ALPHA);
}
transparentFocus = 1;
return FALSE;
@@ -595,8 +579,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
else {
if (cluiopt.transparent) {
KillTimer(hwnd, TM_AUTOALPHA);
- if (setLayeredWindowAttributes)
- setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) cluiopt.alpha, LWA_ALPHA);
+ SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) cluiopt.alpha, LWA_ALPHA);
transparentFocus = 1;
}
}
@@ -604,8 +587,8 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case WM_SETCURSOR:
if (cluiopt.transparent) {
- if ( !transparentFocus && GetForegroundWindow() != hwnd && setLayeredWindowAttributes) {
- setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)cluiopt.alpha, LWA_ALPHA);
+ if ( !transparentFocus && GetForegroundWindow() != hwnd) {
+ SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)cluiopt.alpha, LWA_ALPHA);
transparentFocus = 1;
SetTimer(hwnd, TM_AUTOALPHA, 250, NULL);
}
@@ -639,12 +622,12 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
hwndPt = WindowFromPoint(pt);
inwnd = (hwndPt == hwnd || GetParent(hwndPt) == hwnd);
}
- if (inwnd != transparentFocus && setLayeredWindowAttributes) { //change
+ if (inwnd != transparentFocus) { //change
transparentFocus = inwnd;
if (transparentFocus)
- setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) cluiopt.alpha, LWA_ALPHA);
+ SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) cluiopt.alpha, LWA_ALPHA);
else
- setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) db_get_b(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
+ SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) db_get_b(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
}
if ( !transparentFocus)
KillTimer(hwnd, TM_AUTOALPHA);
@@ -664,7 +647,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (wParam) {
sourceAlpha = 0;
destAlpha = (BYTE) cluiopt.alpha;
- setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), 0, LWA_ALPHA);
+ SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), 0, LWA_ALPHA);
noRecurse = 1;
ShowWindow(hwnd, SW_SHOW);
noRecurse = 0;
@@ -677,15 +660,15 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
thisTick = GetTickCount();
if (thisTick >= startTick + 200)
break;
- setLayeredWindowAttributes(hwnd, RGB(0, 0, 0),
+ SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0),
(BYTE) (sourceAlpha + (destAlpha - sourceAlpha) * (int)(thisTick - startTick) / 200), LWA_ALPHA);
}
- setLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) destAlpha, LWA_ALPHA);
+ SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE) destAlpha, LWA_ALPHA);
}
else {
if (wParam)
SetForegroundWindow(hwnd);
- animateWindow(hwnd, 200, AW_BLEND | (wParam ? 0 : AW_HIDE));
+ AnimateWindow(hwnd, 200, AW_BLEND | (wParam ? 0 : AW_HIDE));
SetWindowPos(cli.hwndContactTree, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
}
break;
@@ -857,14 +840,11 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
GetWindowRect(cli.hwndContactTree, &rcTree);
SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, FALSE);
- if (MyMonitorFromWindow)
- {
- HMONITOR hMon = MyMonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
- MONITORINFO mi;
- mi.cbSize = sizeof(mi);
- if (MyGetMonitorInfo(hMon, &mi))
- rcWorkArea = mi.rcWork;
- }
+ HMONITOR hMon = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
+ MONITORINFO mi;
+ mi.cbSize = sizeof(mi);
+ if (GetMonitorInfo(hMon, &mi))
+ rcWorkArea = mi.rcWork;
newHeight = max(nmc->pt.y, 9) + 1 + (rcWindow.bottom - rcWindow.top) - (rcTree.bottom - rcTree.top);
if (newHeight > (rcWorkArea.bottom - rcWorkArea.top) * maxHeight / 100)
diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp
index 12424d9ee0..333624777a 100644
--- a/src/modules/clist/genmenu.cpp
+++ b/src/modules/clist/genmenu.cpp
@@ -512,8 +512,7 @@ INT_PTR MO_CreateNewMenuObject(WPARAM, LPARAM lParam)
p->Name = mir_strdup(pmp->name);
p->CheckService = mir_strdup(pmp->CheckService);
p->ExecService = mir_strdup(pmp->ExecService);
- p->m_hMenuIcons = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON),
- (IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16) | ILC_MASK, 15, 100);
+ p->m_hMenuIcons = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 15, 100);
g_menus.insert(p);
return p->id;
}
@@ -960,7 +959,7 @@ HMENU BuildRecursiveMenu(HMENU hMenu, PMO_IntMenuItem pRootMenu, ListParam *para
mii.fMask = MIIM_DATA | MIIM_ID | MIIM_STRING;
if (pmi->iconId != -1) {
mii.fMask |= MIIM_BITMAP;
- if (IsWinVerVistaPlus() && isThemeActive()) {
+ if (IsWinVerVistaPlus() && IsThemeActive()) {
if (pmi->hBmp == NULL)
pmi->hBmp = ConvertIconToBitmap(NULL, pmi->parent->m_hMenuIcons, pmi->iconId);
mii.hbmpItem = pmi->hBmp;
diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp
index 7aea8fe0c6..8c4b35dafe 100644
--- a/src/modules/clist/genmenuopt.cpp
+++ b/src/modules/clist/genmenuopt.cpp
@@ -440,8 +440,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
mir_subclassWindow( GetDlgItem(hwndDlg, IDC_MENUITEMS), LBTNDOWNProc);
{
HIMAGELIST himlCheckBoxes;
- himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON),
- (IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16) | ILC_MASK, 2, 2);
+ himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 2, 2);
ImageList_AddIcon_IconLibLoaded(himlCheckBoxes, SKINICON_OTHER_NOTICK);
ImageList_AddIcon_IconLibLoaded(himlCheckBoxes, SKINICON_OTHER_TICK);
diff --git a/src/modules/database/profilemanager.cpp b/src/modules/database/profilemanager.cpp
index 2dcea188d7..430508a1bd 100644
--- a/src/modules/database/profilemanager.cpp
+++ b/src/modules/database/profilemanager.cpp
@@ -74,8 +74,7 @@ void SetServiceModePlugin(pluginEntry* p);
static void ThemeDialogBackground(HWND hwnd)
{
- if (enableThemeDialogTexture)
- enableThemeDialogTexture(hwnd, ETDT_ENABLETAB);
+ EnableThemeDialogTexture(hwnd, ETDT_ENABLETAB);
}
static int findProfiles(TCHAR *szProfileDir, ENUMPROFILECALLBACK callback, LPARAM lParam)
@@ -397,7 +396,7 @@ static INT_PTR CALLBACK DlgProfileSelect(HWND hwndDlg, UINT msg, WPARAM wParam,
ListView_InsertColumn(hwndList, 2, &col);
// icons
- HIMAGELIST hImgList = ImageList_Create(16, 16, ILC_MASK | (IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16), 2, 1);
+ HIMAGELIST hImgList = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 2, 1);
ImageList_AddIcon_NotShared(hImgList, MAKEINTRESOURCE(IDI_USERDETAILS));
ImageList_AddIcon_NotShared(hImgList, MAKEINTRESOURCE(IDI_DELETE));
diff --git a/src/modules/findadd/findadd.cpp b/src/modules/findadd/findadd.cpp
index 2a0705b37f..bcc8733365 100644
--- a/src/modules/findadd/findadd.cpp
+++ b/src/modules/findadd/findadd.cpp
@@ -205,11 +205,8 @@ static void ShowAdvancedSearchDlg(HWND hwndDlg, FindAddDlgData *dat)
SetWindowPos(dat->hwndAdvSearch, 0, rc.left, rc.top, 0, 0, SWP_NOZORDER|SWP_NOSIZE);
}
- if (animateWindow) {
- animateWindow(dat->hwndAdvSearch, 150, AW_ACTIVATE|AW_SLIDE|AW_HOR_POSITIVE);
- RedrawWindow(dat->hwndAdvSearch, NULL, NULL, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ALLCHILDREN);
- }
- else ShowWindow(dat->hwndAdvSearch, SW_SHOW);
+ AnimateWindow(dat->hwndAdvSearch, 150, AW_ACTIVATE|AW_SLIDE|AW_HOR_POSITIVE);
+ RedrawWindow(dat->hwndAdvSearch, NULL, NULL, RDW_INVALIDATE|RDW_UPDATENOW|RDW_ALLCHILDREN);
CheckDlgButton(hwndDlg, IDC_ADVANCED, BST_CHECKED);
}
@@ -251,10 +248,7 @@ static void HideAdvancedSearchDlg(HWND hwndDlg, FindAddDlgData *dat)
if (dat->hwndAdvSearch == NULL)
return;
- if (animateWindow && IsWinVerXPPlus()) //blending is quite slow on win2k
- animateWindow(dat->hwndAdvSearch, 150, AW_HIDE|AW_BLEND);
- else
- ShowWindow(dat->hwndAdvSearch, SW_HIDE);
+ AnimateWindow(dat->hwndAdvSearch, 150, AW_HIDE|AW_BLEND);
CheckDlgButton(hwndDlg, IDC_ADVANCED, BST_UNCHECKED);
}
@@ -357,7 +351,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (caps & PF1_BASICSEARCH || caps & PF1_EXTSEARCH || caps & PF1_SEARCHBYEMAIL || caps & PF1_SEARCHBYNAME)
netProtoCount++;
}
- dat->himlComboIcons = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), (IsWinVerXPPlus()?ILC_COLOR32:ILC_COLOR16)|ILC_MASK, netProtoCount+1, netProtoCount+1);
+ dat->himlComboIcons = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, netProtoCount+1, netProtoCount+1);
SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CBEM_SETIMAGELIST, 0, (LPARAM)dat->himlComboIcons);
COMBOBOXEXITEM cbei;
diff --git a/src/modules/icolib/skin2opts.cpp b/src/modules/icolib/skin2opts.cpp
index 94f024ba81..261f239ce7 100644
--- a/src/modules/icolib/skin2opts.cpp
+++ b/src/modules/icolib/skin2opts.cpp
@@ -416,8 +416,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
SendMessage(hwndDlg, WM_SIZE, 0, MAKELPARAM(rcThis.right-rcThis.left, rcThis.bottom-rcThis.top));
}
- if (shAutoComplete)
- shAutoComplete( GetDlgItem(hwndDlg, IDC_ICONSET), 1);
+ SHAutoComplete( GetDlgItem(hwndDlg, IDC_ICONSET), 1);
SetDlgItemText(hwndDlg, IDC_ICONSET, _T("icons.dll"));
return TRUE;
diff --git a/src/modules/ignore/ignore.cpp b/src/modules/ignore/ignore.cpp
index fcd5feb255..5e07e69bfa 100644
--- a/src/modules/ignore/ignore.cpp
+++ b/src/modules/ignore/ignore.cpp
@@ -194,7 +194,7 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), (IsWinVerXPPlus()?ILC_COLOR32:ILC_COLOR16)|ILC_MASK, 3+IGNOREEVENT_MAX, 3+IGNOREEVENT_MAX);
+ HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 3 + IGNOREEVENT_MAX, 3 + IGNOREEVENT_MAX);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_SMALLDOT);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_FILLEDBLOB);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_EMPTYBLOB);
diff --git a/src/modules/netlib/netlibopenconn.cpp b/src/modules/netlib/netlibopenconn.cpp
index 57c83ed507..86fafd0755 100644
--- a/src/modules/netlib/netlibopenconn.cpp
+++ b/src/modules/netlib/netlibopenconn.cpp
@@ -549,7 +549,7 @@ static bool my_connectIPv6(NetlibConnection *nlc, NETLIBOPENCONNECTION * nloc)
NetlibLogf(nlc->nlu, "(%p) Connecting to proxy %s:%d ....", nlc, nlc->szProxyServer, nlc->wProxyPort);
_itoa(nlc->wProxyPort, szPort, 10);
- if (MyGetaddrinfo(nlc->szProxyServer, szPort, &hints, &air)) {
+ if (GetAddrInfoA(nlc->szProxyServer, szPort, &hints, &air)) {
NetlibLogf(nlc->nlu, "%s %d: %s() for host %s failed (%u)", __FILE__, __LINE__, "getaddrinfo", nlc->szProxyServer, WSAGetLastError());
return false;
}
@@ -562,7 +562,7 @@ static bool my_connectIPv6(NetlibConnection *nlc, NETLIBOPENCONNECTION * nloc)
_itoa(nlc->nloc.wPort, szPort, 10);
- if (MyGetaddrinfo(nlc->nloc.szHost, szPort, &hints, &air)) {
+ if (GetAddrInfoA(nlc->nloc.szHost, szPort, &hints, &air)) {
NetlibLogf(nlc->nlu, "%s %d: %s() for host %s failed (%u)", __FILE__, __LINE__, "getaddrinfo", nlc->nloc.szHost, WSAGetLastError());
return false;
}
@@ -659,7 +659,7 @@ retry:
nlc->s = INVALID_SOCKET;
}
- MyFreeaddrinfo(air);
+ FreeAddrInfoA(air);
notblocking = 0;
if (nlc->s != INVALID_SOCKET) ioctlsocket(nlc->s, FIONBIO, &notblocking);
@@ -669,7 +669,7 @@ retry:
static bool my_connect(NetlibConnection *nlc, NETLIBOPENCONNECTION * nloc)
{
- return MyGetaddrinfo && MyFreeaddrinfo ? my_connectIPv6(nlc, nloc) : my_connectIPv4(nlc, nloc);
+ return my_connectIPv6(nlc, nloc);
}
static int NetlibHttpFallbackToDirect(NetlibConnection *nlc, NetlibUser *nlu, NETLIBOPENCONNECTION *nloc)
diff --git a/src/modules/netlib/netlibsock.cpp b/src/modules/netlib/netlibsock.cpp
index abd947bfc9..2611ea9f37 100644
--- a/src/modules/netlib/netlibsock.cpp
+++ b/src/modules/netlib/netlibsock.cpp
@@ -217,33 +217,18 @@ bool NetlibStringToAddress(const char* str, SOCKADDR_INET_M* addr)
{
if ( !str) return false;
- if (MyWSAStringToAddress)
- {
- int len = sizeof(SOCKADDR_INET_M);
- return !MyWSAStringToAddress((char*)str, AF_INET6, NULL, (PSOCKADDR)addr, &len);
- }
- else
- {
- unsigned iaddr = inet_addr(str);
- if ( !iaddr) return false;
-
- addr->Ipv4.sin_addr.s_addr = iaddr;
- addr->Ipv4.sin_family = AF_INET;
- return true;
- }
+ int len = sizeof(SOCKADDR_INET_M);
+ return !WSAStringToAddressA((char*)str, AF_INET6, NULL, (PSOCKADDR)addr, &len);
}
char* NetlibAddressToString(SOCKADDR_INET_M* addr)
{
char saddr[128];
- if (MyWSAAddressToString)
- {
- DWORD len = sizeof(saddr);
- if ( !MyWSAAddressToString((PSOCKADDR)addr, sizeof(*addr), NULL, saddr, &len))
- return mir_strdup(saddr);
- }
- else if (addr->si_family == AF_INET)
+ DWORD len = sizeof(saddr);
+ if ( !WSAAddressToStringA((PSOCKADDR)addr, sizeof(*addr), NULL, saddr, &len))
+ return mir_strdup(saddr);
+ if (addr->si_family == AF_INET)
{
char *szIp = inet_ntoa(addr->Ipv4.sin_addr);
if (addr->Ipv4.sin_port != 0)
@@ -290,7 +275,7 @@ static NETLIBIPLIST* GetMyIpv6(unsigned flags)
hints.ai_family = AF_UNSPEC;
hints.ai_flags = AI_PASSIVE;
- if (MyGetaddrinfo(szMyHost, NULL, &hints, &air))
+ if (GetAddrInfoA(szMyHost, NULL, &hints, &air))
return NULL;
unsigned n = 0;
@@ -320,7 +305,7 @@ static NETLIBIPLIST* GetMyIpv6(unsigned flags)
mir_free(szIp);
}
}
- MyFreeaddrinfo(air);
+ FreeAddrInfoA(air);
return addr;
}
@@ -345,5 +330,5 @@ static NETLIBIPLIST* GetMyIpv4(void)
NETLIBIPLIST* GetMyIp(unsigned flags)
{
- return (MyGetaddrinfo && MyFreeaddrinfo) ? GetMyIpv6(flags) : GetMyIpv4();
+ return GetMyIpv6(flags);
}
diff --git a/src/modules/options/headerbar.cpp b/src/modules/options/headerbar.cpp
index 8b124cd14b..f4fdec8745 100644
--- a/src/modules/options/headerbar.cpp
+++ b/src/modules/options/headerbar.cpp
@@ -35,7 +35,7 @@ static BOOL IsAeroMode()
static BOOL IsVSMode()
{
- return isThemeActive && IsWinVerVistaPlus() && isThemeActive();
+ return IsWinVerVistaPlus() && IsThemeActive();
}
////////////////////////////////////////////////////////////////////////////////////
@@ -213,7 +213,7 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg,
dto.dwFlags = DTT_COMPOSITED|DTT_GLOWSIZE;
dto.iGlowSize = 10;
- HANDLE hTheme = openThemeData(hwndDlg, L"Window");
+ HANDLE hTheme = OpenThemeData(hwndDlg, L"Window");
textRect.left = 50;
hOldFont = (HFONT)SelectObject(tempDC, hFntBold);
@@ -229,7 +229,7 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit, UINT msg,
drawThemeTextEx(hTheme, tempDC, WP_CAPTION, CS_ACTIVE, szSubTitleW, -1, DT_BOTTOM|DT_LEFT|DT_SINGLELINE|DT_NOPREFIX|DT_NOCLIP|DT_END_ELLIPSIS, &textRect, &dto);
mir_free(szSubTitleW);
}
- closeThemeData(hTheme);
+ CloseThemeData(hTheme);
}
else {
textRect.left = 50;
diff --git a/src/modules/options/iconheader.cpp b/src/modules/options/iconheader.cpp
index cf90cf8b25..184ca6c4a7 100644
--- a/src/modules/options/iconheader.cpp
+++ b/src/modules/options/iconheader.cpp
@@ -35,7 +35,7 @@ static BOOL IsAeroMode()
static BOOL IsVSMode()
{
- return isThemeActive && IsWinVerVistaPlus() && isThemeActive();
+ return IsWinVerVistaPlus() && IsThemeActive();
}
////////////////////////////////////////////////////////////////////////////////////
@@ -196,13 +196,13 @@ static void MIcoTab_DrawItem(HWND hwnd, HDC hdc, MIcoTabCtrl *dat, MIcoTab *tab,
rc.top = iTopSpace;
rc.right = itemX + dat->itemWidth;
rc.bottom = iTopSpace + dat->itemHeight;
- HANDLE hTheme = openThemeData(hwnd, L"ListView");
+ HANDLE hTheme = OpenThemeData(hwnd, L"ListView");
if (dat->nHotIdx == i || GetFocus() == hwnd)
- drawThemeBackground(hTheme, hdc, LVP_LISTITEM, LISS_HOTSELECTED, &rc, NULL);
+ DrawThemeBackground(hTheme, hdc, LVP_LISTITEM, LISS_HOTSELECTED, &rc, NULL);
else
- drawThemeBackground(hTheme, hdc, LVP_LISTITEM, LISS_SELECTED, &rc, NULL);
+ DrawThemeBackground(hTheme, hdc, LVP_LISTITEM, LISS_SELECTED, &rc, NULL);
- closeThemeData(hTheme);
+ CloseThemeData(hTheme);
}
else {
MIcoTab_FillRect(hdc, itemX, ITC_BORDER_SIZE, dat->itemWidth, dat->itemHeight, dat->clSelBorder);
@@ -217,10 +217,10 @@ static void MIcoTab_DrawItem(HWND hwnd, HDC hdc, MIcoTabCtrl *dat, MIcoTab *tab,
rc.top = iTopSpace;
rc.right = itemX + dat->itemWidth;
rc.bottom = iTopSpace + dat->itemHeight;
- setWindowTheme(hwnd, L"explorer", NULL);
- HANDLE hTheme = openThemeData(hwnd, L"ListView");
- drawThemeBackground(hTheme, hdc, LVP_LISTITEM, LISS_HOT, &rc, NULL);
- closeThemeData(hTheme);
+ SetWindowTheme(hwnd, L"explorer", NULL);
+ HANDLE hTheme = OpenThemeData(hwnd, L"ListView");
+ DrawThemeBackground(hTheme, hdc, LVP_LISTITEM, LISS_HOT, &rc, NULL);
+ CloseThemeData(hTheme);
}
else {
MIcoTab_FillRect(hdc, itemX, ITC_BORDER_SIZE, dat->itemWidth, dat->itemHeight, dat->clHotBorder);
@@ -242,11 +242,11 @@ static void MIcoTab_DrawItem(HWND hwnd, HDC hdc, MIcoTabCtrl *dat, MIcoTab *tab,
dto.dwSize = sizeof(dto);
dto.dwFlags = DTT_COMPOSITED|DTT_GLOWSIZE;
dto.iGlowSize = 10;
- HANDLE hTheme = openThemeData(hwnd, L"Window");
+ HANDLE hTheme = OpenThemeData(hwnd, L"Window");
wchar_t *tcsNameW = mir_t2u(tab->tcsName);
drawThemeTextEx(hTheme, hdc, WP_CAPTION, CS_ACTIVE, tcsNameW, -1, DT_VCENTER|DT_CENTER|DT_END_ELLIPSIS, &textRect, &dto);
mir_free(tcsNameW);
- closeThemeData(hTheme);
+ CloseThemeData(hTheme);
}
else DrawText(hdc, tab->tcsName, -1, &textRect, DT_VCENTER|DT_CENTER|DT_END_ELLIPSIS);
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp
index 5d995447bb..6f19035d1e 100644
--- a/src/modules/options/options.cpp
+++ b/src/modules/options/options.cpp
@@ -182,8 +182,7 @@ static void SaveOptionsTreeState(HWND hdlg)
static void ThemeDialogBackground(HWND hwnd, BOOL tabbed)
{
- if (enableThemeDialogTexture)
- enableThemeDialogTexture(hwnd, (tabbed ? ETDT_ENABLE : ETDT_DISABLE) | ETDT_USETABTEXTURE);
+ EnableThemeDialogTexture(hwnd, (tabbed ? ETDT_ENABLE : ETDT_DISABLE) | ETDT_USETABTEXTURE);
}
static int lstrcmpnull(TCHAR *str1, TCHAR *str2)
@@ -282,31 +281,29 @@ static LRESULT CALLBACK OptionsFilterSubclassProc(HWND hWnd, UINT message, WPARA
int oldMode = SetBkMode(hdc, TRANSPARENT);
- if (openThemeData) {
- HTHEME hTheme = openThemeData(hWnd, L"EDIT");
- if (hTheme) {
- if (isThemeBackgroundPartiallyTransparent(hTheme, EP_EDITTEXT, ETS_NORMAL))
- drawThemeParentBackground(hWnd, hdc, &rc);
-
- RECT rc2;
- getThemeBackgroundContentRect(hTheme, hdc, EP_EDITTEXT, ETS_NORMAL, &rc, &rc2);
- rc2.top = 2 * rc.top - rc2.top;
- rc2.left = 2 * rc.left - rc2.left;
- rc2.bottom = 2 * rc.bottom - rc2.bottom;
- rc2.right = 2 * rc.right - rc2.right;
-
- drawThemeBackground(hTheme, hdc, EP_EDITTEXT, ETS_NORMAL, &rc2, &rc);
- HFONT hFont = (HFONT) SendMessage(hWnd, WM_GETFONT, 0, 0);
- HFONT oldFont = (HFONT) SelectObject(hdc, hFont);
-
- wchar_t *bufW = mir_t2u(buf);
- drawThemeText(hTheme, hdc, EP_EDITTEXT, ETS_DISABLED, bufW, -1, 0, 0, &rc);
- mir_free(bufW);
-
- SelectObject(hdc, oldFont);
- closeThemeData(hTheme);
- bDrawnByTheme = TRUE;
- }
+ HTHEME hTheme = OpenThemeData(hWnd, L"EDIT");
+ if (hTheme) {
+ if (IsThemeBackgroundPartiallyTransparent(hTheme, EP_EDITTEXT, ETS_NORMAL))
+ DrawThemeParentBackground(hWnd, hdc, &rc);
+
+ RECT rc2;
+ GetThemeBackgroundContentRect(hTheme, hdc, EP_EDITTEXT, ETS_NORMAL, &rc, &rc2);
+ rc2.top = 2 * rc.top - rc2.top;
+ rc2.left = 2 * rc.left - rc2.left;
+ rc2.bottom = 2 * rc.bottom - rc2.bottom;
+ rc2.right = 2 * rc.right - rc2.right;
+
+ DrawThemeBackground(hTheme, hdc, EP_EDITTEXT, ETS_NORMAL, &rc2, &rc);
+ HFONT hFont = (HFONT) SendMessage(hWnd, WM_GETFONT, 0, 0);
+ HFONT oldFont = (HFONT) SelectObject(hdc, hFont);
+
+ wchar_t *bufW = mir_t2u(buf);
+ DrawThemeText(hTheme, hdc, EP_EDITTEXT, ETS_DISABLED, bufW, -1, 0, 0, &rc);
+ mir_free(bufW);
+
+ SelectObject(hdc, oldFont);
+ CloseThemeData(hTheme);
+ bDrawnByTheme = TRUE;
}
SetBkMode(hdc, oldMode);
diff --git a/src/modules/plugins/pluginopts.cpp b/src/modules/plugins/pluginopts.cpp
index b117c85f00..5d0aced019 100644
--- a/src/modules/plugins/pluginopts.cpp
+++ b/src/modules/plugins/pluginopts.cpp
@@ -253,7 +253,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
HWND hwndList = GetDlgItem(hwndDlg, IDC_PLUGLIST);
mir_subclassWindow(hwndList, PluginListWndProc);
- HIMAGELIST hIml = ImageList_Create(16, 16, ILC_MASK | (IsWinVerXPPlus()? ILC_COLOR32 : ILC_COLOR16), 4, 0);
+ HIMAGELIST hIml = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 4, 0);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_UNICODE);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_ANSI);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_LOADED);
diff --git a/src/modules/skin/hotkey_opts.cpp b/src/modules/skin/hotkey_opts.cpp
index 8a583f3523..21372b1eec 100644
--- a/src/modules/skin/hotkey_opts.cpp
+++ b/src/modules/skin/hotkey_opts.cpp
@@ -433,7 +433,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
HotkeyEditCreate( GetDlgItem(hwndDlg, IDC_HOTKEY));
{
- HIMAGELIST hIml = ImageList_Create(16, 16, ILC_MASK + (IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16), 3, 1);
+ HIMAGELIST hIml = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 3, 1);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_WINDOWS);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_MIRANDA);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_WINDOW);
diff --git a/src/modules/utils/hyperlink.cpp b/src/modules/utils/hyperlink.cpp
index ebb24b7c14..1fd17b8130 100644
--- a/src/modules/utils/hyperlink.cpp
+++ b/src/modules/utils/hyperlink.cpp
@@ -228,15 +228,12 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
textColor = dat->disableColor;
}
if (GetClientRect(hwnd, &rc) && GetWindowText(hwnd, szText, SIZEOF(szText))) {
- if (drawThemeParentBackground && IsWinVerXPPlus())
- {
- BOOL fSmoothing;
- UINT fSmoothingType;
- SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &fSmoothing, 0);
- SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &fSmoothingType, 0);
- if (fSmoothing && fSmoothingType == FE_FONTSMOOTHINGCLEARTYPE)
- drawThemeParentBackground(hwnd, hdc, &rc);
- }
+ BOOL fSmoothing;
+ UINT fSmoothingType;
+ SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &fSmoothing, 0);
+ SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &fSmoothingType, 0);
+ if (fSmoothing && fSmoothingType == FE_FONTSMOOTHINGCLEARTYPE)
+ DrawThemeParentBackground(hwnd, hdc, &rc);
SetBkMode(hdc, TRANSPARENT);
SetTextColor(hdc, textColor);
alignFlag = (GetWindowLongPtr(hwnd, GWL_STYLE)&(SS_CENTER|SS_RIGHT|SS_LEFT));
diff --git a/src/modules/utils/path.cpp b/src/modules/utils/path.cpp
index 40c591a1e4..8eebd9ef09 100644
--- a/src/modules/utils/path.cpp
+++ b/src/modules/utils/path.cpp
@@ -131,7 +131,7 @@ static __forceinline char *GetProfileDirX(char*)
static __forceinline char *SHGetSpecialFolderPathX(int iCSIDL, char* var)
{
char result[512];
- if (shGetSpecialFolderPathA && shGetSpecialFolderPathA(NULL, result, iCSIDL, FALSE))
+ if (SHGetSpecialFolderPathA(NULL, result, iCSIDL, FALSE))
return mir_strdup(result);
return NULL;
}
@@ -209,7 +209,7 @@ static __forceinline TCHAR *GetEnvironmentVariableX(TCHAR *variable)
static __forceinline TCHAR *SHGetSpecialFolderPathX(int iCSIDL, TCHAR* var)
{
TCHAR result[512];
- if (shGetSpecialFolderPath && shGetSpecialFolderPath(NULL, result, iCSIDL, FALSE))
+ if (SHGetSpecialFolderPath(NULL, result, iCSIDL, FALSE))
return mir_tstrdup(result);
return NULL;
}
diff --git a/src/modules/utils/utils.cpp b/src/modules/utils/utils.cpp
index 9807d18278..ddf2038da0 100644
--- a/src/modules/utils/utils.cpp
+++ b/src/modules/utils/utils.cpp
@@ -351,23 +351,14 @@ static INT_PTR AssertInsideScreen(WPARAM wParam, LPARAM lParam)
RECT rcScreen;
SystemParametersInfo(SPI_GETWORKAREA, 0, &rcScreen, FALSE);
- if (MyMonitorFromWindow)
- {
- if (MyMonitorFromRect(rc, MONITOR_DEFAULTTONULL))
- return 0;
-
- MONITORINFO mi = {0};
- HMONITOR hMonitor = MyMonitorFromRect(rc, MONITOR_DEFAULTTONEAREST);
- mi.cbSize = sizeof(mi);
- if (MyGetMonitorInfo(hMonitor, &mi))
- rcScreen = mi.rcWork;
- }
- else
- {
- RECT rcDest;
- if (IntersectRect(&rcDest, &rcScreen, rc))
- return 0;
- }
+ if (MonitorFromRect(rc, MONITOR_DEFAULTTONULL))
+ return 0;
+
+ MONITORINFO mi = {0};
+ HMONITOR hMonitor = MonitorFromRect(rc, MONITOR_DEFAULTTONEAREST);
+ mi.cbSize = sizeof(mi);
+ if (GetMonitorInfo(hMonitor, &mi))
+ rcScreen = mi.rcWork;
if (rc->top >= rcScreen.bottom)
OffsetRect(rc, 0, rcScreen.bottom - rc->bottom);
diff --git a/src/modules/visibility/visibility.cpp b/src/modules/visibility/visibility.cpp
index 6f5782ef47..a2a0f71c88 100644
--- a/src/modules/visibility/visibility.cpp
+++ b/src/modules/visibility/visibility.cpp
@@ -144,7 +144,7 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), (IsWinVerXPPlus()?ILC_COLOR32:ILC_COLOR16)|ILC_MASK, 3, 3);
+ hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 3, 3);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_SMALLDOT);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_VISIBLE_ALL);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_INVISIBLE_ALL);