diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-09-21 15:49:11 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-09-21 15:49:11 +0000 |
commit | 4e0aef28194077beaaaa07775f819c3a4cf934e9 (patch) | |
tree | 9790e7e37c3e3bac42fcdae8415cfc62e9574383 /src/core | |
parent | eda233a99f1a74b1d43b2cc0fd41c0a874a7b3cd (diff) |
using Uxtheme in core
git-svn-id: http://svn.miranda-ng.org/main/trunk@6158 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/commonheaders.h | 1 | ||||
-rw-r--r-- | src/core/miranda.cpp | 89 | ||||
-rw-r--r-- | src/core/miranda.h | 61 |
3 files changed, 7 insertions, 144 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;
|