diff options
Diffstat (limited to 'plugins/Popup')
-rw-r--r-- | plugins/Popup/Popup_10.vcxproj | 8 | ||||
-rw-r--r-- | plugins/Popup/Popup_11.vcxproj | 8 | ||||
-rw-r--r-- | plugins/Popup/src/actions.cpp | 13 | ||||
-rw-r--r-- | plugins/Popup/src/headers.h | 1 | ||||
-rw-r--r-- | plugins/Popup/src/opt_contacts.cpp | 3 | ||||
-rw-r--r-- | plugins/Popup/src/opt_gen.cpp | 15 | ||||
-rw-r--r-- | plugins/Popup/src/opt_skins.cpp | 6 | ||||
-rw-r--r-- | plugins/Popup/src/popup_wnd2.cpp | 80 |
8 files changed, 55 insertions, 79 deletions
diff --git a/plugins/Popup/Popup_10.vcxproj b/plugins/Popup/Popup_10.vcxproj index 3270d08192..367350020f 100644 --- a/plugins/Popup/Popup_10.vcxproj +++ b/plugins/Popup/Popup_10.vcxproj @@ -85,7 +85,7 @@ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x55550000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -109,7 +109,7 @@ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x55550000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -136,7 +136,7 @@ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x55550000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -166,7 +166,7 @@ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x55550000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
diff --git a/plugins/Popup/Popup_11.vcxproj b/plugins/Popup/Popup_11.vcxproj index 9bd77f9b61..4f34e94fd8 100644 --- a/plugins/Popup/Popup_11.vcxproj +++ b/plugins/Popup/Popup_11.vcxproj @@ -89,7 +89,7 @@ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x55550000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -114,7 +114,7 @@ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x55550000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -141,7 +141,7 @@ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x55550000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@@ -170,7 +170,7 @@ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
</ResourceCompile>
<Link>
- <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>msimg32.lib;gdiplus.lib;comctl32.lib;UxTheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<BaseAddress>0x55550000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
diff --git a/plugins/Popup/src/actions.cpp b/plugins/Popup/src/actions.cpp index 9b5fd8fda8..28b9a781f2 100644 --- a/plugins/Popup/src/actions.cpp +++ b/plugins/Popup/src/actions.cpp @@ -221,7 +221,7 @@ INT_PTR CALLBACK DlgProcPopupActions(HWND hwnd, UINT msg, WPARAM wParam, LPARAM HWND hwndList = GetDlgItem(hwnd, IDC_ACTIONS);
ListView_SetExtendedListViewStyleEx(hwndList, 0, LVS_EX_CHECKBOXES|LVS_EX_LABELTIP);
- HIMAGELIST hImgList = ImageList_Create(16, 16, ILC_MASK | (IsWinVerXPPlus()? ILC_COLOR32 : ILC_COLOR16), 10, 1);
+ HIMAGELIST hImgList = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 10, 1);
ListView_SetImageList(hwndList, hImgList, LVSIL_SMALL);
LVCOLUMN column = {0};
@@ -230,8 +230,7 @@ INT_PTR CALLBACK DlgProcPopupActions(HWND hwnd, UINT msg, WPARAM wParam, LPARAM column.cx = 175;
ListView_InsertColumn(hwndList, 0, &column);
- if (IsWinVerXPPlus())
- ListView_EnableGroupView(hwndList, TRUE);
+ ListView_EnableGroupView(hwndList, TRUE);
LIST<char> groups(1, strcmp);
@@ -244,7 +243,7 @@ INT_PTR CALLBACK DlgProcPopupActions(HWND hwnd, UINT msg, WPARAM wParam, LPARAM int grpId = 0;
- if (IsWinVerXPPlus() && ((grpId = groups.getIndex(szGroup)) < 0))
+ if ((grpId = groups.getIndex(szGroup)) < 0)
{
LVGROUP group = {0};
group.cbSize = sizeof(group);
@@ -265,10 +264,8 @@ INT_PTR CALLBACK DlgProcPopupActions(HWND hwnd, UINT msg, WPARAM wParam, LPARAM item.pszText = TranslateTS(tszName);
item.iImage = ImageList_AddIcon(hImgList, gActions[i]->lchIcon);
item.lParam = i;
- if (IsWinVerXPPlus()) {
- item.mask |= LVIF_GROUPID;
- item.iGroupId = grpId;
- }
+ item.mask |= LVIF_GROUPID;
+ item.iGroupId = grpId;
item.iIndent = 0;
ListView_InsertItemW(hwndList, &item);
diff --git a/plugins/Popup/src/headers.h b/plugins/Popup/src/headers.h index e24116d5b2..9ef40481fd 100644 --- a/plugins/Popup/src/headers.h +++ b/plugins/Popup/src/headers.h @@ -60,6 +60,7 @@ http://miranda-ng.org/distr/ #include <commctrl.h>
#include <shellapi.h>
#include <malloc.h>
+#include <Uxtheme.h>
#include <newpluginapi.h>
#include <win2k.h>
diff --git a/plugins/Popup/src/opt_contacts.cpp b/plugins/Popup/src/opt_contacts.cpp index 3d7f976c1e..da4b535f21 100644 --- a/plugins/Popup/src/opt_contacts.cpp +++ b/plugins/Popup/src/opt_contacts.cpp @@ -37,8 +37,7 @@ INT_PTR CALLBACK DlgProcContactOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l SendMessage(GetDlgItem(hwnd, IDC_ICO_FULLSCREEN), STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_FULLSCREEN,0), 0);
SendMessage(GetDlgItem(hwnd, IDC_ICO_BLOCK), STM_SETICON, (WPARAM)IcoLib_GetIcon(ICO_OPT_BLOCK,0), 0);
{
- HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),
- (IsWinVerXPPlus()?ILC_COLOR32:ILC_COLOR16)|ILC_MASK,5,5);
+ HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 5, 5);
ImageList_AddIcon(hIml, LoadSkinnedIcon(SKINICON_OTHER_SMALLDOT));
ImageList_AddIcon(hIml, IcoLib_GetIcon(ICO_OPT_DEF,0));
ImageList_AddIcon(hIml, IcoLib_GetIcon(ICO_OPT_FAV,0));
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp index 5652e8dc0c..f6287bf1bf 100644 --- a/plugins/Popup/src/opt_gen.cpp +++ b/plugins/Popup/src/opt_gen.cpp @@ -607,19 +607,6 @@ void Check_ReorderPopups(HWND hwnd) { if (hwnd) CheckDlgButton(hwnd, IDC_REORDERPOPUPS, PopupOptions.ReorderPopups);
}
-void ThemeDialogBackground(HWND hwnd)
-{
- if (IsWinVerXPPlus()) {
- static HMODULE hThemeAPI = NULL;
- if (!hThemeAPI) hThemeAPI = GetModuleHandleA("uxtheme");
- if (hThemeAPI) {
- HRESULT (STDAPICALLTYPE *MyEnableThemeDialogTexture)(HWND,DWORD) = (HRESULT (STDAPICALLTYPE*)(HWND,DWORD))GetProcAddress(hThemeAPI,"EnableThemeDialogTexture");
- if (MyEnableThemeDialogTexture)
- MyEnableThemeDialogTexture(hwnd,0x00000002|0x00000004); //0x00000002|0x00000004=ETDT_ENABLETAB
- }
- }
-}
-
INT_PTR CALLBACK PositionBoxDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
LOGFONT lf;
@@ -627,7 +614,7 @@ INT_PTR CALLBACK PositionBoxDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA switch (msg) {
case WM_INITDIALOG:
- ThemeDialogBackground(hwndDlg);
+ EnableThemeDialogTexture(hwndDlg, ETDT_ENABLETAB);
GetObject((HFONT)SendMessage(GetDlgItem(hwndDlg, IDC_TITLE), WM_GETFONT, 0, 0), sizeof(lf), &lf);
lf.lfWeight = FW_BOLD;
diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp index 5b3c656684..b9ad9c726d 100644 --- a/plugins/Popup/src/opt_skins.cpp +++ b/plugins/Popup/src/opt_skins.cpp @@ -34,7 +34,7 @@ void RegisterOptPrevBox() WNDCLASSEX wcl;
wcl.cbSize = sizeof(wcl);
wcl.lpfnWndProc = (WNDPROC)BoxPreviewWndProc;
- wcl.style = IsWinVerXPPlus() ? CS_DROPSHADOW : 0;
+ wcl.style = CS_DROPSHADOW;
wcl.cbClsExtra = 0;
wcl.cbWndExtra = 0;
wcl.hInstance = hInst;
@@ -57,7 +57,7 @@ void RegisterOptPrevBox() GetClassInfoEx(hInst, _T("#32770"), &wcl);
wcl.hInstance = hInst;
wcl.lpszClassName = _T("PopupPlusDlgBox");
- wcl.style |= IsWinVerXPPlus() ? CS_DROPSHADOW : 0;
+ wcl.style |= CS_DROPSHADOW;
g_wndClass.cPopupPlusDlgBox = RegisterClassEx(&wcl);
err = GetLastError();
if (!g_wndClass.cPopupPlusDlgBox) {
@@ -219,12 +219,10 @@ int SkinOptionList_AddMain(OPTTREE_OPTION* &options, int *OptionsCount, int pos, bCheck = PopupOptions.DisplayTime;
break;
case 1:
- if (!IsWinVerXPPlus()) continue;
*dwGlobalOptions |= PopupOptions.DropShadow ? (1 << i) : 0;
bCheck = PopupOptions.DropShadow;
break;
case 2:
- if (!IsWinVerXPPlus()) continue;
*dwGlobalOptions |= PopupOptions.EnableFreeformShadows ? (1 << i) : 0;
bCheck = PopupOptions.EnableFreeformShadows;
break;
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index 1616aa3f4a..f6d493138d 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -76,40 +76,36 @@ bool LoadPopupWnd2() }
// register custom class for edit box with drop-shadow attribute
- if (IsWinVerXPPlus())
- {
-
- #define MyRegisterClassExW RegisterClassExW
- #define MyGetClassInfoExW GetClassInfoExW
-
- WNDCLASSEXW wclw = {0};
- wclw.cbSize = sizeof(wclw);
- if (!MyGetClassInfoExW(NULL, L"EDIT", &wclw))
- MSGERROR(TranslateT("Failed to GetClassInfoExW from EDIT class."));
- wclw.hInstance = hInst;
- wclw.lpszClassName = L"PopupEditBox";
- wclw.style |= CS_DROPSHADOW;
- g_wndClass.cPopupEditBox = MyRegisterClassExW(&wclw);
- err = GetLastError();
- if (!g_wndClass.cPopupEditBox) {
- TCHAR msg[2048];
- mir_sntprintf(msg, SIZEOF(msg), TranslateT("Failed to register custom edit box window class.\r\n\r\ncbSize: %i\r\nstyle: %p\r\nlpfnWndProc: %i\r\ncbClsExtra: %i\r\ncbWndExtra: %i\r\nhInstance: %i\r\nhIcon: %i\r\nhCursor: %i\r\nhbrBackground: %i\r\nlpszMenuName: %s\r\nlpszClassName: %s\r\nhIconSm: %i\r\n"),
- wclw.cbSize, //UINT cbSize;
- wclw.style, //UINT style;
- wclw.lpfnWndProc, //WNDPROC lpfnWndProc;
- wclw.cbClsExtra, //int cbClsExtra;
- wclw.cbWndExtra, //int cbWndExtra;
- wclw.hInstance, //HINSTANCE hInstance;
- wclw.hIcon, //HICON hIcon;
- wclw.hCursor, //HCURSOR hCursor;
- wclw.hbrBackground, //HBRUSH hbrBackground;
- wclw.lpszMenuName, //LPCWSTR lpszMenuName;
- wclw.lpszClassName, //LPCWSTR lpszClassName;
- wclw.hIconSm //HICON hIconSm;
- );
-
- MSGERROR(msg);
- }
+ #define MyRegisterClassExW RegisterClassExW
+ #define MyGetClassInfoExW GetClassInfoExW
+
+ WNDCLASSEXW wclw = {0};
+ wclw.cbSize = sizeof(wclw);
+ if (!MyGetClassInfoExW(NULL, L"EDIT", &wclw))
+ MSGERROR(TranslateT("Failed to GetClassInfoExW from EDIT class."));
+ wclw.hInstance = hInst;
+ wclw.lpszClassName = L"PopupEditBox";
+ wclw.style |= CS_DROPSHADOW;
+ g_wndClass.cPopupEditBox = MyRegisterClassExW(&wclw);
+ err = GetLastError();
+ if (!g_wndClass.cPopupEditBox) {
+ TCHAR msg[2048];
+ mir_sntprintf(msg, SIZEOF(msg), TranslateT("Failed to register custom edit box window class.\r\n\r\ncbSize: %i\r\nstyle: %p\r\nlpfnWndProc: %i\r\ncbClsExtra: %i\r\ncbWndExtra: %i\r\nhInstance: %i\r\nhIcon: %i\r\nhCursor: %i\r\nhbrBackground: %i\r\nlpszMenuName: %s\r\nlpszClassName: %s\r\nhIconSm: %i\r\n"),
+ wclw.cbSize, //UINT cbSize;
+ wclw.style, //UINT style;
+ wclw.lpfnWndProc, //WNDPROC lpfnWndProc;
+ wclw.cbClsExtra, //int cbClsExtra;
+ wclw.cbWndExtra, //int cbWndExtra;
+ wclw.hInstance, //HINSTANCE hInstance;
+ wclw.hIcon, //HICON hIcon;
+ wclw.hCursor, //HCURSOR hCursor;
+ wclw.hbrBackground, //HBRUSH hbrBackground;
+ wclw.lpszMenuName, //LPCWSTR lpszMenuName;
+ wclw.lpszClassName, //LPCWSTR lpszClassName;
+ wclw.hIconSm //HICON hIconSm;
+ );
+
+ MSGERROR(msg);
}
ZeroMemory(&wcl, sizeof(wcl));
@@ -207,15 +203,13 @@ void PopupWnd2::create() (LPVOID)this);
// Shadows
- if (IsWinVerXPPlus()) {
- ULONG_PTR style = GetClassLongPtr(m_hwnd, GCL_STYLE);
- if (m_options->DropShadow && !(style & CS_DROPSHADOW))
- style |= CS_DROPSHADOW;
- else if (!m_options->DropShadow && (style & CS_DROPSHADOW))
- style &= ~CS_DROPSHADOW;
-
- SetClassLongPtr(m_hwnd, GCL_STYLE, style);
- }
+ ULONG_PTR style = GetClassLongPtr(m_hwnd, GCL_STYLE);
+ if (m_options->DropShadow && !(style & CS_DROPSHADOW))
+ style |= CS_DROPSHADOW;
+ else if (!m_options->DropShadow && (style & CS_DROPSHADOW))
+ style &= ~CS_DROPSHADOW;
+
+ SetClassLongPtr(m_hwnd, GCL_STYLE, style);
// tooltips
m_hwndToolTip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, NULL,
|