From a6359218bf2588d71c41a9dac62f62d6a36aea30 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 21 Sep 2013 13:43:29 +0000 Subject: using Uxtheme in protocols git-svn-id: http://svn.miranda-ng.org/main/trunk@6156 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/AimOscar/aim_10.vcxproj | 16 ++++++------- protocols/AimOscar/aim_11.vcxproj | 8 +++---- protocols/AimOscar/src/aim.cpp | 1 - protocols/AimOscar/src/aim.h | 1 + protocols/AimOscar/src/theme.cpp | 23 ------------------- protocols/AimOscar/src/theme.h | 6 ----- protocols/AimOscar/src/ui.cpp | 9 +++----- protocols/IcqOscarJ/src/icq_opts.cpp | 8 ------- protocols/IcqOscarJ/src/icqoscar.h | 1 - protocols/JabberG/jabber_10.vcxproj | 9 ++++---- protocols/JabberG/jabber_11.vcxproj | 8 +++---- protocols/JabberG/src/jabber.cpp | 20 ----------------- protocols/JabberG/src/jabber.h | 7 ++---- protocols/JabberG/src/jabber_bookmarks.cpp | 2 +- protocols/JabberG/src/jabber_captcha.cpp | 4 +++- protocols/JabberG/src/jabber_form.cpp | 2 ++ protocols/JabberG/src/jabber_iqid_muc.cpp | 11 +++++---- protocols/JabberG/src/jabber_privacy.cpp | 2 +- protocols/JabberG/src/jabber_secur.cpp | 17 ++------------ protocols/JabberG/src/jabber_treelist.cpp | 4 ++-- protocols/JabberG/src/jabber_userinfo.cpp | 8 +++---- protocols/JabberG/src/jabber_vcard.cpp | 8 +++---- protocols/JabberG/src/ui_utils.cpp | 36 +++++++++--------------------- protocols/JabberG/src/ui_utils.h | 3 --- protocols/MRA/src/Mra.h | 1 - 25 files changed, 64 insertions(+), 151 deletions(-) (limited to 'protocols') diff --git a/protocols/AimOscar/aim_10.vcxproj b/protocols/AimOscar/aim_10.vcxproj index 930d0b758f..c9c95a6cde 100644 --- a/protocols/AimOscar/aim_10.vcxproj +++ b/protocols/AimOscar/aim_10.vcxproj @@ -73,7 +73,7 @@ Disabled ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;AIM_EXPORTS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL Use @@ -88,7 +88,7 @@ ..\..\include;..\..\include\msapi - ws2_32.lib;%(AdditionalDependencies) + ws2_32.lib;UxTheme.lib;%(AdditionalDependencies) true false $(IntDir)$(TargetName).lib @@ -100,7 +100,7 @@ Disabled ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;AIM_EXPORTS;%(PreprocessorDefinitions) + _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL Use @@ -117,7 +117,7 @@ true false $(IntDir)$(TargetName).lib - ws2_32.lib;%(AdditionalDependencies) + ws2_32.lib;UxTheme.lib;%(AdditionalDependencies) Windows $(ProfileDir)..\..\bin10\lib @@ -128,7 +128,7 @@ OnlyExplicitInline Size ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;AIM_EXPORTS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true false false @@ -144,7 +144,7 @@ ..\..\include;..\..\include\msapi - ws2_32.lib;%(AdditionalDependencies) + ws2_32.lib;UxTheme.lib;%(AdditionalDependencies) true true true @@ -161,7 +161,7 @@ OnlyExplicitInline Size ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;AIM_EXPORTS;%(PreprocessorDefinitions) + NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true false false @@ -177,7 +177,7 @@ ..\..\include;..\..\include\msapi - ws2_32.lib;%(AdditionalDependencies) + ws2_32.lib;UxTheme.lib;%(AdditionalDependencies) true true true diff --git a/protocols/AimOscar/aim_11.vcxproj b/protocols/AimOscar/aim_11.vcxproj index f5bd561c6c..2310f073c1 100644 --- a/protocols/AimOscar/aim_11.vcxproj +++ b/protocols/AimOscar/aim_11.vcxproj @@ -92,7 +92,7 @@ ..\..\include;..\..\include\msapi - ws2_32.lib;%(AdditionalDependencies) + ws2_32.lib;UxTheme.lib;%(AdditionalDependencies) true false $(IntDir)$(TargetName).lib @@ -122,7 +122,7 @@ true false $(IntDir)$(TargetName).lib - ws2_32.lib;%(AdditionalDependencies) + ws2_32.lib;UxTheme.lib;%(AdditionalDependencies) Windows $(ProfileDir)..\..\bin11\lib @@ -149,7 +149,7 @@ ..\..\include;..\..\include\msapi - ws2_32.lib;%(AdditionalDependencies) + ws2_32.lib;UxTheme.lib;%(AdditionalDependencies) true true true @@ -181,7 +181,7 @@ ..\..\include;..\..\include\msapi - ws2_32.lib;%(AdditionalDependencies) + ws2_32.lib;UxTheme.lib;%(AdditionalDependencies) true true true diff --git a/protocols/AimOscar/src/aim.cpp b/protocols/AimOscar/src/aim.cpp index 27f991e5a9..81df8ff453 100644 --- a/protocols/AimOscar/src/aim.cpp +++ b/protocols/AimOscar/src/aim.cpp @@ -112,7 +112,6 @@ extern "C" int __declspec(dllexport) Load(void) pd.fnUninit = protoUninit; CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM) & pd); - InitThemeSupport(); InitIcons(); return 0; diff --git a/protocols/AimOscar/src/aim.h b/protocols/AimOscar/src/aim.h index c05129e385..ddf2d6d60c 100644 --- a/protocols/AimOscar/src/aim.h +++ b/protocols/AimOscar/src/aim.h @@ -27,6 +27,7 @@ along with this program. If not, see . #include #include #include +#include //Miranda NG includes #include diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp index 14a97d7f81..0a553f1d55 100644 --- a/protocols/AimOscar/src/theme.cpp +++ b/protocols/AimOscar/src/theme.cpp @@ -174,29 +174,6 @@ void InitExtraIcons(void) hExtraES = ExtraIcon_Register("aimextstatus", LPGEN("AIM Extended Status"), "AIM_hiptop"); } -///////////////////////////////////////////////////////////////////////////////////////// -// Themes - -#define MGPROC(x) GetProcAddress(themeAPIHandle,x) - -HMODULE themeAPIHandle = NULL; // handle to uxtheme.dll -HANDLE (WINAPI *MyOpenThemeData)(HWND,LPCWSTR) = 0; -HRESULT (WINAPI *MyCloseThemeData)(HANDLE) = 0; -HRESULT (WINAPI *MyDrawThemeBackground)(HANDLE,HDC,int,int,const RECT *,const RECT *) = 0; - -void InitThemeSupport(void) -{ - if (!IsWinVerXPPlus()) return; - - 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"); - } -} - ///////////////////////////////////////////////////////////////////////////////////////// // OnPreBuildContactMenu diff --git a/protocols/AimOscar/src/theme.h b/protocols/AimOscar/src/theme.h index 09566479ad..8c520ceb75 100644 --- a/protocols/AimOscar/src/theme.h +++ b/protocols/AimOscar/src/theme.h @@ -19,12 +19,6 @@ along with this program. If not, see . #ifndef THEME_H #define THEME_H -extern HMODULE themeAPIHandle; -extern HANDLE (WINAPI *MyOpenThemeData)(HWND,LPCWSTR); -extern HRESULT (WINAPI *MyCloseThemeData)(HANDLE); -extern HRESULT (WINAPI *MyDrawThemeBackground)(HANDLE,HDC,int,int,const RECT *,const RECT *); - -void InitThemeSupport(void); void InitIcons(void); void InitExtraIcons(void); diff --git a/protocols/AimOscar/src/ui.cpp b/protocols/AimOscar/src/ui.cpp index 9c165eb7b5..9e5a82cab0 100644 --- a/protocols/AimOscar/src/ui.cpp +++ b/protocols/AimOscar/src/ui.cpp @@ -47,7 +47,7 @@ void DrawMyControl(HDC hDC, HWND /*hwndButton*/, HANDLE hTheme, UINT iState, REC } rect.top-=1; rect.left-=1; - MyDrawThemeBackground(hTheme, hDC, BP_PUSHBUTTON,state, &rect, NULL); + DrawThemeBackground(hTheme, hDC, BP_PUSHBUTTON,state, &rect, NULL); } else { @@ -219,11 +219,8 @@ static INT_PTR CALLBACK userinfo_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, L case WM_DRAWITEM: { - if (themeAPIHandle) - { - MyCloseThemeData (hThemeButton); - hThemeButton = MyOpenThemeData (GetDlgItem(hwndDlg, IDC_BOLD), L"Button"); - } + CloseThemeData(hThemeButton); + hThemeButton = OpenThemeData(GetDlgItem(hwndDlg, IDC_BOLD), L"Button"); LPDRAWITEMSTRUCT lpDIS = (LPDRAWITEMSTRUCT) lParam; if (lpDIS->CtlID == IDC_SUPERSCRIPT) { diff --git a/protocols/IcqOscarJ/src/icq_opts.cpp b/protocols/IcqOscarJ/src/icq_opts.cpp index ff7a3b92ef..8aa34ba65d 100644 --- a/protocols/IcqOscarJ/src/icq_opts.cpp +++ b/protocols/IcqOscarJ/src/icq_opts.cpp @@ -41,8 +41,6 @@ static const char* szLogLevelDescr[] = { LPGEN("Do not display any problems (not recommended)") }; -static BOOL (WINAPI *pfnEnableThemeDialogTexture)(HANDLE, DWORD) = 0; - static void LoadDBCheckState(CIcqProto* ppro, HWND hwndDlg, int idCtrl, const char* szSetting, BYTE bDef) { CheckDlgButton(hwndDlg, idCtrl, ppro->getByte(szSetting, bDef)); @@ -571,12 +569,6 @@ INT_PTR CALLBACK DlgProcIcqPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR int CIcqProto::OnOptionsInit(WPARAM wParam, LPARAM lParam) { - if (IsWinVerXPPlus()) { - HMODULE hUxTheme = GetModuleHandleA("uxtheme.dll"); - if (hUxTheme) - pfnEnableThemeDialogTexture = (BOOL (WINAPI *)(HANDLE, DWORD))GetProcAddress(hUxTheme, "EnableThemeDialogTexture"); - } - OPTIONSDIALOGPAGE odp = {0}; odp.cbSize = sizeof(odp); odp.position = -800000000; diff --git a/protocols/IcqOscarJ/src/icqoscar.h b/protocols/IcqOscarJ/src/icqoscar.h index a6cbcb6714..059f016a20 100644 --- a/protocols/IcqOscarJ/src/icqoscar.h +++ b/protocols/IcqOscarJ/src/icqoscar.h @@ -33,7 +33,6 @@ // Windows includes #include #include -#include // Standard includes #include diff --git a/protocols/JabberG/jabber_10.vcxproj b/protocols/JabberG/jabber_10.vcxproj index f888bef32b..e9d51ee5e9 100644 --- a/protocols/JabberG/jabber_10.vcxproj +++ b/protocols/JabberG/jabber_10.vcxproj @@ -92,7 +92,7 @@ /PDBALTPATH:%_PDB% - ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.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 @@ -127,7 +127,7 @@ /PDBALTPATH:%_PDB% - ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.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 @@ -160,7 +160,7 @@ ..\..\include;..\..\include\msapi - ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;%(AdditionalDependencies) true 0x32500000 false @@ -190,7 +190,7 @@ ..\..\include;..\..\include\msapi - ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.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 0x32500000 @@ -259,6 +259,7 @@ + diff --git a/protocols/JabberG/jabber_11.vcxproj b/protocols/JabberG/jabber_11.vcxproj index 2287281c8c..74bf78b9a1 100644 --- a/protocols/JabberG/jabber_11.vcxproj +++ b/protocols/JabberG/jabber_11.vcxproj @@ -95,7 +95,7 @@ ..\..\include;..\..\include\msapi - ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.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 @@ -129,7 +129,7 @@ ..\..\include;..\..\include\msapi - ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.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 @@ -162,7 +162,7 @@ ..\..\include;..\..\include\msapi - ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;%(AdditionalDependencies) true 0x32500000 false @@ -193,7 +193,7 @@ ..\..\include;..\..\include\msapi - ws2_32.lib;comctl32.lib;%(AdditionalDependencies) + ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.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 0x32500000 diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp index 6a6441349b..13ac23f6dd 100644 --- a/protocols/JabberG/src/jabber.cpp +++ b/protocols/JabberG/src/jabber.cpp @@ -58,13 +58,6 @@ TIME_API tmi; CLIST_INTERFACE* pcli; -///////////////////////////////////////////////////////////////////////////// -// Theme API -BOOL (WINAPI *JabberAlphaBlend)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION) = NULL; -BOOL (WINAPI *JabberIsThemeActive)() = NULL; -HRESULT (WINAPI *JabberDrawThemeParentBackground)(HWND, HDC, RECT *) = NULL; -///////////////////////////////////////////////////////////////////////////// - BOOL jabberChatDllPresent = FALSE; HANDLE hExtraActivity = NULL; @@ -208,19 +201,6 @@ extern "C" int __declspec(dllexport) Load() pd.type = PROTOTYPE_PROTOCOL; CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd); - // Load some fuctions - HMODULE hDll; - if (hDll = GetModuleHandleA("gdi32.dll")) - JabberAlphaBlend = (BOOL (WINAPI *)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION)) GetProcAddress(hDll, "GdiAlphaBlend"); - if (JabberAlphaBlend == NULL && (hDll = LoadLibraryA("msimg32.dll"))) - JabberAlphaBlend = (BOOL (WINAPI *)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION)) GetProcAddress(hDll, "AlphaBlend"); - - if (IsWinVerXPPlus()) { - if (hDll = GetModuleHandleA("uxtheme")) { - JabberDrawThemeParentBackground = (HRESULT (WINAPI *)(HWND,HDC,RECT *))GetProcAddress(hDll, "DrawThemeParentBackground"); - JabberIsThemeActive = (BOOL (WINAPI *)())GetProcAddress(hDll, "IsThemeActive"); - } } - g_IconsInit(); g_XstatusIconsInit(); g_MenuInit(); diff --git a/protocols/JabberG/src/jabber.h b/protocols/JabberG/src/jabber.h index 740002ed40..3a415aefaf 100644 --- a/protocols/JabberG/src/jabber.h +++ b/protocols/JabberG/src/jabber.h @@ -42,6 +42,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include +#define SECURITY_WIN32 +#include #include #include @@ -585,11 +587,6 @@ extern BOOL jabberChatDllPresent; extern HANDLE hExtraMood; extern HANDLE hExtraActivity; -// Theme API -extern BOOL (WINAPI *JabberAlphaBlend)(HDC, int, int, int, int, HDC, int, int, int, int, BLENDFUNCTION); -extern BOOL (WINAPI *JabberIsThemeActive)(); -extern HRESULT (WINAPI *JabberDrawThemeParentBackground)(HWND, HDC, RECT *); - extern TCHAR szCoreVersion[]; extern int g_cbCountries; diff --git a/protocols/JabberG/src/jabber_bookmarks.cpp b/protocols/JabberG/src/jabber_bookmarks.cpp index 2c2a9807e9..e025dbc5d0 100644 --- a/protocols/JabberG/src/jabber_bookmarks.cpp +++ b/protocols/JabberG/src/jabber_bookmarks.cpp @@ -285,7 +285,7 @@ void CJabberDlgBookmarks::OnInitDialog() m_btnEdit.Disable(); m_btnRemove.Disable(); - m_lvBookmarks.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_HEADERDRAGDROP | (IsWinVerXPPlus() ? LVS_EX_DOUBLEBUFFER : 0)); + m_lvBookmarks.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_HEADERDRAGDROP | LVS_EX_DOUBLEBUFFER); HIMAGELIST hIml = m_lvBookmarks.CreateImageList(LVSIL_SMALL); ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("group")); diff --git a/protocols/JabberG/src/jabber_captcha.cpp b/protocols/JabberG/src/jabber_captcha.cpp index 687b8487dd..f485acdae7 100644 --- a/protocols/JabberG/src/jabber_captcha.cpp +++ b/protocols/JabberG/src/jabber_captcha.cpp @@ -157,11 +157,13 @@ bool CJabberProto::ProcessCaptcha(HXML node, HXML parentNode, ThreadData* info) GetObject(param.bmp, sizeof(bmp), &bmp); param.w = bmp.bmWidth; param.h = bmp.bmHeight; - int res = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_CAPTCHAFORM), NULL, JabberCaptchaFormDlgProc, (LPARAM)¶m); + /*int res = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_CAPTCHAFORM), NULL, JabberCaptchaFormDlgProc, (LPARAM)¶m); if (lstrcmp(param.Result, _T("")) == 0 || !res) sendCaptchaError(info, param.from, param.to, param.challenge); else sendCaptchaResult(param.Result, info, param.from, param.challenge, param.fromjid, param.sid); + */ + FormCreateDialog(x, _T("Bots Challenge Test"), &CJabberProto::SetMucConfig, mir_tstrdup(param.from)); return true; } diff --git a/protocols/JabberG/src/jabber_form.cpp b/protocols/JabberG/src/jabber_form.cpp index a1aa699924..8776a965e4 100644 --- a/protocols/JabberG/src/jabber_form.cpp +++ b/protocols/JabberG/src/jabber_form.cpp @@ -741,6 +741,8 @@ static INT_PTR CALLBACK JabberFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, // Set instruction field if (jfi->xNode != NULL && (n = xmlGetChild(jfi->xNode , "instructions")) != NULL && xmlGetText(n) != NULL) JabberFormSetInstruction(hwndDlg, xmlGetText(n)); + else if (jfi->xNode != NULL && (n = xmlGetChild(jfi->xNode , "label")) != NULL && xmlGetText(n) != NULL) + JabberFormSetInstruction(hwndDlg, xmlGetText(n)); else { if (jfi->xNode != NULL && (n = xmlGetChild(jfi->xNode , "title")) != NULL && xmlGetText(n) != NULL) diff --git a/protocols/JabberG/src/jabber_iqid_muc.cpp b/protocols/JabberG/src/jabber_iqid_muc.cpp index a1fc165af9..03fc89c57a 100644 --- a/protocols/JabberG/src/jabber_iqid_muc.cpp +++ b/protocols/JabberG/src/jabber_iqid_muc.cpp @@ -33,9 +33,8 @@ void CJabberProto::SetMucConfig(HXML node, void *from) HXML query = iq << XQUERY(JABBER_FEAT_MUC_OWNER); xmlAddChild(query, node); m_ThreadInfo->send(iq); -} } - -void LaunchForm(HXML node); + } +} void CJabberProto::OnIqResultGetMuc(HXML iqNode) { @@ -57,7 +56,11 @@ void CJabberProto::OnIqResultGetMuc(HXML iqNode) if ( !lstrcmp(str, JABBER_FEAT_DATA_FORMS)) //LaunchForm(xNode); FormCreateDialog(xNode, _T("Jabber Conference Room Configuration"), &CJabberProto::SetMucConfig, mir_tstrdup(from)); -} } } } } + } + } + } + } +} static void sttFillJidList(HWND hwndDlg) { diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index 224883e682..719af5cf2c 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -803,7 +803,7 @@ void CJabberDlgPrivacyLists::OnInitDialog() GetWindowLongPtr(GetDlgItem(m_hwnd, IDC_CLIST), GWL_STYLE)|CLS_HIDEEMPTYGROUPS|CLS_USEGROUPS|CLS_GREYALTERNATE); m_clcClist.SetExStyle(CLS_EX_DISABLEDRAGDROP|CLS_EX_TRACKSELECT); - HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),(IsWinVerXPPlus()?ILC_COLOR32:ILC_COLOR16)|ILC_MASK,9,9); + HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 9, 9); ImageList_AddIcon_Icolib(hIml, LoadSkinnedIcon(SKINICON_OTHER_SMALLDOT)); ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("pl_msg_allow")); ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("pl_msg_deny")); diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp index 67423b03b4..459c61f9e4 100644 --- a/protocols/JabberG/src/jabber_secur.cpp +++ b/protocols/JabberG/src/jabber_secur.cpp @@ -24,9 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "jabber.h" #include "jabber_secur.h" -typedef BYTE (WINAPI *GetUserNameExType)(int NameFormat, LPTSTR lpNameBuffer, PULONG nSize); - - ///////////////////////////////////////////////////////////////////////////////////////// // ntlm auth - LanServer based authorization @@ -67,23 +64,13 @@ TNtlmAuth::~TNtlmAuth() bool TNtlmAuth::getSpn(TCHAR* szSpn, size_t dwSpnLen) { - HMODULE hDll = GetModuleHandle(_T("secur32.dll")); - if ( !hDll) - hDll = LoadLibrary(_T("secur32.dll")); - if ( !hDll) - return false; - - GetUserNameExType myGetUserNameEx = - (GetUserNameExType)GetProcAddress(hDll, "GetUserNameExW"); - - if ( !myGetUserNameEx) return false; TCHAR szFullUserName[128] = _T(""); ULONG szFullUserNameLen = SIZEOF(szFullUserName); - if ( !myGetUserNameEx(12, szFullUserName, &szFullUserNameLen)) { + if ( !GetUserNameEx(NameDnsDomain, szFullUserName, &szFullUserNameLen)) { szFullUserName[ 0 ] = 0; szFullUserNameLen = SIZEOF(szFullUserName); - myGetUserNameEx(2, szFullUserName, &szFullUserNameLen); + GetUserNameEx(NameSamCompatible, szFullUserName, &szFullUserNameLen); } TCHAR *name = _tcsrchr(szFullUserName, '\\'); diff --git a/protocols/JabberG/src/jabber_treelist.cpp b/protocols/JabberG/src/jabber_treelist.cpp index c34810c9da..19da05a737 100644 --- a/protocols/JabberG/src/jabber_treelist.cpp +++ b/protocols/JabberG/src/jabber_treelist.cpp @@ -132,10 +132,10 @@ void TreeList_Create(HWND hwnd) ListView_SetExtendedListViewStyle(hwnd, LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER | LVS_EX_GRIDLINES | LVS_EX_INFOTIP); HIMAGELIST hIml; - hIml = ImageList_Create(16, 16, ILC_MASK + (IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16), 2, 1); + hIml = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 2, 1); ListView_SetImageList (hwnd, hIml, LVSIL_SMALL); - hIml = ImageList_Create(16, 16, ILC_MASK + (IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16), 2, 1); + hIml = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 2, 1); ImageList_AddIcon_Icolib(hIml, (HICON)CallService(MS_SKIN_LOADICON, SKINICON_OTHER_GROUPOPEN, 0)); ImageList_AddIcon_Icolib(hIml, (HICON)CallService(MS_SKIN_LOADICON, SKINICON_OTHER_GROUPSHUT, 0)); ImageList_AddIcon_Icolib(hIml, (HICON)CallService(MS_SKIN_LOADICON, SKINICON_OTHER_DOWNARROW, 0)); diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index a9c7455bcb..aabac64901 100644 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -798,21 +798,21 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP } } - if (JabberIsThemeActive && JabberDrawThemeParentBackground && JabberIsThemeActive()) { + if (IsThemeActive()) { RECT rc; GetClientRect(hwndCanvas, &rc); - JabberDrawThemeParentBackground(hwndCanvas, hdcCanvas, &rc); + DrawThemeParentBackground(hwndCanvas, hdcCanvas, &rc); } else { RECT rc; GetClientRect(hwndCanvas, &rc); FillRect(hdcCanvas, &rc, (HBRUSH)GetSysColorBrush(COLOR_BTNFACE)); } - if (JabberAlphaBlend && bm.bmBitsPixel == 32) { + if (bm.bmBitsPixel == 32) { BLENDFUNCTION bf = {0}; bf.AlphaFormat = AC_SRC_ALPHA; bf.BlendOp = AC_SRC_OVER; bf.SourceConstantAlpha = 255; - JabberAlphaBlend(hdcCanvas, pt.x, pt.y, ptFitSize.x, ptFitSize.y, hdcMem, ptOrg.x, ptOrg.y, ptSize.x, ptSize.y, bf); + GdiAlphaBlend(hdcCanvas, pt.x, pt.y, ptFitSize.x, ptFitSize.y, hdcMem, ptOrg.x, ptOrg.y, ptSize.x, ptSize.y, bf); } else { SetStretchBltMode(hdcCanvas, COLORONCOLOR); diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp index f0cec19fa1..fbfa3d9c7f 100644 --- a/protocols/JabberG/src/jabber_vcard.cpp +++ b/protocols/JabberG/src/jabber_vcard.cpp @@ -439,17 +439,17 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR RECT rc; GetClientRect(hwndCanvas, &rc); - if (JabberIsThemeActive && JabberDrawThemeParentBackground && JabberIsThemeActive()) - JabberDrawThemeParentBackground(hwndCanvas, hdcCanvas, &rc); + if (IsThemeActive()) + DrawThemeParentBackground(hwndCanvas, hdcCanvas, &rc); else FillRect(hdcCanvas, &rc, (HBRUSH)GetSysColorBrush(COLOR_BTNFACE)); - if (JabberAlphaBlend && (bm.bmBitsPixel == 32)) { + if (bm.bmBitsPixel == 32) { BLENDFUNCTION bf = {0}; bf.AlphaFormat = AC_SRC_ALPHA; bf.BlendOp = AC_SRC_OVER; bf.SourceConstantAlpha = 255; - JabberAlphaBlend(hdcCanvas, pt.x, pt.y, ptFitSize.x, ptFitSize.y, hdcMem, ptOrg.x, ptOrg.y, ptSize.x, ptSize.y, bf); + GdiAlphaBlend(hdcCanvas, pt.x, pt.y, ptFitSize.x, ptFitSize.y, hdcMem, ptOrg.x, ptOrg.y, ptSize.x, ptSize.y, bf); } else { SetStretchBltMode(hdcCanvas, COLORONCOLOR); diff --git a/protocols/JabberG/src/ui_utils.cpp b/protocols/JabberG/src/ui_utils.cpp index aa3d67891d..23f357adff 100644 --- a/protocols/JabberG/src/ui_utils.cpp +++ b/protocols/JabberG/src/ui_utils.cpp @@ -238,20 +238,9 @@ int CDlgBase::GlobalDlgResizer(HWND hwnd, LPARAM, UTILRESIZECONTROL *urc) return wnd->Resizer(urc); } -CDlgBase::pfnEnableThemeDialogTexture CDlgBase::MyEnableThemeDialogTexture = NULL; void CDlgBase::ThemeDialogBackground(BOOL tabbed) { - if ( !MyEnableThemeDialogTexture && IsWinVerXPPlus()) - { - HMODULE hThemeAPI = GetModuleHandleA("uxtheme"); - if (hThemeAPI) - MyEnableThemeDialogTexture = (pfnEnableThemeDialogTexture)GetProcAddress(hThemeAPI,"EnableThemeDialogTexture"); - } - - if (MyEnableThemeDialogTexture) - { - MyEnableThemeDialogTexture(m_hwnd,(tabbed?0x00000002:0x00000001)|0x00000004); //0x00000002|0x00000004=ETDT_ENABLETAB - } + EnableThemeDialogTexture(m_hwnd, (tabbed ? ETDT_ENABLE : ETDT_DISABLE) | ETDT_USETABTEXTURE); } void CDlgBase::AddControl(CCtrlBase *ctrl) @@ -868,7 +857,7 @@ HIMAGELIST CCtrlListView::CreateImageList(int iImageList) if (hIml = GetImageList(iImageList)) return hIml; - hIml = ImageList_Create(16, 16, IsWinVerXPPlus() ? ILC_COLOR32|ILC_MASK : ILC_COLOR16|ILC_MASK, 0, 1); + hIml = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 0, 1); SetImageList(hIml, iImageList); return hIml; } @@ -886,16 +875,13 @@ void CCtrlListView::AddColumn(int iSubItem, TCHAR *name, int cx) void CCtrlListView::AddGroup(int iGroupId, TCHAR *name) { - if (IsWinVerXPPlus()) - { - LVGROUP lvg = {0}; - lvg.cbSize = sizeof(lvg); - lvg.mask = LVGF_HEADER|LVGF_GROUPID; - lvg.pszHeader = name; - lvg.cchHeader = lstrlen(lvg.pszHeader); - lvg.iGroupId = iGroupId; - InsertGroup(-1, &lvg); - } + LVGROUP lvg = {0}; + lvg.cbSize = sizeof(lvg); + lvg.mask = LVGF_HEADER|LVGF_GROUPID; + lvg.pszHeader = name; + lvg.cchHeader = lstrlen(lvg.pszHeader); + lvg.iGroupId = iGroupId; + InsertGroup(-1, &lvg); } int CCtrlListView::AddItem(TCHAR *text, int iIcon, LPARAM lParam, int iGroupId) @@ -908,7 +894,7 @@ int CCtrlListView::AddItem(TCHAR *text, int iIcon, LPARAM lParam, int iGroupId) lvi.lParam = lParam; - if ((iGroupId >= 0) && IsWinVerXPPlus()) + if ((iGroupId >= 0)) { lvi.mask |= LVIF_GROUPID; lvi.iGroupId = iGroupId; @@ -2126,7 +2112,7 @@ void CCtrlPages::AddPage(TCHAR *ptszName, HICON hIcon, CCallback onCreate, { if ( !m_hIml) { - m_hIml = ImageList_Create(16, 16, IsWinVerXPPlus() ? ILC_COLOR32|ILC_MASK : ILC_COLOR16|ILC_MASK, 0, 1); + m_hIml = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 0, 1); TabCtrl_SetImageList(m_hwnd, m_hIml); } diff --git a/protocols/JabberG/src/ui_utils.h b/protocols/JabberG/src/ui_utils.h index d85d82cb25..49d7daadfd 100644 --- a/protocols/JabberG/src/ui_utils.h +++ b/protocols/JabberG/src/ui_utils.h @@ -324,9 +324,6 @@ private: static INT_PTR CALLBACK GlobalDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); static int GlobalDlgResizer(HWND hwnd, LPARAM lParam, UTILRESIZECONTROL *urc); - - typedef HRESULT (STDAPICALLTYPE *pfnEnableThemeDialogTexture)(HWND,DWORD); - static pfnEnableThemeDialogTexture MyEnableThemeDialogTexture; }; ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/protocols/MRA/src/Mra.h b/protocols/MRA/src/Mra.h index 092126e691..6629845429 100644 --- a/protocols/MRA/src/Mra.h +++ b/protocols/MRA/src/Mra.h @@ -31,7 +31,6 @@ #include #include #include -#include #define bzero(pvDst, count) memset(pvDst, 0, count) -- cgit v1.2.3