From fdbc3639a50f40879f390f17ce7aafd5a579a7ab Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 21 Sep 2013 17:37:33 +0000 Subject: Core cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@6165 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/stdauth/commonheaders.h | 1 - src/core/stdautoaway/commonheaders.h | 1 - src/core/stdaway/commonheaders.h | 1 - src/core/stdchat/src/chat.h | 8 +++- src/core/stdchat/src/main.cpp | 5 +- src/core/stdchat/src/richutil.cpp | 71 ++++++++--------------------- src/core/stdchat/src/richutil.h | 1 - src/core/stdchat/stdchat_10.vcxproj | 8 ++-- src/core/stdchat/stdchat_11.vcxproj | 8 ++-- src/core/stdclist/src/clcopts.cpp | 8 +--- src/core/stdclist/src/clcpaint.cpp | 30 ++---------- src/core/stdclist/src/cluiopts.cpp | 7 +-- src/core/stdclist/src/commonheaders.h | 2 + src/core/stdclist/src/init.cpp | 5 -- src/core/stdclist/stdclist_10.vcxproj | 8 ++-- src/core/stdclist/stdclist_11.vcxproj | 8 ++-- src/core/stdcrypt/commonheaders.h | 1 - src/core/stdemail/commonheaders.h | 1 - src/core/stdfile/commonheaders.h | 5 +- src/core/stdfile/fileopts.cpp | 3 +- src/core/stdfile/filerecvdlg.cpp | 3 +- src/core/stdfile/main.cpp | 3 -- src/core/stdfile/stdfile_10.vcxproj | 8 ++-- src/core/stdfile/stdfile_11.vcxproj | 8 ++-- src/core/stdhelp/commonheaders.h | 1 - src/core/stdidle/commonheaders.h | 14 +----- src/core/stdidle/idle.cpp | 56 ++++++----------------- src/core/stdidle/main.cpp | 12 ----- src/core/stdidle/stdidle_10.vcxproj | 13 ++---- src/core/stdidle/stdidle_11.vcxproj | 13 ++---- src/core/stdmsg/src/commonheaders.h | 1 + src/core/stdmsg/src/msgdialog.cpp | 2 +- src/core/stdmsg/src/richutil.cpp | 60 +++++------------------- src/core/stdmsg/stdmsg_10.vcxproj | 8 ++-- src/core/stdmsg/stdmsg_11.vcxproj | 8 ++-- src/core/stduihist/commonheaders.h | 1 - src/core/stdurl/commonheaders.h | 1 - src/core/stduserinfo/commonheaders.h | 3 -- src/core/stduserinfo/main.cpp | 8 ---- src/core/stduserinfo/stduserinfo_10.vcxproj | 8 ++-- src/core/stduserinfo/stduserinfo_11.vcxproj | 8 ++-- src/core/stduserinfo/userinfo.cpp | 3 +- src/core/stduseronline/commonheaders.h | 1 - 43 files changed, 118 insertions(+), 307 deletions(-) diff --git a/src/core/stdauth/commonheaders.h b/src/core/stdauth/commonheaders.h index 173d3bcba9..137fd055f5 100644 --- a/src/core/stdauth/commonheaders.h +++ b/src/core/stdauth/commonheaders.h @@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include -#include #include #include diff --git a/src/core/stdautoaway/commonheaders.h b/src/core/stdautoaway/commonheaders.h index 8956a2732e..606d854a34 100644 --- a/src/core/stdautoaway/commonheaders.h +++ b/src/core/stdautoaway/commonheaders.h @@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include -#include #include #include diff --git a/src/core/stdaway/commonheaders.h b/src/core/stdaway/commonheaders.h index 703daf2b7d..1423bafc37 100644 --- a/src/core/stdaway/commonheaders.h +++ b/src/core/stdaway/commonheaders.h @@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include -#include #include #include diff --git a/src/core/stdchat/src/chat.h b/src/core/stdchat/src/chat.h index 72e3ecd5cf..e15a85e06e 100644 --- a/src/core/stdchat/src/chat.h +++ b/src/core/stdchat/src/chat.h @@ -35,6 +35,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include +#include #include #include @@ -57,12 +58,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include +#include -#include "resource.h" -#include "version.h" #include "m_ieview.h" #include "m_smileyadd.h" +#include "resource.h" +#include "version.h" +#include "richutil.h" + #ifndef NDEBUG #define new new(_NORMAL_BLOCK, __FILE__, __LINE__) #endif diff --git a/src/core/stdchat/src/main.cpp b/src/core/stdchat/src/main.cpp index 75435f57db..0a5c4bbf2f 100644 --- a/src/core/stdchat/src/main.cpp +++ b/src/core/stdchat/src/main.cpp @@ -113,7 +113,6 @@ extern "C" __declspec(dllexport) int Unload(void) DestroyHookableEvents(); FreeIcons(); OptionsUnInit(); - FreeLibrary(GetModuleHandle(_T("riched20.dll"))); UnhookEvents(); return 0; } @@ -179,8 +178,8 @@ void LoadIcons(void) LoadLogIcons(); LoadMsgLogBitmaps(); - hImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),IsWinVerXPPlus()? ILC_COLOR32 | ILC_MASK : ILC_COLOR16 | ILC_MASK,0,3); - hIconsList = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),IsWinVerXPPlus()? ILC_COLOR32 | ILC_MASK : ILC_COLOR16 | ILC_MASK,0,100); + hImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 0, 3); + hIconsList = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 0, 100); ImageList_AddIcon(hIconsList,LoadSkinnedIcon( SKINICON_EVENT_MESSAGE)); ImageList_AddIcon(hIconsList,LoadIconEx( "overlay", FALSE )); ImageList_SetOverlayImage(hIconsList, 1, 1); diff --git a/src/core/stdchat/src/richutil.cpp b/src/core/stdchat/src/richutil.cpp index 46c9e5c28e..8bcc79b509 100644 --- a/src/core/stdchat/src/richutil.cpp +++ b/src/core/stdchat/src/richutil.cpp @@ -19,12 +19,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include -#include -#include -#include "richutil.h" +#include "chat.h" /* To initialize this library, call: @@ -121,50 +117,20 @@ void rlist_free(RList *list) { } } -// UxTheme Stuff -static HMODULE mTheme = 0; -static HANDLE (WINAPI *MyOpenThemeData)(HWND,LPCWSTR) = 0; -static HRESULT (WINAPI *MyCloseThemeData)(HANDLE) = 0; -static BOOL (WINAPI *MyIsThemeActive)() = 0; -static HRESULT (WINAPI *MyDrawThemeBackground)(HANDLE,HDC,int,int,const RECT*,const RECT *) = 0; -static HRESULT (WINAPI *MyGetThemeBackgroundContentRect)(HANDLE,HDC,int,int,const RECT *,RECT *) = 0; -static HRESULT (WINAPI *MyDrawThemeParentBackground)(HWND,HDC,RECT*) = 0; -static BOOL (WINAPI *MyIsThemeBackgroundPartiallyTransparent)(HANDLE,int,int) = 0; - static RList *slist = NULL; static CRITICAL_SECTION csRich; static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); static VOID RichUtil_ClearUglyBorder(TRichUtil *ru); -void RichUtil_Load() { - mTheme = RIsWinVerXPPlus()?LoadLibraryA("uxtheme.dll"):0; +void RichUtil_Load() +{ InitializeCriticalSection(&csRich); - if (!mTheme) return; - MyOpenThemeData = (HANDLE (WINAPI *)(HWND, LPCWSTR))GetProcAddress(mTheme, "OpenThemeData"); - MyCloseThemeData = (HRESULT (WINAPI *)(HANDLE))GetProcAddress(mTheme, "CloseThemeData"); - MyIsThemeActive = (BOOL (WINAPI *)())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 RichUtil_Unload() +{ DeleteCriticalSection(&csRich); - if (mTheme) { - FreeLibrary(mTheme); - } } int RichUtil_SubClass(HWND hwndEdit) { @@ -201,8 +167,8 @@ 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()) { - HANDLE hTheme = MyOpenThemeData(ru->hwnd, L"EDIT"); + if (ru->hasUglyBorder && IsThemeActive()) { + HANDLE hTheme = OpenThemeData(ru->hwnd, L"EDIT"); if (hTheme) { RECT rcBorder; @@ -219,15 +185,15 @@ static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM rcClient.right -= ru->rect.right; 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 (!IsWindowEnabled(hwnd)) nState = ETS_DISABLED; else if(SendMessage(hwnd, EM_GETOPTIONS, 0, 0) & ECO_READONLY) nState = ETS_READONLY; 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; } @@ -239,26 +205,26 @@ 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; HDC hdc = GetDC(GetParent(hwnd)); ZeroMemory(&rcClient, sizeof(RECT)); - 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; CopyRect(&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; @@ -281,8 +247,9 @@ static LRESULT CALLBACK RichUtil_Proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM return mir_callNextSubclass(hwnd, RichUtil_Proc, msg, wParam, lParam); } -static VOID RichUtil_ClearUglyBorder(TRichUtil *ru) { - if (mTheme&&MyIsThemeActive()&&GetWindowLongPtr(ru->hwnd, GWL_EXSTYLE)&WS_EX_CLIENTEDGE) { +static VOID RichUtil_ClearUglyBorder(TRichUtil *ru) +{ + 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/stdchat/src/richutil.h b/src/core/stdchat/src/richutil.h index 97d85aeddf..c1b14bd280 100644 --- a/src/core/stdchat/src/richutil.h +++ b/src/core/stdchat/src/richutil.h @@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define SRMM_RICHUTIL_H #define RWinVerMajor() LOBYTE(LOWORD(GetVersion())) -#define RIsWinVerXPPlus() (RWinVerMajor()>=5 && LOWORD(GetVersion())!=5) #ifndef WM_THEMECHANGED #define WM_THEMECHANGED 0x031A diff --git a/src/core/stdchat/stdchat_10.vcxproj b/src/core/stdchat/stdchat_10.vcxproj index 4400a4a665..857c2f9094 100644 --- a/src/core/stdchat/stdchat_10.vcxproj +++ b/src/core/stdchat/stdchat_10.vcxproj @@ -91,7 +91,7 @@ /DLL %(AdditionalOptions) - Version.lib;%(AdditionalDependencies) + Version.lib;UxTheme.lib;%(AdditionalDependencies) type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27 true false @@ -121,7 +121,7 @@ /DLL %(AdditionalOptions) - Version.lib;%(AdditionalDependencies) + Version.lib;UxTheme.lib;%(AdditionalDependencies) 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) true false @@ -154,7 +154,7 @@ /PDBALTPATH:%_PDB% - Version.lib;%(AdditionalDependencies) + Version.lib;UxTheme.lib;%(AdditionalDependencies) type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27 true true @@ -189,7 +189,7 @@ /PDBALTPATH:%_PDB% - Version.lib;%(AdditionalDependencies) + Version.lib;UxTheme.lib;%(AdditionalDependencies) 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) true true diff --git a/src/core/stdchat/stdchat_11.vcxproj b/src/core/stdchat/stdchat_11.vcxproj index b227bd45cc..f4dc3202e8 100644 --- a/src/core/stdchat/stdchat_11.vcxproj +++ b/src/core/stdchat/stdchat_11.vcxproj @@ -95,7 +95,7 @@ /DLL %(AdditionalOptions) - Version.lib;%(AdditionalDependencies) + Version.lib;UxTheme.lib;%(AdditionalDependencies) type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27 true false @@ -126,7 +126,7 @@ /DLL %(AdditionalOptions) - Version.lib;%(AdditionalDependencies) + Version.lib;UxTheme.lib;%(AdditionalDependencies) 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) true false @@ -158,7 +158,7 @@ ..\..\..\include;..\..\..\include\msapi - Version.lib;%(AdditionalDependencies) + Version.lib;UxTheme.lib;%(AdditionalDependencies) type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27 true true @@ -192,7 +192,7 @@ ..\..\..\include;..\..\..\include\msapi - Version.lib;%(AdditionalDependencies) + Version.lib;UxTheme.lib;%(AdditionalDependencies) 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) true true 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 #include #include +#include +#include #include #include 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 @@ ..\..\..\include;..\..\..\include\msapi - comctl32.lib;%(AdditionalDependencies) + comctl32.lib;UxTheme.lib;shlwapi.lib;%(AdditionalDependencies) true 0x6590000 false @@ -120,7 +120,7 @@ ..\..\..\include;..\..\..\include\msapi - comctl32.lib;%(AdditionalDependencies) + comctl32.lib;UxTheme.lib;shlwapi.lib;%(AdditionalDependencies) 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) true 0x6590000 @@ -150,7 +150,7 @@ ..\..\..\include;..\..\..\include\msapi - comctl32.lib;%(AdditionalDependencies) + comctl32.lib;UxTheme.lib;shlwapi.lib;%(AdditionalDependencies) 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) true true @@ -183,7 +183,7 @@ ..\..\..\include;..\..\..\include\msapi - comctl32.lib;%(AdditionalDependencies) + comctl32.lib;UxTheme.lib;shlwapi.lib;%(AdditionalDependencies) 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) true true 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 @@ ..\..\..\include;..\..\..\include\msapi - comctl32.lib;%(AdditionalDependencies) + comctl32.lib;UxTheme.lib;shlwapi.lib;%(AdditionalDependencies) true 0x6590000 false @@ -125,7 +125,7 @@ ..\..\..\include;..\..\..\include\msapi - comctl32.lib;%(AdditionalDependencies) + comctl32.lib;UxTheme.lib;shlwapi.lib;%(AdditionalDependencies) 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) true 0x6590000 @@ -155,7 +155,7 @@ ..\..\..\include;..\..\..\include\msapi - comctl32.lib;%(AdditionalDependencies) + comctl32.lib;UxTheme.lib;shlwapi.lib;%(AdditionalDependencies) 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) true true @@ -187,7 +187,7 @@ ..\..\..\include;..\..\..\include\msapi - comctl32.lib;%(AdditionalDependencies) + comctl32.lib;UxTheme.lib;shlwapi.lib;%(AdditionalDependencies) 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) true true diff --git a/src/core/stdcrypt/commonheaders.h b/src/core/stdcrypt/commonheaders.h index a8d30e7a1a..4edcc6e358 100644 --- a/src/core/stdcrypt/commonheaders.h +++ b/src/core/stdcrypt/commonheaders.h @@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include -#include #include #include diff --git a/src/core/stdemail/commonheaders.h b/src/core/stdemail/commonheaders.h index 4ffd48de3f..40ae60a779 100644 --- a/src/core/stdemail/commonheaders.h +++ b/src/core/stdemail/commonheaders.h @@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include -#include #include #include diff --git a/src/core/stdfile/commonheaders.h b/src/core/stdfile/commonheaders.h index 514d5bf97a..70a1378387 100644 --- a/src/core/stdfile/commonheaders.h +++ b/src/core/stdfile/commonheaders.h @@ -28,9 +28,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include -#include #include #include +#include #include #include @@ -83,6 +83,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern HINSTANCE hInst; extern ITaskbarList3 * pTaskbarInterface; - -typedef HRESULT (STDAPICALLTYPE *pfnSHAutoComplete)(HWND, DWORD); -extern pfnSHAutoComplete shAutoComplete; diff --git a/src/core/stdfile/fileopts.cpp b/src/core/stdfile/fileopts.cpp index c018c18a5f..a19a912e6a 100644 --- a/src/core/stdfile/fileopts.cpp +++ b/src/core/stdfile/fileopts.cpp @@ -62,8 +62,7 @@ static INT_PTR CALLBACK DlgProcFileOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L { TranslateDialogDefault(hwndDlg); - if (shAutoComplete) - shAutoComplete(GetDlgItem(hwndDlg, IDC_FILEDIR), SHACF_FILESYS_DIRS); + SHAutoComplete(GetDlgItem(hwndDlg, IDC_FILEDIR), SHACF_FILESYS_DIRS); { TCHAR str[MAX_PATH]; diff --git a/src/core/stdfile/filerecvdlg.cpp b/src/core/stdfile/filerecvdlg.cpp index 476ae54918..c5dba47f70 100644 --- a/src/core/stdfile/filerecvdlg.cpp +++ b/src/core/stdfile/filerecvdlg.cpp @@ -233,8 +233,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l SetDlgItemText(hwndDlg, IDC_FROM, contactName); GetContactReceivedFilesDir(dat->hContact, szPath, SIZEOF(szPath), TRUE); SetDlgItemText(hwndDlg, IDC_FILEDIR, szPath); - if (shAutoComplete) - shAutoComplete(GetWindow(GetDlgItem(hwndDlg, IDC_FILEDIR), GW_CHILD), 1); + SHAutoComplete(GetWindow(GetDlgItem(hwndDlg, IDC_FILEDIR), GW_CHILD), 1); for (int i=0; i < MAX_MRU_DIRS; i++) { char idstr[32]; diff --git a/src/core/stdfile/main.cpp b/src/core/stdfile/main.cpp index 27c81fb044..dcedd83d52 100644 --- a/src/core/stdfile/main.cpp +++ b/src/core/stdfile/main.cpp @@ -28,7 +28,6 @@ TIME_API tmi; HINSTANCE hInst; int hLangpack; -pfnSHAutoComplete shAutoComplete; ITaskbarList3 * pTaskbarInterface; PLUGININFOEX pluginInfo = { @@ -67,8 +66,6 @@ extern "C" int __declspec(dllexport) Load(void) if ( IsWinVer7Plus()) CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_ALL, IID_ITaskbarList3, (void**)&pTaskbarInterface); - shAutoComplete = (pfnSHAutoComplete)GetProcAddress(GetModuleHandleA("shlwapi"), "SHAutoComplete"); - LoadSendRecvFileModule(); return 0; } diff --git a/src/core/stdfile/stdfile_10.vcxproj b/src/core/stdfile/stdfile_10.vcxproj index 0ca720f28f..4a57b56ae9 100644 --- a/src/core/stdfile/stdfile_10.vcxproj +++ b/src/core/stdfile/stdfile_10.vcxproj @@ -91,7 +91,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda32.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda32.lib;ws2_32.lib;comctl32.lib;Shlwapi.lib;%(AdditionalDependencies) true true true @@ -125,7 +125,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda32.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda32.lib;ws2_32.lib;comctl32.lib;Shlwapi.lib;%(AdditionalDependencies) true 0x3ae00000 false @@ -156,7 +156,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda64.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda64.lib;ws2_32.lib;comctl32.lib;Shlwapi.lib;%(AdditionalDependencies) true true true @@ -189,7 +189,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda64.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda64.lib;ws2_32.lib;comctl32.lib;Shlwapi.lib;%(AdditionalDependencies) true 0x3ae00000 false diff --git a/src/core/stdfile/stdfile_11.vcxproj b/src/core/stdfile/stdfile_11.vcxproj index 6e5259a9aa..eceb506577 100644 --- a/src/core/stdfile/stdfile_11.vcxproj +++ b/src/core/stdfile/stdfile_11.vcxproj @@ -95,7 +95,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda32.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda32.lib;ws2_32.lib;comctl32.lib;Shlwapi.lib;%(AdditionalDependencies) true true true @@ -128,7 +128,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda32.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda32.lib;ws2_32.lib;comctl32.lib;Shlwapi.lib;%(AdditionalDependencies) true 0x3ae00000 false @@ -160,7 +160,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda64.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda64.lib;ws2_32.lib;comctl32.lib;Shlwapi.lib;%(AdditionalDependencies) true true true @@ -192,7 +192,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda64.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda64.lib;ws2_32.lib;comctl32.lib;Shlwapi.lib;%(AdditionalDependencies) true 0x3ae00000 false diff --git a/src/core/stdhelp/commonheaders.h b/src/core/stdhelp/commonheaders.h index 383250aa26..a8303efdaa 100644 --- a/src/core/stdhelp/commonheaders.h +++ b/src/core/stdhelp/commonheaders.h @@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include -#include #include #include diff --git a/src/core/stdidle/commonheaders.h b/src/core/stdidle/commonheaders.h index 7455afd2a0..3ee34d7e8a 100644 --- a/src/core/stdidle/commonheaders.h +++ b/src/core/stdidle/commonheaders.h @@ -28,9 +28,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include -#include #include #include +#include #include #include @@ -75,15 +75,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "../stdplug.h" extern HINSTANCE hInst; - -typedef HDESK (WINAPI* pfnOpenInputDesktop)(DWORD, BOOL, DWORD); -extern pfnOpenInputDesktop openInputDesktop; - -typedef HDESK (WINAPI* pfnCloseDesktop)(HDESK); -extern pfnCloseDesktop closeDesktop; - -typedef HMONITOR(WINAPI *pfnMyMonitorFromWindow) (HWND, DWORD); -extern pfnMyMonitorFromWindow MyMonitorFromWindow; - -typedef BOOL(WINAPI *pfnMyGetMonitorInfo) (HMONITOR, LPMONITORINFO); -extern pfnMyGetMonitorInfo MyGetMonitorInfo; diff --git a/src/core/stdidle/idle.cpp b/src/core/stdidle/idle.cpp index a66f05d93e..4881c0f592 100644 --- a/src/core/stdidle/idle.cpp +++ b/src/core/stdidle/idle.cpp @@ -105,42 +105,21 @@ typedef enum _WTS_INFO_CLASS { #endif -VOID (WINAPI *_WTSFreeMemory)(PVOID); -BOOL (WINAPI *_WTSQuerySessionInformation)(HANDLE, DWORD, WTS_INFO_CLASS, PVOID, DWORD*); - -BOOL bIsWTSApiPresent = FALSE; - static BOOL bModuleInitialized = FALSE; -BOOL InitWTSAPI() -{ - HMODULE hDll = LoadLibraryA("wtsapi32.dll"); - if (hDll) { - _WTSFreeMemory = (VOID (WINAPI *)(PVOID))GetProcAddress(hDll, "WTSFreeMemory"); - _WTSQuerySessionInformation = (BOOL (WINAPI *)(HANDLE, DWORD, WTS_INFO_CLASS, PVOID, DWORD*))GetProcAddress(hDll, "WTSQuerySessionInformationW"); - - if (_WTSFreeMemory && _WTSQuerySessionInformation) return 1; - } - return 0; -} - BOOL IsTerminalDisconnected() { PVOID pBuffer = NULL; DWORD pBytesReturned = 0; BOOL result = FALSE; - if ( !bIsWTSApiPresent) - return FALSE; - - if (_WTSQuerySessionInformation(WTS_CURRENT_SERVER_HANDLE, WTS_CURRENT_SESSION, WTSConnectState, &pBuffer, &pBytesReturned)) { + if (WTSQuerySessionInformation(WTS_CURRENT_SERVER_HANDLE, WTS_CURRENT_SESSION, WTSConnectState, (LPTSTR *)&pBuffer, &pBytesReturned)) { if (*(PDWORD)pBuffer == WTSDisconnected) result = TRUE; } - else bIsWTSApiPresent = FALSE; if (pBuffer) - _WTSFreeMemory(pBuffer); + WTSFreeMemory(pBuffer); return result; } @@ -233,13 +212,11 @@ static bool IsWorkstationLocked (void) { bool rc = false; - if (openInputDesktop != NULL) { - HDESK hDesk = openInputDesktop(0, FALSE, DESKTOP_SWITCHDESKTOP); - if (hDesk == NULL) - rc = true; - else if (closeDesktop != NULL) - closeDesktop(hDesk); - } + HDESK hDesk = OpenInputDesktop(0, FALSE, DESKTOP_SWITCHDESKTOP); + if (hDesk == NULL) + rc = true; + else + CloseDesktop(hDesk); return rc; } @@ -257,13 +234,11 @@ bool IsFullScreen(void) rcScreen.right = GetSystemMetrics(SM_CXSCREEN); rcScreen.bottom = GetSystemMetrics(SM_CYSCREEN); - if (MyMonitorFromWindow) { - HMONITOR hMon = MyMonitorFromWindow(pcli->hwndContactList, MONITOR_DEFAULTTONEAREST); - MONITORINFO mi; - mi.cbSize = sizeof(mi); - if (MyGetMonitorInfo(hMon, &mi)) - rcScreen = mi.rcMonitor; - } + HMONITOR hMon = MonitorFromWindow(pcli->hwndContactList, MONITOR_DEFAULTTONEAREST); + MONITORINFO mi; + mi.cbSize = sizeof(mi); + if (GetMonitorInfo(hMon, &mi)) + rcScreen = mi.rcMonitor; HWND hWndDesktop = GetDesktopWindow(); HWND hWndShell = GetShellWindow(); @@ -358,10 +333,7 @@ static INT_PTR CALLBACK IdleOptsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L CheckDlgButton(hwndDlg, IDC_LOCKED, db_get_b(NULL, IDLEMOD, IDL_IDLEONLOCK, 0) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_IDLEPRIVATE, db_get_b(NULL, IDLEMOD, IDL_IDLEPRIVATE, 0) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_IDLESTATUSLOCK, db_get_b(NULL, IDLEMOD, IDL_IDLESTATUSLOCK, 0) ? BST_CHECKED : BST_UNCHECKED); - if ( !bIsWTSApiPresent) - EnableWindow(GetDlgItem(hwndDlg, IDC_IDLETERMINAL), FALSE); - else - CheckDlgButton(hwndDlg, IDC_IDLETERMINAL, db_get_b(NULL, IDLEMOD, IDL_IDLEONTSDC, 0) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_IDLETERMINAL, db_get_b(NULL, IDLEMOD, IDL_IDLEONTSDC, 0) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_IDLESOUNDSOFF, db_get_b(NULL, IDLEMOD, IDL_IDLESOUNDSOFF, 1) ? BST_CHECKED : BST_UNCHECKED); SendDlgItemMessage(hwndDlg, IDC_IDLESPIN, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwndDlg, IDC_IDLE1STTIME), 0); SendDlgItemMessage(hwndDlg, IDC_IDLESPIN, UDM_SETRANGE32, 1, 60); @@ -500,8 +472,6 @@ int LoadIdleModule(void) { bModuleInitialized = TRUE; - bIsWTSApiPresent = InitWTSAPI(); - MyGetLastInputInfo = (BOOL (WINAPI *)(LASTINPUTINFO*))GetProcAddress(GetModuleHandleA("user32"), "GetLastInputInfo"); hIdleEvent = CreateHookableEvent(ME_IDLE_CHANGED); IdleObject_Create(&gIdleObject); CreateServiceFunction(MS_IDLE_GETIDLEINFO, IdleGetInfo); diff --git a/src/core/stdidle/main.cpp b/src/core/stdidle/main.cpp index 50a9b58e6f..36dd64b1ad 100644 --- a/src/core/stdidle/main.cpp +++ b/src/core/stdidle/main.cpp @@ -29,11 +29,6 @@ TIME_API tmi; HINSTANCE hInst; int hLangpack; -pfnMyMonitorFromWindow MyMonitorFromWindow; -pfnMyGetMonitorInfo MyGetMonitorInfo; -pfnOpenInputDesktop openInputDesktop; -pfnCloseDesktop closeDesktop; - PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -65,13 +60,6 @@ extern "C" int __declspec(dllexport) Load(void) { mir_getLP(&pluginInfo); mir_getTMI(&tmi); - - HINSTANCE hUser32 = GetModuleHandleA("user32"); - openInputDesktop = (pfnOpenInputDesktop)GetProcAddress (hUser32, "OpenInputDesktop"); - closeDesktop = (pfnCloseDesktop)GetProcAddress (hUser32, "CloseDesktop"); - - MyMonitorFromWindow = (pfnMyMonitorFromWindow)GetProcAddress(hUser32, "MonitorFromWindow"); - MyGetMonitorInfo = (pfnMyGetMonitorInfo)GetProcAddress(hUser32, "GetMonitorInfoW"); mir_getCLI(); LoadIdleModule(); diff --git a/src/core/stdidle/stdidle_10.vcxproj b/src/core/stdidle/stdidle_10.vcxproj index f73f82cffb..01ed78aea8 100644 --- a/src/core/stdidle/stdidle_10.vcxproj +++ b/src/core/stdidle/stdidle_10.vcxproj @@ -91,7 +91,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda32.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda32.lib;ws2_32.lib;comctl32.lib;Wtsapi32.lib;%(AdditionalDependencies) true true true @@ -125,7 +125,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda32.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda32.lib;ws2_32.lib;comctl32.lib;Wtsapi32.lib;%(AdditionalDependencies) true 0x3ae00000 false @@ -156,7 +156,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda64.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda64.lib;ws2_32.lib;comctl32.lib;Wtsapi32.lib;%(AdditionalDependencies) true true true @@ -189,7 +189,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda64.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda64.lib;ws2_32.lib;comctl32.lib;Wtsapi32.lib;%(AdditionalDependencies) true 0x3ae00000 false @@ -200,10 +200,7 @@ - Create - Create - Create - Create + Create diff --git a/src/core/stdidle/stdidle_11.vcxproj b/src/core/stdidle/stdidle_11.vcxproj index 5e3fa1214d..50e2ce737e 100644 --- a/src/core/stdidle/stdidle_11.vcxproj +++ b/src/core/stdidle/stdidle_11.vcxproj @@ -95,7 +95,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda32.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda32.lib;ws2_32.lib;comctl32.lib;Wtsapi32.lib;%(AdditionalDependencies) true true true @@ -128,7 +128,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda32.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda32.lib;ws2_32.lib;comctl32.lib;Wtsapi32.lib;%(AdditionalDependencies) true 0x3ae00000 false @@ -160,7 +160,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda64.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda64.lib;ws2_32.lib;comctl32.lib;Wtsapi32.lib;%(AdditionalDependencies) true true true @@ -192,7 +192,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda64.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda64.lib;ws2_32.lib;comctl32.lib;Wtsapi32.lib;%(AdditionalDependencies) true 0x3ae00000 false @@ -203,10 +203,7 @@ - Create - Create - Create - Create + Create 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 #include #include +#include #include #include 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 @@ ..\..\..\include;..\..\..\include\msapi - comctl32.lib;%(AdditionalDependencies) + comctl32.lib;UxTheme.lib;%(AdditionalDependencies) true true true @@ -122,7 +122,7 @@ ..\..\..\include;..\..\..\include\msapi - comctl32.lib;%(AdditionalDependencies) + comctl32.lib;UxTheme.lib;%(AdditionalDependencies) true true true @@ -158,7 +158,7 @@ false $(IntDir)$(TargetName).lib Windows - comctl32.lib;%(AdditionalDependencies) + comctl32.lib;UxTheme.lib;%(AdditionalDependencies) $(ProfileDir)..\..\..\bin10\lib @@ -182,7 +182,7 @@ ..\..\..\include;..\..\..\include\msapi - comctl32.lib;%(AdditionalDependencies) + comctl32.lib;UxTheme.lib;%(AdditionalDependencies) true false $(IntDir)$(TargetName).lib 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 @@ ..\..\..\include;..\..\..\include\msapi - comctl32.lib;%(AdditionalDependencies) + comctl32.lib;UxTheme.lib;%(AdditionalDependencies) true true true @@ -125,7 +125,7 @@ ..\..\..\include;..\..\..\include\msapi - comctl32.lib;%(AdditionalDependencies) + comctl32.lib;UxTheme.lib;%(AdditionalDependencies) true true true @@ -160,7 +160,7 @@ false $(IntDir)$(TargetName).lib Windows - comctl32.lib;%(AdditionalDependencies) + comctl32.lib;UxTheme.lib;%(AdditionalDependencies) $(ProfileDir)..\..\..\bin11\lib false @@ -185,7 +185,7 @@ ..\..\..\include;..\..\..\include\msapi - comctl32.lib;%(AdditionalDependencies) + comctl32.lib;UxTheme.lib;%(AdditionalDependencies) true false $(IntDir)$(TargetName).lib diff --git a/src/core/stduihist/commonheaders.h b/src/core/stduihist/commonheaders.h index c7f477c952..dd332f5e00 100644 --- a/src/core/stduihist/commonheaders.h +++ b/src/core/stduihist/commonheaders.h @@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include -#include #include #include diff --git a/src/core/stdurl/commonheaders.h b/src/core/stdurl/commonheaders.h index 25ea837012..59087c13ad 100644 --- a/src/core/stdurl/commonheaders.h +++ b/src/core/stdurl/commonheaders.h @@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include -#include #include #include diff --git a/src/core/stduserinfo/commonheaders.h b/src/core/stduserinfo/commonheaders.h index 47b132fae3..2cf6182ff6 100644 --- a/src/core/stduserinfo/commonheaders.h +++ b/src/core/stduserinfo/commonheaders.h @@ -75,6 +75,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "../stdplug.h" extern HINSTANCE hInst; - -typedef HRESULT (STDAPICALLTYPE *pfnEnableThemeDialogTexture)(HWND hwnd, DWORD dwFlags); -extern pfnEnableThemeDialogTexture enableThemeDialogTexture; diff --git a/src/core/stduserinfo/main.cpp b/src/core/stduserinfo/main.cpp index f75fb42bc6..8dcbe30b17 100644 --- a/src/core/stduserinfo/main.cpp +++ b/src/core/stduserinfo/main.cpp @@ -28,8 +28,6 @@ TIME_API tmi; HINSTANCE hInst; int hLangpack; -pfnEnableThemeDialogTexture enableThemeDialogTexture; - PLUGININFOEX pluginInfo = { sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -63,12 +61,6 @@ extern "C" int __declspec(dllexport) Load(void) mir_getTMI(&tmi); mir_getCLI(); - if ( IsWinVerXPPlus()) { - HINSTANCE hThemeAPI = LoadLibraryA("uxtheme.dll"); - if (hThemeAPI) - enableThemeDialogTexture = (pfnEnableThemeDialogTexture)GetProcAddress(hThemeAPI, "EnableThemeDialogTexture"); - } - LoadUserInfoModule(); return 0; } diff --git a/src/core/stduserinfo/stduserinfo_10.vcxproj b/src/core/stduserinfo/stduserinfo_10.vcxproj index b7c9d19397..c2b4fef5f9 100644 --- a/src/core/stduserinfo/stduserinfo_10.vcxproj +++ b/src/core/stduserinfo/stduserinfo_10.vcxproj @@ -91,7 +91,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda32.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda32.lib;ws2_32.lib;comctl32.lib;UxTheme.lib;%(AdditionalDependencies) true true true @@ -125,7 +125,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda32.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda32.lib;ws2_32.lib;comctl32.lib;UxTheme.lib;%(AdditionalDependencies) true 0x3ae00000 false @@ -156,7 +156,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda64.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda64.lib;ws2_32.lib;comctl32.lib;UxTheme.lib;%(AdditionalDependencies) true true true @@ -189,7 +189,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda64.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda64.lib;ws2_32.lib;comctl32.lib;UxTheme.lib;%(AdditionalDependencies) true 0x3ae00000 false diff --git a/src/core/stduserinfo/stduserinfo_11.vcxproj b/src/core/stduserinfo/stduserinfo_11.vcxproj index ac1cbb9bfa..0b2ab7c824 100644 --- a/src/core/stduserinfo/stduserinfo_11.vcxproj +++ b/src/core/stduserinfo/stduserinfo_11.vcxproj @@ -95,7 +95,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda32.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda32.lib;ws2_32.lib;comctl32.lib;UxTheme.lib;%(AdditionalDependencies) true true true @@ -128,7 +128,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda32.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda32.lib;ws2_32.lib;comctl32.lib;UxTheme.lib;%(AdditionalDependencies) true 0x3ae00000 false @@ -160,7 +160,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda64.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda64.lib;ws2_32.lib;comctl32.lib;UxTheme.lib;%(AdditionalDependencies) true true true @@ -192,7 +192,7 @@ ..\..\..\include\msapi;..\..\..\include - miranda64.lib;ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + miranda64.lib;ws2_32.lib;comctl32.lib;UxTheme.lib;%(AdditionalDependencies) true 0x3ae00000 false diff --git a/src/core/stduserinfo/userinfo.cpp b/src/core/stduserinfo/userinfo.cpp index 152b4b34b3..ca9b705e98 100644 --- a/src/core/stduserinfo/userinfo.cpp +++ b/src/core/stduserinfo/userinfo.cpp @@ -168,8 +168,7 @@ static INT_PTR AddDetailsPage(WPARAM wParam, LPARAM lParam) static void ThemeDialogBackground(HWND hwnd) { - if (enableThemeDialogTexture) - enableThemeDialogTexture(hwnd, ETDT_ENABLETAB); + EnableThemeDialogTexture(hwnd, ETDT_ENABLETAB); } static void CreateDetailsTabs(HWND hwndDlg, DetailsData *dat, DetailsPageData *ppg) diff --git a/src/core/stduseronline/commonheaders.h b/src/core/stduseronline/commonheaders.h index e1e5ef10a9..3d1df67fc3 100644 --- a/src/core/stduseronline/commonheaders.h +++ b/src/core/stduseronline/commonheaders.h @@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include -#include #include #include -- cgit v1.2.3