summaryrefslogtreecommitdiff
path: root/src/core/stdclist
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/stdclist
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/stdclist')
-rw-r--r--src/core/stdclist/src/clcopts.cpp8
-rw-r--r--src/core/stdclist/src/clcpaint.cpp30
-rw-r--r--src/core/stdclist/src/cluiopts.cpp7
-rw-r--r--src/core/stdclist/src/commonheaders.h2
-rw-r--r--src/core/stdclist/src/init.cpp5
-rw-r--r--src/core/stdclist/stdclist_10.vcxproj8
-rw-r--r--src/core/stdclist/stdclist_11.vcxproj8
7 files changed, 17 insertions, 51 deletions
diff --git a/src/core/stdclist/src/clcopts.cpp b/src/core/stdclist/src/clcopts.cpp
index 83bbd93e60..5b3bd0e4fa 100644
--- a/src/core/stdclist/src/clcopts.cpp
+++ b/src/core/stdclist/src/clcopts.cpp
@@ -312,12 +312,8 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
CheckDlgButton(hwndDlg, IDC_SCROLL, bmpUse & CLBF_SCROLL ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_PROPORTIONAL, bmpUse & CLBF_PROPORTIONAL ? BST_CHECKED : BST_UNCHECKED);
}
- {
- HRESULT(STDAPICALLTYPE * MySHAutoComplete) (HWND, DWORD);
- MySHAutoComplete = (HRESULT(STDAPICALLTYPE *) (HWND, DWORD)) GetProcAddress(GetModuleHandleA("shlwapi"), "SHAutoComplete");
- if (MySHAutoComplete)
- MySHAutoComplete(GetDlgItem(hwndDlg, IDC_FILENAME), 1);
- }
+
+ SHAutoComplete(GetDlgItem(hwndDlg, IDC_FILENAME), 1);
return TRUE;
case WM_USER + 10:
EnableWindow(GetDlgItem(hwndDlg, IDC_FILENAME), IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
diff --git a/src/core/stdclist/src/clcpaint.cpp b/src/core/stdclist/src/clcpaint.cpp
index 2927fa22d4..5b6b55f467 100644
--- a/src/core/stdclist/src/clcpaint.cpp
+++ b/src/core/stdclist/src/clcpaint.cpp
@@ -137,12 +137,6 @@ static int GetRealStatus(struct ClcContact *contact, int status)
return status;
}
-static HMODULE themeAPIHandle = NULL; // handle to uxtheme.dll
-static HANDLE(WINAPI * MyOpenThemeData) (HWND, LPCWSTR);
-static HRESULT(WINAPI * MyCloseThemeData) (HANDLE);
-static HRESULT(WINAPI * MyDrawThemeBackground) (HANDLE, HDC, int, int, const RECT *, const RECT *);
-
-#define MGPROC(x) GetProcAddress(themeAPIHandle,x)
void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
{
HDC hdcMem;
@@ -357,34 +351,18 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
//checkboxes
if (checkboxWidth) {
RECT rc;
- HANDLE hTheme = NULL;
-
- // THEME
- if (IsWinVerXPPlus()) {
- if (!themeAPIHandle) {
- themeAPIHandle = GetModuleHandleA("uxtheme");
- if (themeAPIHandle) {
- MyOpenThemeData = (HANDLE(WINAPI *) (HWND, LPCWSTR)) MGPROC("OpenThemeData");
- MyCloseThemeData = (HRESULT(WINAPI *) (HANDLE)) MGPROC("CloseThemeData");
- MyDrawThemeBackground =
- (HRESULT(WINAPI *) (HANDLE, HDC, int, int, const RECT *, const RECT *)) MGPROC("DrawThemeBackground");
- }
- }
- // Make sure all of these methods are valid (i would hope either all or none work)
- if (MyOpenThemeData && MyCloseThemeData && MyDrawThemeBackground)
- hTheme = MyOpenThemeData(hwnd, L"BUTTON");
- }
+ HANDLE hTheme = OpenThemeData(hwnd, L"BUTTON");
rc.left = dat->leftMargin + indent * dat->groupIndent;
rc.right = rc.left + dat->checkboxSize;
rc.top = y + ((dat->rowHeight - dat->checkboxSize) >> 1);
rc.bottom = rc.top + dat->checkboxSize;
if (hTheme)
- MyDrawThemeBackground(hTheme, hdcMem, BP_CHECKBOX, group->cl.items[group->scanIndex]->flags & CONTACTF_CHECKED ? (hottrack ? CBS_CHECKEDHOT : CBS_CHECKEDNORMAL) : (hottrack ? CBS_UNCHECKEDHOT : CBS_UNCHECKEDNORMAL), &rc, &rc);
+ DrawThemeBackground(hTheme, hdcMem, BP_CHECKBOX, group->cl.items[group->scanIndex]->flags & CONTACTF_CHECKED ? (hottrack ? CBS_CHECKEDHOT : CBS_CHECKEDNORMAL) : (hottrack ? CBS_UNCHECKEDHOT : CBS_UNCHECKEDNORMAL), &rc, &rc);
else
DrawFrameControl(hdcMem, &rc, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_FLAT | (group->cl.items[group->scanIndex]->flags & CONTACTF_CHECKED ? DFCS_CHECKED : 0) | (hottrack ? DFCS_HOT : 0));
- if (hTheme && MyCloseThemeData) {
- MyCloseThemeData(hTheme);
+ if (hTheme) {
+ CloseThemeData(hTheme);
hTheme = NULL;
}
}
diff --git a/src/core/stdclist/src/cluiopts.cpp b/src/core/stdclist/src/cluiopts.cpp
index efd9c9fb92..208accbc05 100644
--- a/src/core/stdclist/src/cluiopts.cpp
+++ b/src/core/stdclist/src/cluiopts.cpp
@@ -23,8 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "commonheaders.h"
-extern BOOL(WINAPI * MySetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD);
-
static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
@@ -237,10 +235,7 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
if (IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT))
{
SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
- if (MySetLayeredWindowAttributes)
- MySetLayeredWindowAttributes(pcli->hwndContactList, RGB(0, 0, 0),
- (BYTE) db_get_b(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT),
- LWA_ALPHA);
+ SetLayeredWindowAttributes(pcli->hwndContactList, RGB(0, 0, 0), (BYTE)db_get_b(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
}
else
SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
diff --git a/src/core/stdclist/src/commonheaders.h b/src/core/stdclist/src/commonheaders.h
index e480281b9e..760b9b09b8 100644
--- a/src/core/stdclist/src/commonheaders.h
+++ b/src/core/stdclist/src/commonheaders.h
@@ -36,6 +36,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <io.h>
#include <string.h>
#include <direct.h>
+#include <Uxtheme.h>
+#include <shlwapi.h>
#include <win2k.h>
#include <newpluginapi.h>
diff --git a/src/core/stdclist/src/init.cpp b/src/core/stdclist/src/init.cpp
index 56774e5d29..f751d9b853 100644
--- a/src/core/stdclist/src/init.cpp
+++ b/src/core/stdclist/src/init.cpp
@@ -28,8 +28,6 @@ CLIST_INTERFACE* pcli = NULL;
HIMAGELIST himlCListClc = NULL;
int hLangpack;
-BOOL(WINAPI * MySetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD) = NULL;
-
/////////////////////////////////////////////////////////////////////////////////////////
// external functions
@@ -139,9 +137,6 @@ extern "C" __declspec(dllexport) int CListInitialise()
pcli->hInst = g_hInst;
pcli->pfnPaintClc = PaintClc;
- MySetLayeredWindowAttributes = (BOOL(WINAPI *) (HWND, COLORREF, BYTE, DWORD)) GetProcAddress(
- LoadLibraryA("user32.dll"), "SetLayeredWindowAttributes");
-
CreateServiceFunction(MS_CLIST_GETSTATUSMODE, GetStatusMode);
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
diff --git a/src/core/stdclist/stdclist_10.vcxproj b/src/core/stdclist/stdclist_10.vcxproj
index 02388ea615..c8ee8d4d36 100644
--- a/src/core/stdclist/stdclist_10.vcxproj
+++ b/src/core/stdclist/stdclist_10.vcxproj
@@ -90,7 +90,7 @@
<AdditionalIncludeDirectories>..\..\..\include;..\..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x6590000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -120,7 +120,7 @@
<AdditionalIncludeDirectories>..\..\..\include;..\..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.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;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x6590000</BaseAddress>
@@ -150,7 +150,7 @@
<AdditionalIncludeDirectories>..\..\..\include;..\..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
@@ -183,7 +183,7 @@
<AdditionalIncludeDirectories>..\..\..\include;..\..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.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;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
diff --git a/src/core/stdclist/stdclist_11.vcxproj b/src/core/stdclist/stdclist_11.vcxproj
index 26a5dd198b..83805261e2 100644
--- a/src/core/stdclist/stdclist_11.vcxproj
+++ b/src/core/stdclist/stdclist_11.vcxproj
@@ -94,7 +94,7 @@
<AdditionalIncludeDirectories>..\..\..\include;..\..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x6590000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -125,7 +125,7 @@
<AdditionalIncludeDirectories>..\..\..\include;..\..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.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;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x6590000</BaseAddress>
@@ -155,7 +155,7 @@
<AdditionalIncludeDirectories>..\..\..\include;..\..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.lib;UxTheme.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
@@ -187,7 +187,7 @@
<AdditionalIncludeDirectories>..\..\..\include;..\..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>comctl32.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;%(AdditionalManifestDependencies)</AdditionalManifestDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>