summaryrefslogtreecommitdiff
path: root/protocols/JabberG
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/JabberG')
-rw-r--r--protocols/JabberG/jabber_10.vcxproj9
-rw-r--r--protocols/JabberG/jabber_11.vcxproj8
-rw-r--r--protocols/JabberG/src/jabber.cpp20
-rw-r--r--protocols/JabberG/src/jabber.h7
-rw-r--r--protocols/JabberG/src/jabber_bookmarks.cpp2
-rw-r--r--protocols/JabberG/src/jabber_captcha.cpp4
-rw-r--r--protocols/JabberG/src/jabber_form.cpp2
-rw-r--r--protocols/JabberG/src/jabber_iqid_muc.cpp11
-rw-r--r--protocols/JabberG/src/jabber_privacy.cpp2
-rw-r--r--protocols/JabberG/src/jabber_secur.cpp17
-rw-r--r--protocols/JabberG/src/jabber_treelist.cpp4
-rw-r--r--protocols/JabberG/src/jabber_userinfo.cpp8
-rw-r--r--protocols/JabberG/src/jabber_vcard.cpp8
-rw-r--r--protocols/JabberG/src/ui_utils.cpp36
-rw-r--r--protocols/JabberG/src/ui_utils.h3
15 files changed, 48 insertions, 93 deletions
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 @@
</ResourceCompile>
<Link>
<AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.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>
@@ -127,7 +127,7 @@
</ResourceCompile>
<Link>
<AdditionalOptions>/PDBALTPATH:%_PDB%</AdditionalOptions>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.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>
@@ -160,7 +160,7 @@
<AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x32500000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -190,7 +190,7 @@
<AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.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>0x32500000</BaseAddress>
@@ -259,6 +259,7 @@
<ClCompile Include="src\ui_utils.cpp" />
</ItemGroup>
<ItemGroup>
+ <ClInclude Include="..\..\include\m_jabber.h" />
<ClInclude Include="src\jabber.h" />
<ClInclude Include="src\jabber_byte.h" />
<ClInclude Include="src\jabber_caps.h" />
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 @@
<AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.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>
@@ -129,7 +129,7 @@
<AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.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>
@@ -162,7 +162,7 @@
<AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x32500000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -193,7 +193,7 @@
<AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>ws2_32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.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>0x32500000</BaseAddress>
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 <commctrl.h>
#include <uxtheme.h>
#include <richedit.h>
+#define SECURITY_WIN32
+#include <Security.h>
#include <ctype.h>
#include <fcntl.h>
@@ -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)&param);
+ /*int res = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_CAPTCHAFORM), NULL, JabberCaptchaFormDlgProc, (LPARAM)&param);
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<void> 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;
};
/////////////////////////////////////////////////////////////////////////////////////////