summaryrefslogtreecommitdiff
path: root/src/core/stdmsg
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-09-21 17:37:33 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-09-21 17:37:33 +0000
commitfdbc3639a50f40879f390f17ce7aafd5a579a7ab (patch)
treef2dc612f9d188cfb955b4393e207e5363bcd4e4e /src/core/stdmsg
parent96325150479b8c93a5e48ac2591f3c7da5f0f9d4 (diff)
Core cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@6165 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/core/stdmsg')
-rw-r--r--src/core/stdmsg/src/commonheaders.h1
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp2
-rw-r--r--src/core/stdmsg/src/richutil.cpp60
-rw-r--r--src/core/stdmsg/stdmsg_10.vcxproj8
-rw-r--r--src/core/stdmsg/stdmsg_11.vcxproj8
5 files changed, 22 insertions, 57 deletions
diff --git a/src/core/stdmsg/src/commonheaders.h b/src/core/stdmsg/src/commonheaders.h
index ac219783a4..35e9fe6031 100644
--- a/src/core/stdmsg/src/commonheaders.h
+++ b/src/core/stdmsg/src/commonheaders.h
@@ -33,6 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <shlobj.h>
#include <commctrl.h>
#include <vssym32.h>
+#include <Uxtheme.h>
#include <malloc.h>
#include <time.h>
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index 35b5cf8925..4b2c68c1b6 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -1487,7 +1487,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (db_get_dw(dat->hContact, dat->szProto, "IdleTS", 0)) {
HIMAGELIST hImageList;
- hImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON), IsWinVerXPPlus()? ILC_COLOR32 | ILC_MASK : ILC_COLOR16 | ILC_MASK, 1, 0);
+ hImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 1, 0);
ImageList_AddIcon(hImageList, hIcon);
ImageList_DrawEx(hImageList, 0, dis->hDC, dis->rcItem.left, dis->rcItem.top, 0, 0, CLR_NONE, CLR_NONE, ILD_SELECTED);
ImageList_Destroy(hImageList);
diff --git a/src/core/stdmsg/src/richutil.cpp b/src/core/stdmsg/src/richutil.cpp
index 42e3f890f3..53bf684119 100644
--- a/src/core/stdmsg/src/richutil.cpp
+++ b/src/core/stdmsg/src/richutil.cpp
@@ -47,17 +47,6 @@ static int RichUtil_CmpVal(void *p1, void *p2)
return (int)((INT_PTR)tp1->hwnd - (INT_PTR)tp2->hwnd);
}
-// UxTheme Stuff
-static HMODULE mTheme;
-
-static HANDLE (WINAPI *MyOpenThemeData)(HWND, LPCWSTR);
-static HRESULT (WINAPI *MyCloseThemeData)(HANDLE);
-static BOOL (WINAPI *MyIsThemeActive)(VOID);
-static HRESULT (WINAPI *MyDrawThemeBackground)(HANDLE, HDC, int, int, LPCRECT, LPCRECT);
-static HRESULT (WINAPI *MyGetThemeBackgroundContentRect)(HANDLE, HDC, int, int, LPCRECT, LPRECT);
-static HRESULT (WINAPI *MyDrawThemeParentBackground)(HWND, HDC, LPRECT);
-static BOOL (WINAPI *MyIsThemeBackgroundPartiallyTransparent)(HANDLE, int, int);
-
static CRITICAL_SECTION csRich;
static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -68,38 +57,13 @@ void RichUtil_Load(void)
sListInt.increment = 10;
sListInt.sortFunc = RichUtil_CmpVal;
- mTheme = IsWinVerXPPlus() ? GetModuleHandleA("uxtheme") : 0;
-
InitializeCriticalSection(&csRich);
- if (!mTheme) return;
-
- MyOpenThemeData = (HANDLE (WINAPI *)(HWND, LPCWSTR))GetProcAddress(mTheme, "OpenThemeData");
- MyCloseThemeData = (HRESULT (WINAPI *)(HANDLE))GetProcAddress(mTheme, "CloseThemeData");
- MyIsThemeActive = (BOOL (WINAPI *)(VOID))GetProcAddress(mTheme, "IsThemeActive");
- MyDrawThemeBackground = (HRESULT (WINAPI *)(HANDLE, HDC, int, int, const RECT*, const RECT *))GetProcAddress(mTheme, "DrawThemeBackground");
- MyGetThemeBackgroundContentRect = (HRESULT (WINAPI *)(HANDLE, HDC, int, int, const RECT *, RECT *))GetProcAddress(mTheme, "GetThemeBackgroundContentRect");
- MyDrawThemeParentBackground = (HRESULT (WINAPI *)(HWND, HDC, RECT*))GetProcAddress(mTheme, "DrawThemeParentBackground");
- MyIsThemeBackgroundPartiallyTransparent = (BOOL (WINAPI *)(HANDLE, int, int))GetProcAddress(mTheme, "IsThemeBackgroundPartiallyTransparent");
-
- if (!MyOpenThemeData ||
- !MyCloseThemeData ||
- !MyIsThemeActive ||
- !MyDrawThemeBackground ||
- !MyGetThemeBackgroundContentRect ||
- !MyDrawThemeParentBackground ||
- !MyIsThemeBackgroundPartiallyTransparent)
- {
- FreeLibrary(mTheme);
- mTheme = NULL;
- }
}
void RichUtil_Unload(void)
{
List_Destroy(&sListInt);
DeleteCriticalSection(&csRich);
- if (mTheme)
- FreeLibrary(mTheme);
}
int RichUtil_SubClass(HWND hwndEdit)
@@ -157,9 +121,9 @@ static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case WM_NCPAINT:
{
LRESULT ret = mir_callNextSubclass(hwnd, RichUtil_Proc, msg, wParam, lParam);
- if (ru->hasUglyBorder && MyIsThemeActive())
+ if (ru->hasUglyBorder && IsThemeActive())
{
- HANDLE hTheme = MyOpenThemeData(ru->hwnd, L"EDIT");
+ HANDLE hTheme = OpenThemeData(ru->hwnd, L"EDIT");
if (hTheme)
{
RECT rcBorder;
@@ -178,8 +142,8 @@ static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
rcClient.bottom -= ru->rect.bottom;
ExcludeClipRect(hdc, rcClient.left, rcClient.top, rcClient.right, rcClient.bottom);
- if (MyIsThemeBackgroundPartiallyTransparent(hTheme, EP_EDITTEXT, ETS_NORMAL))
- MyDrawThemeParentBackground(hwnd, hdc, &rcBorder);
+ if (IsThemeBackgroundPartiallyTransparent(hTheme, EP_EDITTEXT, ETS_NORMAL))
+ DrawThemeParentBackground(hwnd, hdc, &rcBorder);
if (style & WS_DISABLED)
nState = ETS_DISABLED;
@@ -188,8 +152,8 @@ static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
else
nState = ETS_NORMAL;
- MyDrawThemeBackground(hTheme, hdc, EP_EDITTEXT, nState, &rcBorder, NULL);
- MyCloseThemeData(hTheme);
+ DrawThemeBackground(hTheme, hdc, EP_EDITTEXT, nState, &rcBorder, NULL);
+ CloseThemeData(hTheme);
ReleaseDC(hwnd, hdc);
return 0;
}
@@ -201,25 +165,25 @@ static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
LRESULT ret = mir_callNextSubclass(hwnd, RichUtil_Proc, msg, wParam, lParam);
NCCALCSIZE_PARAMS *ncsParam = (NCCALCSIZE_PARAMS*)lParam;
- if (ru->hasUglyBorder && MyIsThemeActive()) {
- HANDLE hTheme = MyOpenThemeData(hwnd, L"EDIT");
+ if (ru->hasUglyBorder && IsThemeActive()) {
+ HANDLE hTheme = OpenThemeData(hwnd, L"EDIT");
if (hTheme) {
RECT rcClient ={0};
HDC hdc = GetDC(GetParent(hwnd));
- if (MyGetThemeBackgroundContentRect(hTheme, hdc, EP_EDITTEXT, ETS_NORMAL, &ncsParam->rgrc[0], &rcClient) == S_OK) {
+ if (GetThemeBackgroundContentRect(hTheme, hdc, EP_EDITTEXT, ETS_NORMAL, &ncsParam->rgrc[0], &rcClient) == S_OK) {
ru->rect.left = rcClient.left-ncsParam->rgrc[0].left;
ru->rect.top = rcClient.top-ncsParam->rgrc[0].top;
ru->rect.right = ncsParam->rgrc[0].right-rcClient.right;
ru->rect.bottom = ncsParam->rgrc[0].bottom-rcClient.bottom;
ncsParam->rgrc[0] = rcClient;
- MyCloseThemeData(hTheme);
+ CloseThemeData(hTheme);
ReleaseDC(GetParent(hwnd), hdc);
return WVR_REDRAW;
}
ReleaseDC(GetParent(hwnd), hdc);
- MyCloseThemeData(hTheme);
+ CloseThemeData(hTheme);
}
}
return ret;
@@ -247,7 +211,7 @@ static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
static void RichUtil_ClearUglyBorder(TRichUtil *ru)
{
- if (mTheme && MyIsThemeActive() && GetWindowLongPtr(ru->hwnd, GWL_EXSTYLE) & WS_EX_CLIENTEDGE)
+ if (IsThemeActive() && GetWindowLongPtr(ru->hwnd, GWL_EXSTYLE) & WS_EX_CLIENTEDGE)
{
ru->hasUglyBorder = 1;
SetWindowLongPtr(ru->hwnd, GWL_EXSTYLE, GetWindowLongPtr(ru->hwnd, GWL_EXSTYLE) ^ WS_EX_CLIENTEDGE);
diff --git a/src/core/stdmsg/stdmsg_10.vcxproj b/src/core/stdmsg/stdmsg_10.vcxproj
index 2af55a0b0f..a4a6083d3a 100644
--- a/src/core/stdmsg/stdmsg_10.vcxproj
+++ b/src/core/stdmsg/stdmsg_10.vcxproj
@@ -90,7 +90,7 @@
<AdditionalIncludeDirectories>..\..\..\include;..\..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -122,7 +122,7 @@
<AdditionalIncludeDirectories>..\..\..\include;..\..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -158,7 +158,7 @@
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<SubSystem>Windows</SubSystem>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\..\bin10\lib</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
@@ -182,7 +182,7 @@
<AdditionalIncludeDirectories>..\..\..\include;..\..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
diff --git a/src/core/stdmsg/stdmsg_11.vcxproj b/src/core/stdmsg/stdmsg_11.vcxproj
index 1a3c162747..e43d11c649 100644
--- a/src/core/stdmsg/stdmsg_11.vcxproj
+++ b/src/core/stdmsg/stdmsg_11.vcxproj
@@ -94,7 +94,7 @@
<AdditionalIncludeDirectories>..\..\..\include;..\..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -125,7 +125,7 @@
<AdditionalIncludeDirectories>..\..\..\include;..\..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -160,7 +160,7 @@
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
<SubSystem>Windows</SubSystem>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProfileDir)..\..\..\bin11\lib</AdditionalLibraryDirectories>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
@@ -185,7 +185,7 @@
<AdditionalIncludeDirectories>..\..\..\include;..\..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>