diff options
Diffstat (limited to 'src/mir_app')
36 files changed, 163 insertions, 186 deletions
diff --git a/src/mir_app/src/DefaultExtraIcons.cpp b/src/mir_app/src/DefaultExtraIcons.cpp index 38b19bc5d1..09ff82aa72 100644 --- a/src/mir_app/src/DefaultExtraIcons.cpp +++ b/src/mir_app/src/DefaultExtraIcons.cpp @@ -57,9 +57,9 @@ static void SetVisibility(MCONTACT hContact, int apparentMode, bool clear) // Not chat
hExtraIcon = hExtraVisibility;
if (apparentMode == ID_STATUS_OFFLINE)
- hIcolib = LoadSkinnedIconHandle(SKINICON_OTHER_INVISIBLE_ALL);
+ hIcolib = Skin_GetIconHandle(SKINICON_OTHER_INVISIBLE_ALL);
else if (apparentMode == ID_STATUS_ONLINE)
- hIcolib = LoadSkinnedIconHandle(SKINICON_OTHER_VISIBLE_ALL);
+ hIcolib = Skin_GetIconHandle(SKINICON_OTHER_VISIBLE_ALL);
}
if (hIcolib != NULL || clear) {
@@ -262,7 +262,7 @@ static ProtoInfo* FindProto(const char *proto) if (p)
return p;
- HICON hIcon = LoadSkinnedProtoIcon(proto, ID_STATUS_ONLINE);
+ HICON hIcon = Skin_LoadProtoIcon(proto, ID_STATUS_ONLINE);
if (hIcon == NULL)
return NULL;
@@ -302,18 +302,18 @@ static int ProtocolOnClick(WPARAM wParam, LPARAM, LPARAM) void DefaultExtraIcons_Load()
{
hExtraChat = ExtraIcon_Register("chat_activity", LPGEN("Chat activity"), "ChatActivity");
- hExtraVisibility = ExtraIcon_Register("visibility", "Visibility", LoadSkinnedIconName(SKINICON_OTHER_VISIBLE_ALL));
+ hExtraVisibility = ExtraIcon_Register("visibility", "Visibility", Skin_GetIconName(SKINICON_OTHER_VISIBLE_ALL));
hExtraGender = ExtraIcon_Register("gender", "Gender", "gender_male");
- hExtraProto = ExtraIcon_Register("protocol", "Account", LoadSkinnedIconName(SKINICON_OTHER_ACCMGR),
+ hExtraProto = ExtraIcon_Register("protocol", "Account", Skin_GetIconName(SKINICON_OTHER_ACCMGR),
&ProtocolRebuildIcons, &ProtocolApplyIcon, &ProtocolOnClick);
for (int i = 0; i < SIZEOF(infos); i++) {
Info &p = infos[i];
- p.hIcolib = LoadSkinnedIconHandle(p.iSkinIcon);
+ p.hIcolib = Skin_GetIconHandle(p.iSkinIcon);
if (p.OnClick)
- p.hExtraIcon = ExtraIcon_Register(p.name, p.desc, LoadSkinnedIconName(p.iSkinIcon), DefaultOnClick, (LPARAM)&p);
+ p.hExtraIcon = ExtraIcon_Register(p.name, p.desc, Skin_GetIconName(p.iSkinIcon), DefaultOnClick, (LPARAM)&p);
else
- p.hExtraIcon = ExtraIcon_Register(p.name, p.desc, LoadSkinnedIconName(p.iSkinIcon));
+ p.hExtraIcon = ExtraIcon_Register(p.name, p.desc, Skin_GetIconName(p.iSkinIcon));
}
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
diff --git a/src/mir_app/src/FontOptions.cpp b/src/mir_app/src/FontOptions.cpp index 982fb25e2e..32d76d2db8 100644 --- a/src/mir_app/src/FontOptions.cpp +++ b/src/mir_app/src/FontOptions.cpp @@ -1353,7 +1353,7 @@ int FontsModernOptInit(WPARAM wParam, LPARAM) MODERNOPTOBJECT obj = {0};
obj.cbSize = sizeof(obj);
obj.dwFlags = MODEROPT_FLG_TCHAR|MODEROPT_FLG_NORESIZE;
- obj.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ obj.hIcon = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
obj.hInstance = g_hInst;
obj.iSection = MODERNOPT_PAGE_SKINS;
obj.iType = MODERNOPT_TYPE_SUBSECTIONPAGE;
diff --git a/src/mir_app/src/IcoLib.h b/src/mir_app/src/IcoLib.h index 2253ec963e..02667beba2 100644 --- a/src/mir_app/src/IcoLib.h +++ b/src/mir_app/src/IcoLib.h @@ -86,9 +86,9 @@ UINT _ExtractIconEx(LPCTSTR lpszFile, int iconIndex, int cxIcon, int cyIcon, HIC void __fastcall SAFE_FREE(void** p);
void __fastcall SafeDestroyIcon(HICON* icon);
-int IconSourceItem_Release(IconSourceItem** pitem);
-int IconSourceItem_ReleaseIcon(IconSourceItem* item);
-HICON IconSourceItem_GetIcon(IconSourceItem* item);
+int IconSourceItem_Release(IconSourceItem* &pitem);
+int IconSourceItem_ReleaseIcon(IconSourceItem *item);
+HICON IconSourceItem_GetIcon(IconSourceItem *item);
IconSourceItem* GetIconSourceItem(const TCHAR* file, int indx, int cxIcon, int cyIcon);
IcolibItem* IcoLib_FindHIcon(HICON hIcon, bool &big);
diff --git a/src/mir_app/src/button.cpp b/src/mir_app/src/button.cpp index 0c8648f485..b17e29d751 100644 --- a/src/mir_app/src/button.cpp +++ b/src/mir_app/src/button.cpp @@ -169,19 +169,17 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint) int textLen = GetWindowTextLength(ctl->hwnd);
if (ctl->hIcon) {
- LONG g_cxsmIcon = GetSystemMetrics(SM_CXSMICON);
- LONG g_cysmIcon = GetSystemMetrics(SM_CYSMICON);
- int ix = (rcClient.right-rcClient.left)/2 - (g_cxsmIcon/2);
- int iy = (rcClient.bottom-rcClient.top)/2 - (g_cysmIcon/2);
+ int ix = (rcClient.right-rcClient.left)/2 - (g_iIconSX/2);
+ int iy = (rcClient.bottom-rcClient.top)/2 - (g_iIconSY/2);
if (ctl->stateId == PBS_PRESSED) {
ix++;
iy++;
}
- HIMAGELIST hImageList = ImageList_Create(g_cxsmIcon, g_cysmIcon, ILC_MASK | ILC_COLOR32, 1, 0);
+ HIMAGELIST hImageList = ImageList_Create(g_iIconSX, g_iIconSY, ILC_MASK | ILC_COLOR32, 1, 0);
ImageList_AddIcon(hImageList, ctl->hIcon);
HICON hIconNew = ImageList_GetIcon(hImageList, 0, ILD_NORMAL);
- DrawState(hdcMem, NULL, NULL, (LPARAM) hIconNew, 0, ix, iy, g_cxsmIcon, g_cysmIcon, DST_ICON | (IsWindowEnabled(ctl->hwnd) ? DSS_NORMAL : DSS_DISABLED));
+ DrawState(hdcMem, NULL, NULL, (LPARAM) hIconNew, 0, ix, iy, g_iIconSX, g_iIconSY, DST_ICON | (IsWindowEnabled(ctl->hwnd) ? DSS_NORMAL : DSS_DISABLED));
ImageList_RemoveAll(hImageList);
ImageList_Destroy(hImageList);
DestroyIcon(hIconNew);
@@ -220,7 +218,7 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint) sz.cx -= szHot.cx;
}
if (ctl->arrow)
- DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->arrow, 0, rcClient.right-rcClient.left-5-GetSystemMetrics(SM_CXSMICON)+(!ctl->hThemeButton && ctl->stateId == PBS_PRESSED?1:0), (rcClient.bottom-rcClient.top)/2-GetSystemMetrics(SM_CYSMICON)/2+(!ctl->hThemeButton && ctl->stateId == PBS_PRESSED?1:0), GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), IsWindowEnabled(ctl->hwnd)?DST_ICON:DST_ICON|DSS_DISABLED);
+ DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->arrow, 0, rcClient.right-rcClient.left-5-g_iIconSX+(!ctl->hThemeButton && ctl->stateId == PBS_PRESSED?1:0), (rcClient.bottom-rcClient.top)/2-g_iIconSY/2+(!ctl->hThemeButton && ctl->stateId == PBS_PRESSED?1:0), g_iIconSX, g_iIconSY, IsWindowEnabled(ctl->hwnd)?DST_ICON:DST_ICON|DSS_DISABLED);
SelectObject(hdcMem, ctl->hFont);
DrawState(hdcMem, NULL, NULL, (LPARAM)szText, 0,
@@ -425,7 +423,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR case BUTTONSETARROW: // turn arrow on/off
if (wParam) {
if (!bct->arrow) {
- bct->arrow = LoadSkinIcon(SKINICON_OTHER_DOWNARROW);
+ bct->arrow = Skin_LoadIcon(SKINICON_OTHER_DOWNARROW);
SetHwndPropInt(bct, OBJID_CLIENT, CHILDID_SELF, PROPID_ACC_ROLE, ROLE_SYSTEM_BUTTONDROPDOWN);
}
}
diff --git a/src/mir_app/src/chat_svc.cpp b/src/mir_app/src/chat_svc.cpp index 5d56b3729b..8aee7e22cc 100644 --- a/src/mir_app/src/chat_svc.cpp +++ b/src/mir_app/src/chat_svc.cpp @@ -563,13 +563,13 @@ static int ModulesLoaded(WPARAM, LPARAM) CLISTMENUITEM mi = { sizeof(mi) }; mi.position = -2000090001; mi.flags = CMIF_DEFAULT; - mi.icolibItem = LoadSkinnedIconHandle(SKINICON_CHAT_JOIN); + mi.icolibItem = Skin_GetIconHandle(SKINICON_CHAT_JOIN); mi.pszName = LPGEN("&Join chat"); mi.pszService = "GChat/JoinChat"; hJoinMenuItem = Menu_AddContactMenuItem(&mi); mi.position = -2000090000; - mi.icolibItem = LoadSkinnedIconHandle(SKINICON_CHAT_LEAVE); + mi.icolibItem = Skin_GetIconHandle(SKINICON_CHAT_LEAVE); mi.flags = CMIF_NOTOFFLINE; mi.pszName = LPGEN("&Leave chat"); mi.pszService = "GChat/LeaveChat"; diff --git a/src/mir_app/src/chat_tools.cpp b/src/mir_app/src/chat_tools.cpp index a19bff68d9..9d7936f926 100644 --- a/src/mir_app/src/chat_tools.cpp +++ b/src/mir_app/src/chat_tools.cpp @@ -85,7 +85,7 @@ BOOL DoTrayIcon(SESSION_INFO *si, GCEVENT *gce) switch (gce->pDest->iType) {
case GC_EVENT_MESSAGE | GC_EVENT_HIGHLIGHT:
case GC_EVENT_ACTION | GC_EVENT_HIGHLIGHT:
- ci.AddEvent(si->hContact, LoadSkinnedIcon(SKINICON_EVENT_MESSAGE), GC_FAKE_EVENT, 0, TranslateT("%s wants your attention in %s"), gce->ptszNick, si->ptszName);
+ ci.AddEvent(si->hContact, Skin_LoadIcon(SKINICON_EVENT_MESSAGE), GC_FAKE_EVENT, 0, TranslateT("%s wants your attention in %s"), gce->ptszNick, si->ptszName);
break;
case GC_EVENT_MESSAGE:
ci.AddEvent(si->hContact, ci.hIcons[ICON_MESSAGE], GC_FAKE_EVENT, CLEF_ONLYAFEW, TranslateT("%s speaks in %s"), gce->ptszNick, si->ptszName);
@@ -213,10 +213,10 @@ BOOL DoPopup(SESSION_INFO *si, GCEVENT *gce) {
switch (gce->pDest->iType) {
case GC_EVENT_MESSAGE | GC_EVENT_HIGHLIGHT:
- ci.ShowPopup(si->hContact, si, LoadSkinnedIcon(SKINICON_EVENT_MESSAGE), si->pszModule, si->ptszName, ci.aFonts[16].color, TranslateT("%s says: %s"), gce->ptszNick, RemoveFormatting(gce->ptszText));
+ ci.ShowPopup(si->hContact, si, Skin_LoadIcon(SKINICON_EVENT_MESSAGE), si->pszModule, si->ptszName, ci.aFonts[16].color, TranslateT("%s says: %s"), gce->ptszNick, RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_ACTION | GC_EVENT_HIGHLIGHT:
- ci.ShowPopup(si->hContact, si, LoadSkinnedIcon(SKINICON_EVENT_MESSAGE), si->pszModule, si->ptszName, ci.aFonts[16].color, _T("%s %s"), gce->ptszNick, RemoveFormatting(gce->ptszText));
+ ci.ShowPopup(si->hContact, si, Skin_LoadIcon(SKINICON_EVENT_MESSAGE), si->pszModule, si->ptszName, ci.aFonts[16].color, _T("%s %s"), gce->ptszNick, RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_MESSAGE:
ci.ShowPopup(si->hContact, si, ci.hIcons[ICON_MESSAGE], si->pszModule, si->ptszName, ci.aFonts[9].color, TranslateT("%s says: %s"), gce->ptszNick, RemoveFormatting(gce->ptszText));
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index e677c7c6e3..75e0496fce 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -218,8 +218,8 @@ int LoadCLCModule(void) {
bModuleInitialized = true;
- g_IconWidth = GetSystemMetrics(SM_CXSMICON);
- g_IconHeight = GetSystemMetrics(SM_CYSMICON);
+ g_IconWidth = g_iIconSX;
+ g_IconHeight = g_iIconSY;
hClcWindowList = WindowList_Create();
hShowInfoTipEvent = CreateHookableEvent(ME_CLC_SHOWINFOTIP);
diff --git a/src/mir_app/src/clistmenus.cpp b/src/mir_app/src/clistmenus.cpp index 9581c128c3..a69c594fdf 100644 --- a/src/mir_app/src/clistmenus.cpp +++ b/src/mir_app/src/clistmenus.cpp @@ -502,7 +502,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM) curProtoStatus = 0;
if (curProtoStatus >= ID_STATUS_OFFLINE && curProtoStatus < ID_STATUS_IDLE)
- timi->mi.hIcon = LoadSkinProtoIcon(prot, curProtoStatus);
+ timi->mi.hIcon = Skin_LoadProtoIcon(prot, curProtoStatus);
else {
timi->mi.hIcon = (HICON)CallProtoServiceInt(NULL, prot, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0);
if (timi->mi.hIcon == (HICON)CALLSERVICE_NOTFOUND)
@@ -921,7 +921,7 @@ void RebuildMenuOrder(void) tmi.root = rootmenu;
tmi.position = pos++;
tmi.ptszName = cli.pfnGetStatusModeDescription(statusModeList[j], GSMDF_UNTRANSLATED);
- tmi.hIcon = LoadSkinProtoIcon(pa->szModuleName, statusModeList[j]);
+ tmi.hIcon = Skin_LoadProtoIcon(pa->szModuleName, statusModeList[j]);
// owner data
StatusMenuExecParam *smep = (StatusMenuExecParam*)mir_calloc(sizeof(StatusMenuExecParam));
@@ -962,7 +962,7 @@ void RebuildMenuOrder(void) if (statusModeList[j] == ID_STATUS_OFFLINE)
tmi.flags |= CMIF_CHECKED;
- tmi.hIcon = LoadSkinIcon(skinIconStatusList[j]);
+ tmi.hIcon = Skin_LoadIcon(skinIconStatusList[j]);
tmi.position = pos++;
tmi.hotKey = MAKELPARAM(MOD_CONTROL, '0' + j);
@@ -1323,7 +1323,7 @@ void InitCustomMenus(void) mi.position = 0x7fffffff;
mi.pszService = "CloseAction";
mi.pszName = LPGEN("E&xit");
- mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_EXIT);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_EXIT);
AddMainMenuItem(0, (LPARAM)&mi);
cli.currentStatusMenuItem = ID_STATUS_OFFLINE;
diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp index a2c1aae495..b124fffe8f 100644 --- a/src/mir_app/src/clistmod.cpp +++ b/src/mir_app/src/clistmod.cpp @@ -269,12 +269,12 @@ static int CListIconsChanged(WPARAM, LPARAM) int i, j;
for (i=0; i < SIZEOF(statusModeList); i++)
- ImageList_ReplaceIcon_IconLibLoaded(hCListImages, i + 1, LoadSkinIcon(skinIconStatusList[i]));
- ImageList_ReplaceIcon_IconLibLoaded(hCListImages, IMAGE_GROUPOPEN, LoadSkinIcon(SKINICON_OTHER_GROUPOPEN));
- ImageList_ReplaceIcon_IconLibLoaded(hCListImages, IMAGE_GROUPSHUT, LoadSkinIcon(SKINICON_OTHER_GROUPSHUT));
+ ImageList_ReplaceIcon_IconLibLoaded(hCListImages, i + 1, Skin_LoadIcon(skinIconStatusList[i]));
+ ImageList_ReplaceIcon_IconLibLoaded(hCListImages, IMAGE_GROUPOPEN, Skin_LoadIcon(SKINICON_OTHER_GROUPOPEN));
+ ImageList_ReplaceIcon_IconLibLoaded(hCListImages, IMAGE_GROUPSHUT, Skin_LoadIcon(SKINICON_OTHER_GROUPSHUT));
for (i=0; i < protoIconIndex.getCount(); i++)
for (j = 0; j < SIZEOF(statusModeList); j++)
- ImageList_ReplaceIcon_IconLibLoaded(hCListImages, protoIconIndex[i].iIconBase + j, LoadSkinProtoIcon(protoIconIndex[i].szProto, statusModeList[j]));
+ ImageList_ReplaceIcon_IconLibLoaded(hCListImages, protoIconIndex[i].iIconBase + j, Skin_LoadProtoIcon(protoIconIndex[i].szProto, statusModeList[j]));
cli.pfnTrayIconIconsChanged();
cli.pfnInvalidateRect(cli.hwndContactList, NULL, TRUE);
return 0;
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 42f231e425..0ee56992a9 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -270,12 +270,12 @@ int LoadCLUIModule(void) wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = cli.hInst;
- wndclass.hIcon = LoadSkinIcon(SKINICON_OTHER_MIRANDA, true);
+ wndclass.hIcon = Skin_LoadIcon(SKINICON_OTHER_MIRANDA, true);
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH) (COLOR_3DFACE + 1);
wndclass.lpszMenuName = MAKEINTRESOURCE(IDR_CLISTMENU);
wndclass.lpszClassName = _T(MIRANDACLASS);
- wndclass.hIconSm = LoadSkinIcon(SKINICON_OTHER_MIRANDA);
+ wndclass.hIconSm = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
RegisterClassEx(&wndclass);
if (db_get_ts(NULL, "CList", "TitleText", &dbv))
@@ -329,14 +329,14 @@ int LoadCLUIModule(void) CreateServiceFunction("CList/DeleteContactCommand", MenuItem_DeleteContact);
mi.position = 2000070000;
- mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_DELETE);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_DELETE);
mi.pszName = LPGEN("De&lete");
mi.pszService = "CList/DeleteContactCommand";
Menu_AddContactMenuItem(&mi);
CreateServiceFunction("CList/RenameContactCommand", MenuItem_RenameContact);
mi.position = 2000050000;
- mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_RENAME);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_RENAME);
mi.pszName = LPGEN("&Rename");
mi.pszService = "CList/RenameContactCommand";
hRenameMenuItem = Menu_AddContactMenuItem(&mi);
@@ -344,7 +344,7 @@ int LoadCLUIModule(void) CreateServiceFunction("CList/AddToListContactCommand", MenuItem_AddContactToList);
mi.position = -2050000000;
mi.flags |= CMIF_NOTONLIST;
- mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_ADDCONTACT);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_ADDCONTACT);
mi.pszName = LPGEN("&Add permanently to list");
mi.pszService = "CList/AddToListContactCommand";
Menu_AddContactMenuItem(&mi);
@@ -982,12 +982,12 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM SetBkMode(dis->hDC, TRANSPARENT);
x = dis->rcItem.left;
if (showOpts & 1) {
- HICON hIcon = LoadSkinProtoIcon(szProto, status);
+ HICON hIcon = Skin_LoadProtoIcon(szProto, status);
DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - g_IconHeight) >> 1, hIcon,
g_IconWidth, g_IconHeight, 0, NULL, DI_NORMAL);
IcoLib_ReleaseIcon(hIcon);
if (Proto_IsAccountLocked(Proto_GetAccount(szProto))) {
- hIcon = LoadSkinnedIcon(SKINICON_OTHER_STATUS_LOCKED);
+ hIcon = Skin_LoadIcon(SKINICON_OTHER_STATUS_LOCKED);
if (hIcon != NULL) {
DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - g_IconHeight) >> 1, hIcon,
g_IconWidth, g_IconHeight, 0, NULL, DI_NORMAL);
@@ -1021,7 +1021,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM }
else if (dis->CtlType == ODT_MENU) {
if (dis->itemData == MENU_MIRANDAMENU) {
- HICON hIcon = LoadSkinnedIcon(SKINICON_OTHER_MAINMENU);
+ HICON hIcon = Skin_LoadIcon(SKINICON_OTHER_MAINMENU);
fnDrawMenuItem(dis, CopyIcon(hIcon), NULL);
IcoLib_ReleaseIcon(hIcon);
return TRUE;
diff --git a/src/mir_app/src/dbutils.cpp b/src/mir_app/src/dbutils.cpp index 02a6821b7d..18e6bac54f 100644 --- a/src/mir_app/src/dbutils.cpp +++ b/src/mir_app/src/dbutils.cpp @@ -223,15 +223,15 @@ static INT_PTR DbEventGetIcon(WPARAM wParam, LPARAM lParam) if (!icon) {
switch(dbei->eventType) {
case EVENTTYPE_URL:
- icon = LoadSkinIcon(SKINICON_EVENT_URL);
+ icon = Skin_LoadIcon(SKINICON_EVENT_URL);
break;
case EVENTTYPE_FILE:
- icon = LoadSkinIcon(SKINICON_EVENT_FILE);
+ icon = Skin_LoadIcon(SKINICON_EVENT_FILE);
break;
default: // EVENTTYPE_MESSAGE and unknown types
- icon = LoadSkinIcon(SKINICON_EVENT_MESSAGE);
+ icon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
break;
}
}
diff --git a/src/mir_app/src/enterstring.cpp b/src/mir_app/src/enterstring.cpp index 4e76e94a6e..4179741bbb 100644 --- a/src/mir_app/src/enterstring.cpp +++ b/src/mir_app/src/enterstring.cpp @@ -94,8 +94,8 @@ static INT_PTR CALLBACK sttEnterStringDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinnedIconBig(SKINICON_OTHER_RENAME));
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadSkinnedIcon(SKINICON_OTHER_RENAME));
+ SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_LoadIcon(SKINICON_OTHER_RENAME, true));
+ SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)Skin_LoadIcon(SKINICON_OTHER_RENAME, false));
params = (EnterStringFormParam *)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)params);
SetWindowText(hwndDlg, params->caption);
diff --git a/src/mir_app/src/extracticon.cpp b/src/mir_app/src/extracticon.cpp index cfd2ed22db..3d9ccfcb29 100644 --- a/src/mir_app/src/extracticon.cpp +++ b/src/mir_app/src/extracticon.cpp @@ -236,25 +236,24 @@ UINT _ExtractFromICO(LPCTSTR pFileName, int iconIndex, int cxIcon, int cyIcon, H UINT _ExtractIconEx(LPCTSTR lpszFile, int iconIndex, int cxIcon, int cyIcon, HICON *phicon, UINT flags)
{
- HANDLE hFile;
- WORD magic[6];
- DWORD read = 0;
UINT res = 0;
-
- if (cxIcon == GetSystemMetrics(SM_CXICON) && cyIcon == GetSystemMetrics(SM_CYICON))
+ if (cxIcon == g_iIconX && cyIcon == g_iIconY)
res = ExtractIconEx(lpszFile, iconIndex, phicon, NULL, 1);
- else if (cxIcon == GetSystemMetrics(SM_CXSMICON) && cyIcon == GetSystemMetrics(SM_CYSMICON))
+ else if (cxIcon == g_iIconSX && cyIcon == g_iIconSY)
res = ExtractIconEx(lpszFile, iconIndex, NULL, phicon, 1);
else if (cxIcon == 0 || cyIcon == 0)
res = ExtractIconEx(lpszFile, iconIndex, NULL, phicon, 1);
// check if the api succeded, if not try our method too
- if (res) return res;
+ if (res)
+ return res;
- hFile = CreateFile(lpszFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+ HANDLE hFile = CreateFile(lpszFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if (hFile == INVALID_HANDLE_VALUE)
return 0;
// failed to read file signature
+ DWORD read = 0;
+ WORD magic[6];
if (!ReadFile(hFile, &magic, sizeof(magic), &read, NULL) || (read != sizeof(magic))) {
CloseHandle(hFile);
return 0;
@@ -273,7 +272,6 @@ UINT _ExtractIconEx(LPCTSTR lpszFile, int iconIndex, int cxIcon, int cyIcon, HIC case MAGIC_ICON:
if ((magic[1] == MAGIC_ICO1 || magic[1] == MAGIC_CUR) && magic[2] >= 1)
res = _ExtractFromICO(lpszFile, iconIndex, cxIcon, cyIcon, phicon, flags);
-
break;
}
diff --git a/src/mir_app/src/extraicons.cpp b/src/mir_app/src/extraicons.cpp index 32008087ef..820ee03900 100644 --- a/src/mir_app/src/extraicons.cpp +++ b/src/mir_app/src/extraicons.cpp @@ -303,7 +303,7 @@ void fnReloadExtraIcons() if (hExtraImageList)
ImageList_Destroy(hExtraImageList);
- hExtraImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 1, 256);
+ hExtraImageList = ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 1, 256);
SendMessage(cli.hwndContactTree, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hExtraImageList);
SendMessage(cli.hwndContactTree, CLM_SETEXTRACOLUMNS, EXTRA_ICON_COUNT, 0);
diff --git a/src/mir_app/src/findadd.cpp b/src/mir_app/src/findadd.cpp index e1fa64a9b5..b1d470eacd 100644 --- a/src/mir_app/src/findadd.cpp +++ b/src/mir_app/src/findadd.cpp @@ -379,7 +379,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (caps & PF1_ANYSEARCH) netProtoCount++; } - dat->himlComboIcons = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, netProtoCount + 1, netProtoCount + 1); + dat->himlComboIcons = ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, netProtoCount + 1, netProtoCount + 1); SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CBEM_SETIMAGELIST, 0, (LPARAM)dat->himlComboIcons); COMBOBOXEXITEM cbei; @@ -1037,7 +1037,7 @@ int LoadFindAddModule(void) CLISTMENUITEM mi = { sizeof(mi) }; mi.position = 500020000; - mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_FINDUSER); + mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_FINDUSER); mi.pszName = LPGEN("&Find/add contacts..."); mi.pszService = MS_FINDADD_FINDADD; hMainMenuItem = Menu_AddMainMenuItem(&mi); diff --git a/src/mir_app/src/genmenu.cpp b/src/mir_app/src/genmenu.cpp index 41ecec5c04..3246544f40 100644 --- a/src/mir_app/src/genmenu.cpp +++ b/src/mir_app/src/genmenu.cpp @@ -131,8 +131,8 @@ int MO_MeasureMenuItem(LPMEASUREITEMSTRUCT mis) if (pimi->iconId == -1)
return FALSE;
- mis->itemWidth = max(0, GetSystemMetrics(SM_CXSMICON) - GetSystemMetrics(SM_CXMENUCHECK) + 4);
- mis->itemHeight = GetSystemMetrics(SM_CYSMICON) + 2;
+ mis->itemWidth = max(0, g_iIconSX - GetSystemMetrics(SM_CXMENUCHECK) + 4);
+ mis->itemHeight = g_iIconSY + 2;
return TRUE;
}
@@ -154,12 +154,12 @@ int MO_DrawMenuItem(LPDRAWITEMSTRUCT dis) if (pimi == NULL || pimi->iconId == -1)
return FALSE;
- int y = (dis->rcItem.bottom - dis->rcItem.top - GetSystemMetrics(SM_CYSMICON)) / 2 + 1;
+ int y = (dis->rcItem.bottom - dis->rcItem.top - g_iIconSY) / 2 + 1;
if (dis->itemState & ODS_SELECTED) {
if (dis->itemState & ODS_CHECKED) {
RECT rc;
- rc.left = 2; rc.right = GetSystemMetrics(SM_CXSMICON) + 2;
- rc.top = y; rc.bottom = rc.top + GetSystemMetrics(SM_CYSMICON) + 2;
+ rc.left = 2; rc.right = g_iIconSX + 2;
+ rc.top = y; rc.bottom = rc.top + g_iIconSY + 2;
FillRect(dis->hDC, &rc, GetSysColorBrush(COLOR_HIGHLIGHT));
ImageList_DrawEx(pimi->parent->m_hMenuIcons, pimi->iconId, dis->hDC, 2, y, 0, 0, CLR_NONE, CLR_DEFAULT, ILD_SELECTED);
}
@@ -168,8 +168,8 @@ int MO_DrawMenuItem(LPDRAWITEMSTRUCT dis) else {
if (dis->itemState & ODS_CHECKED) {
RECT rc;
- rc.left = 0; rc.right = GetSystemMetrics(SM_CXSMICON) + 4;
- rc.top = y - 2; rc.bottom = rc.top + GetSystemMetrics(SM_CYSMICON) + 4;
+ rc.left = 0; rc.right = g_iIconSX + 4;
+ rc.top = y - 2; rc.bottom = rc.top + g_iIconSY + 4;
DrawEdge(dis->hDC, &rc, BDR_SUNKENOUTER, BF_RECT);
InflateRect(&rc, -1, -1);
COLORREF menuCol = GetSysColor(COLOR_MENU);
@@ -525,7 +525,7 @@ INT_PTR MO_CreateNewMenuObject(WPARAM wParam, LPARAM lParam) p->ptszDisplayName = mir_a2t(LPCSTR(wParam));
p->CheckService = mir_strdup(pmp->CheckService);
p->ExecService = mir_strdup(pmp->ExecService);
- p->m_hMenuIcons = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 15, 100);
+ p->m_hMenuIcons = ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 15, 100);
g_menus.insert(p);
return p->id;
}
diff --git a/src/mir_app/src/genmenuopt.cpp b/src/mir_app/src/genmenuopt.cpp index 8a1cbf497c..424488d4ea 100644 --- a/src/mir_app/src/genmenuopt.cpp +++ b/src/mir_app/src/genmenuopt.cpp @@ -296,7 +296,7 @@ public: { iInitMenuValue = db_get_b(NULL, "CList", "MoveProtoMenus", TRUE); - HIMAGELIST himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 2, 2); + HIMAGELIST himlCheckBoxes = ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 2, 2); ImageList_AddIcon_IconLibLoaded(himlCheckBoxes, SKINICON_OTHER_NOTICK); ImageList_AddIcon_IconLibLoaded(himlCheckBoxes, SKINICON_OTHER_TICK); m_menuItems.SetImageList(himlCheckBoxes, TVSIL_NORMAL); diff --git a/src/mir_app/src/headerbar.cpp b/src/mir_app/src/headerbar.cpp index b321a7853b..316f085ca0 100644 --- a/src/mir_app/src/headerbar.cpp +++ b/src/mir_app/src/headerbar.cpp @@ -197,7 +197,7 @@ static LRESULT MHeaderbar_OnPaint(HWND hwndDlg, MHeaderbarCtrl *mit) textRect.left = 50;
textRect.right = mit->width;
textRect.top = 2 + iTopSpace;
- textRect.bottom = GetSystemMetrics(SM_CYICON) - 2 + iTopSpace;
+ textRect.bottom = g_iIconY - 2 + iTopSpace;
if (IsAeroMode()) {
DTTOPTS dto = { 0 };
diff --git a/src/mir_app/src/hotkey_opts.cpp b/src/mir_app/src/hotkey_opts.cpp index 8224fd7ee0..cd7d542a7e 100644 --- a/src/mir_app/src/hotkey_opts.cpp +++ b/src/mir_app/src/hotkey_opts.cpp @@ -487,19 +487,19 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, { RECT rc; GetClientRect(hwndHotkey, &rc); - colWidth = rc.right - GetSystemMetrics(SM_CXHTHUMB) - 3 * GetSystemMetrics(SM_CXSMICON) - 5; + colWidth = rc.right - GetSystemMetrics(SM_CXHTHUMB) - 3 * g_iIconSX - 5; LVCOLUMN lvc; lvc.mask = LVCF_WIDTH; lvc.cx = colWidth * 2 / 3; ListView_InsertColumn(hwndHotkey, COL_NAME, &lvc); - lvc.cx = GetSystemMetrics(SM_CXSMICON); + lvc.cx = g_iIconSX; ListView_InsertColumn(hwndHotkey, COL_TYPE, &lvc); lvc.cx = colWidth / 3; ListView_InsertColumn(hwndHotkey, COL_KEY, &lvc); - lvc.cx = GetSystemMetrics(SM_CXSMICON); + lvc.cx = g_iIconSX; ListView_InsertColumn(hwndHotkey, COL_RESET, &lvc); - lvc.cx = GetSystemMetrics(SM_CXSMICON); + lvc.cx = g_iIconSX; ListView_InsertColumn(hwndHotkey, COL_ADDREMOVE, &lvc); for (int i = 0; i < hotkeys.getCount(); i++) { diff --git a/src/mir_app/src/icolib.cpp b/src/mir_app/src/icolib.cpp index eb85a2ebd9..ad35eb3509 100644 --- a/src/mir_app/src/icolib.cpp +++ b/src/mir_app/src/icolib.cpp @@ -382,25 +382,24 @@ IconSourceItem* CreateStaticIconSourceItem(int cxIcon, int cyIcon) return newItem;
}
-int IconSourceItem_Release(IconSourceItem** pitem)
+int IconSourceItem_Release(IconSourceItem* &pitem)
{
- if (pitem && *pitem && (*pitem)->ref_count) {
- IconSourceItem* item = *pitem;
- item->ref_count--;
- if (!item->ref_count) {
- int indx;
- if ((indx = iconSourceList.getIndex(item)) != -1) {
- IconSourceFile_Release(&item->file);
- SafeDestroyIcon(&item->icon);
- SAFE_FREE((void**)&item->icon_data);
- iconSourceList.remove(indx);
- SAFE_FREE((void**)&item);
- }
+ if (pitem == NULL || pitem->ref_count == 0)
+ return 1;
+
+ pitem->ref_count--;
+ if (!pitem->ref_count) {
+ int indx;
+ if ((indx = iconSourceList.getIndex(pitem)) != -1) {
+ IconSourceFile_Release(&pitem->file);
+ SafeDestroyIcon(&pitem->icon);
+ SAFE_FREE((void**)&pitem->icon_data);
+ iconSourceList.remove(indx);
+ SAFE_FREE((void**)&pitem);
}
- *pitem = NULL;
- return 0;
}
- return 1;
+ pitem = NULL;
+ return 0;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -485,9 +484,9 @@ static void IcoLib_FreeIcon(IcolibItem* icon) IcoLib_RemoveSection(icon->section);
icon->section = NULL;
}
- IconSourceItem_Release(&icon->source_small);
- IconSourceItem_Release(&icon->source_big);
- IconSourceItem_Release(&icon->default_icon);
+ IconSourceItem_Release(icon->source_small);
+ IconSourceItem_Release(icon->source_big);
+ IconSourceItem_Release(icon->default_icon);
SafeDestroyIcon(&icon->temp_icon);
}
@@ -549,11 +548,11 @@ MIR_APP_DLL(HANDLE) IcoLib_AddIcon(SKINICONDESC *sid, int hLangpack) item->default_icon->ref_count++;
}
else {
- int cx = item->cx ? item->cx : GetSystemMetrics(SM_CXSMICON);
- int cy = item->cy ? item->cy : GetSystemMetrics(SM_CYSMICON);
+ int cx = item->cx ? item->cx : g_iIconSX;
+ int cy = item->cy ? item->cy : g_iIconSY;
item->default_icon = CreateStaticIconSourceItem(cx, cy);
if (GetIconData(sid->hDefaultIcon, &item->default_icon->icon_data, &item->default_icon->icon_size))
- IconSourceItem_Release(&item->default_icon);
+ IconSourceItem_Release(item->default_icon);
}
}
@@ -655,41 +654,39 @@ HICON IconItem_GetDefaultIcon(IcolibItem* item, bool big) HICON hIcon = NULL;
if (item->default_icon && !big) {
- IconSourceItem_Release(&item->source_small);
+ IconSourceItem_Release(item->source_small);
item->source_small = item->default_icon;
item->source_small->ref_count++;
hIcon = IconSourceItem_GetIcon(item->source_small);
}
if (!hIcon && item->default_file) {
- int cx = item->cx ? item->cx : GetSystemMetrics(big ? SM_CXICON : SM_CXSMICON);
- int cy = item->cy ? item->cy : GetSystemMetrics(big ? SM_CYICON : SM_CYSMICON);
- IconSourceItem* def_icon = GetIconSourceItem(item->default_file, item->default_indx, cx, cy);
+ int cx = item->cx ? item->cx : (big ? g_iIconX : g_iIconSX);
+ int cy = item->cy ? item->cy : (big ? g_iIconY : g_iIconSY);
+ IconSourceItem *def_icon = GetIconSourceItem(item->default_file, item->default_indx, cx, cy);
if (big) {
if (def_icon != item->source_big) {
- IconSourceItem_Release(&item->source_big);
+ IconSourceItem_Release(item->source_big);
item->source_big = def_icon;
if (def_icon) {
def_icon->ref_count++;
hIcon = IconSourceItem_GetIcon(def_icon);
}
}
- else
- IconSourceItem_Release(&def_icon);
+ else IconSourceItem_Release(def_icon);
}
else {
if (def_icon != item->default_icon) {
- IconSourceItem_Release(&item->default_icon);
+ IconSourceItem_Release(item->default_icon);
item->default_icon = def_icon;
if (def_icon) {
- IconSourceItem_Release(&item->source_small);
+ IconSourceItem_Release(item->source_small);
item->source_small = def_icon;
def_icon->ref_count++;
hIcon = IconSourceItem_GetIcon(def_icon);
}
}
- else
- IconSourceItem_Release(&def_icon);
+ else IconSourceItem_Release(def_icon);
}
}
return hIcon;
@@ -711,8 +708,8 @@ HICON IconItem_GetIcon(HANDLE hIcoLib, bool big) if (!source && !db_get_ts(NULL, "SkinIcons", item->name, &dbv)) {
TCHAR tszFullPath[MAX_PATH];
PathToAbsoluteT(dbv.ptszVal, tszFullPath);
- int cx = item->cx ? item->cx : GetSystemMetrics(big ? SM_CXICON : SM_CXSMICON);
- int cy = item->cy ? item->cy : GetSystemMetrics(big ? SM_CYICON : SM_CYSMICON);
+ int cx = item->cx ? item->cx : (big ? g_iIconX : g_iIconSX);
+ int cy = item->cy ? item->cy : (big ? g_iIconY : g_iIconSY);
source = GetIconSourceItemFromPath(tszFullPath, cx, cy);
db_free(&dbv);
}
@@ -753,7 +750,7 @@ MIR_APP_DLL(HICON) IcoLib_GetIcon(const char* pszIconName, bool big) // IcoLib_GetIconHandle
// lParam: pszIconName
-MIR_APP_DLL(HANDLE) IcoLib_GetIconHandle(const char* pszIconName)
+MIR_APP_DLL(HANDLE) IcoLib_GetIconHandle(const char *pszIconName)
{
if (!pszIconName)
return NULL;
diff --git a/src/mir_app/src/ignore.cpp b/src/mir_app/src/ignore.cpp index fc5fa575b5..b8c1af1b1b 100644 --- a/src/mir_app/src/ignore.cpp +++ b/src/mir_app/src/ignore.cpp @@ -187,7 +187,7 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 3 + IGNOREEVENT_MAX, 3 + IGNOREEVENT_MAX);
+ HIMAGELIST hIml = ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 3 + IGNOREEVENT_MAX, 3 + IGNOREEVENT_MAX);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_SMALLDOT);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_FILLEDBLOB);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_EMPTYBLOB);
diff --git a/src/mir_app/src/imgconv.cpp b/src/mir_app/src/imgconv.cpp index 75974fc541..bf1486b226 100644 --- a/src/mir_app/src/imgconv.cpp +++ b/src/mir_app/src/imgconv.cpp @@ -103,8 +103,8 @@ void ConvertBufferToPARGB32(HANDLE hPaintBuffer, HDC hdc, HICON hIcon, SIZE& siz HBITMAP ConvertIconToBitmap(HICON hicon, HIMAGELIST hIml, int iconId)
{
SIZE sizIcon;
- sizIcon.cx = GetSystemMetrics(SM_CXSMICON);
- sizIcon.cy = GetSystemMetrics(SM_CYSMICON);
+ sizIcon.cx = g_iIconSX;
+ sizIcon.cy = g_iIconSY;
RECT rcIcon = { 0, 0, sizIcon.cx, sizIcon.cy };
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index e4e40b2891..0721e6640e 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -114,8 +114,8 @@ INT_PTR Meta_LoadIcon(WPARAM wParam, LPARAM) }
return (INT_PTR)LoadImage(g_hInst, MAKEINTRESOURCE(id), IMAGE_ICON,
- GetSystemMetrics(wParam & PLIF_SMALL ? SM_CXSMICON : SM_CXICON),
- GetSystemMetrics(wParam & PLIF_SMALL ? SM_CYSMICON : SM_CYICON), 0);
+ (wParam & PLIF_SMALL) ? g_iIconX : g_iIconSX,
+ (wParam & PLIF_SMALL) ? g_iIconY : g_iIconSY, 0);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -651,7 +651,7 @@ int Meta_ModulesLoaded(WPARAM, LPARAM) sid.szModule = META_PROTO;
sid.flags = MBF_TCHAR;
sid.tszTooltip = LPGENT("Select metacontact");
- sid.hIcon = LoadSkinnedProtoIcon(META_PROTO, ID_STATUS_ONLINE);
+ sid.hIcon = Skin_LoadProtoIcon(META_PROTO, ID_STATUS_ONLINE);
Srmm_AddIcon(&sid);
return 0;
}
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index b23236d6d4..a6a49fd7be 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -3,11 +3,11 @@ EXPORTS CallContactService @1
CallProtoService @2
RecalculateTime @3
-LoadSkinProtoIcon @4
-LoadSkinIcon @5
+Skin_LoadProtoIcon @4
+Skin_LoadIcon @5
Button_FreeIcon_IcoLib @6
Button_SetIcon_IcoLib @7
-GetSkinIconHandle @8
+Skin_GetIconHandle @8
IcoLib_AddIcon @9
IcoLib_GetIcon @10
IcoLib_GetIconByHandle @11
@@ -23,3 +23,4 @@ IcoLib_RemoveIcon @20 IcoLib_RemoveIconByHandle @21
IcoLib_Release @22
IcoLib_AddRef @23
+Skin_GetIconName @24
diff --git a/src/mir_app/src/miranda.cpp b/src/mir_app/src/miranda.cpp index 15acd9e720..4bd366be54 100644 --- a/src/mir_app/src/miranda.cpp +++ b/src/mir_app/src/miranda.cpp @@ -54,10 +54,17 @@ HINSTANCE g_hInst; DWORD hMainThreadId;
int hLangpack = 0;
bool bModulesLoadedFired = false;
+int g_iIconX, g_iIconY, g_iIconSX, g_iIconSY;
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID)
{
- g_hInst = hinstDLL;
+ if (dwReason == DLL_PROCESS_ATTACH) {
+ g_hInst = hinstDLL;
+ g_iIconX = g_iIconX;
+ g_iIconY = g_iIconY;
+ g_iIconSX = g_iIconSX;
+ g_iIconSY = g_iIconSY;
+ }
return TRUE;
}
diff --git a/src/mir_app/src/miranda.h b/src/mir_app/src/miranda.h index 8ceb3d308d..eceac3e7c0 100644 --- a/src/mir_app/src/miranda.h +++ b/src/mir_app/src/miranda.h @@ -109,6 +109,8 @@ void KillModuleIcons(int hLangpack); /**** skinicons.cpp ********************************************************************/
+extern int g_iIconX, g_iIconY, g_iIconSX, g_iIconSY;
+
HICON LoadIconEx(HINSTANCE hInstance, LPCTSTR lpIconName, BOOL bShared);
int ImageList_AddIcon_NotShared(HIMAGELIST hIml, LPCTSTR szResource);
int ImageList_ReplaceIcon_NotShared(HIMAGELIST hIml, int iIndex, HINSTANCE hInstance, LPCTSTR szResource);
diff --git a/src/mir_app/src/movetogroup.cpp b/src/mir_app/src/movetogroup.cpp index cfc7bee71e..dabc638ad3 100644 --- a/src/mir_app/src/movetogroup.cpp +++ b/src/mir_app/src/movetogroup.cpp @@ -92,7 +92,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM) mi.position = 100000;
mi.pszName = LPGEN("&Move to group");
mi.flags = CMIF_ROOTHANDLE;
- mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_GROUP);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_GROUP);
hMoveToGroupItem = Menu_AddContactMenuItem(&mi);
}
diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp index 4bdec9d37f..cce95cfe23 100644 --- a/src/mir_app/src/options.cpp +++ b/src/mir_app/src/options.cpp @@ -1294,7 +1294,7 @@ static INT_PTR AddOptionsPage(WPARAM wParam, LPARAM lParam) static int OptModulesLoaded(WPARAM, LPARAM)
{
CLISTMENUITEM mi = { sizeof(mi) };
- mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_OPTIONS);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_OPTIONS);
mi.position = 1900000000;
mi.pszName = LPGEN("&Options...");
mi.pszService = "Options/OptionsCommand";
diff --git a/src/mir_app/src/options_ei.cpp b/src/mir_app/src/options_ei.cpp index 54c2d4fb25..403f76d297 100644 --- a/src/mir_app/src/options_ei.cpp +++ b/src/mir_app/src/options_ei.cpp @@ -258,7 +258,7 @@ public: ShowWindow(label, SW_SHOW);
}
- int cx = GetSystemMetrics(SM_CXSMICON);
+ int cx = g_iIconSX;
HIMAGELIST hImageList = ImageList_Create(cx, cx, ILC_COLOR32 | ILC_MASK, 2, 2);
HICON hBlankIcon = (HICON)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_BLANK), IMAGE_ICON, cx, cx, 0);
diff --git a/src/mir_app/src/profilemanager.cpp b/src/mir_app/src/profilemanager.cpp index 7f7138be2f..e2ffc37f79 100644 --- a/src/mir_app/src/profilemanager.cpp +++ b/src/mir_app/src/profilemanager.cpp @@ -593,8 +593,8 @@ public: virtual void OnInitDialog() { - SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_DETAILSLOGO), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0)); - SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_DETAILSLOGO), IMAGE_ICON, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), 0)); + SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_DETAILSLOGO), IMAGE_ICON, g_iIconSX, g_iIconSY, 0)); + SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_DETAILSLOGO), IMAGE_ICON, g_iIconX, g_iIconY, 0)); if (m_pd->noProfiles || shouldAutoCreate(m_pd->ptszProfile)) m_tab.ActivatePage(1); diff --git a/src/mir_app/src/protocolorder.cpp b/src/mir_app/src/protocolorder.cpp index 3f6af51b04..5f8cc25601 100644 --- a/src/mir_app/src/protocolorder.cpp +++ b/src/mir_app/src/protocolorder.cpp @@ -155,7 +155,7 @@ public: virtual void OnInitDialog()
{
- HIMAGELIST himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 2, 2);
+ HIMAGELIST himlCheckBoxes = ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 2, 2);
ImageList_AddIcon_IconLibLoaded(himlCheckBoxes, SKINICON_OTHER_NOTICK);
ImageList_AddIcon_IconLibLoaded(himlCheckBoxes, SKINICON_OTHER_TICK);
m_order.SetImageList(himlCheckBoxes, TVSIL_NORMAL);
diff --git a/src/mir_app/src/protoopts.cpp b/src/mir_app/src/protoopts.cpp index 8a5d0e7a15..6d042b30cc 100644 --- a/src/mir_app/src/protoopts.cpp +++ b/src/mir_app/src/protoopts.cpp @@ -302,8 +302,8 @@ static LRESULT CALLBACK AccListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA int iItem = LOWORD(SendMessage(hwnd, LB_ITEMFROMPOINT, 0, lParam));
ListBox_GetItemRect(hwnd, iItem, &dat->rcCheck);
- dat->rcCheck.right = dat->rcCheck.left + GetSystemMetrics(SM_CXSMICON) + 4;
- dat->rcCheck.bottom = dat->rcCheck.top + GetSystemMetrics(SM_CYSMICON) + 4;
+ dat->rcCheck.right = dat->rcCheck.left + g_iIconSX + 4;
+ dat->rcCheck.bottom = dat->rcCheck.top + g_iIconSY + 4;
if (PtInRect(&dat->rcCheck, pt))
dat->iItem = iItem;
else
@@ -347,8 +347,8 @@ static LRESULT CALLBACK AccListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA return 0;
ListBox_GetItemRect(hwnd, ListBox_GetCurSel(hwnd), &rc);
- rc.left += 2 * GetSystemMetrics(SM_CXSMICON) + 4;
- rc.bottom = rc.top + max(GetSystemMetrics(SM_CXSMICON), parentDat->titleHeight) + 4 - 1;
+ rc.left += 2 * g_iIconSX + 4;
+ rc.bottom = rc.top + max(g_iIconSX, parentDat->titleHeight) + 4 - 1;
++rc.top; --rc.right;
dat->hwndEdit = CreateWindow(_T("EDIT"), pa->tszAccountName, WS_CHILD | WS_BORDER | ES_AUTOHSCROLL, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, hwnd, NULL, g_hInst, NULL);
@@ -518,7 +518,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM SelectObject(hdc, hfnt);
ReleaseDC(hwndDlg, hdc);
- dat->normalHeight = 4 + max(dat->titleHeight, GetSystemMetrics(SM_CYSMICON));
+ dat->normalHeight = 4 + max(dat->titleHeight, g_iIconSY);
dat->selectedHeight = dat->normalHeight + 4 + 2 * dat->textHeight;
}
@@ -559,8 +559,8 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM HBRUSH hbrBack;
SIZE sz;
{
- int cxIcon = GetSystemMetrics(SM_CXSMICON);
- int cyIcon = GetSystemMetrics(SM_CYSMICON);
+ int cxIcon = g_iIconSX;
+ int cyIcon = g_iIconSY;
LPDRAWITEMSTRUCT lps = (LPDRAWITEMSTRUCT)lParam;
PROTOACCOUNT *acc = (PROTOACCOUNT *)lps->itemData;
@@ -590,7 +590,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM else
tmp = acc->bIsEnabled ? SKINICON_OTHER_TICK : SKINICON_OTHER_NOTICK;
- HICON hIcon = LoadSkinnedIcon(tmp);
+ HICON hIcon = Skin_LoadIcon(tmp);
DrawIconEx(lps->hDC, lps->rcItem.left, lps->rcItem.top, hIcon, cxIcon, cyIcon, 0, hbrBack, DI_NORMAL);
IcoLib_ReleaseIcon(hIcon);
@@ -695,8 +695,8 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM if (iItem != LB_ERR) {
RECT rc;
ListBox_GetItemRect(hwndList, iItem, &rc);
- pt.x = rc.left + GetSystemMetrics(SM_CXSMICON) + 4;
- pt.y = rc.top + 4 + max(GetSystemMetrics(SM_CXSMICON), dat->titleHeight);
+ pt.x = rc.left + g_iIconSX + 4;
+ pt.y = rc.top + 4 + max(g_iIconSX, dat->titleHeight);
ClientToScreen(hwndList, &pt);
}
}
@@ -1019,7 +1019,7 @@ static INT_PTR OptProtosShow(WPARAM, LPARAM) int OptProtosLoaded(WPARAM, LPARAM)
{
CLISTMENUITEM mi = { sizeof(mi) };
- mi.icolibItem = GetSkinIconHandle(SKINICON_OTHER_ACCMGR);
+ mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_ACCMGR);
mi.position = 1900000000;
mi.pszName = LPGEN("&Accounts...");
mi.pszService = MS_PROTO_SHOWACCMGR;
diff --git a/src/mir_app/src/searchresults.cpp b/src/mir_app/src/searchresults.cpp index af1bf873b6..8a8ae3ea8f 100644 --- a/src/mir_app/src/searchresults.cpp +++ b/src/mir_app/src/searchresults.cpp @@ -64,7 +64,7 @@ void LoadColumnSizes(HWND hwndResults, const char *szProto) char szSetting[32];
bool colOrdersValid;
- defaultColumnSizes[COLUMNID_PROTO] = GetSystemMetrics(SM_CXSMICON) + 4;
+ defaultColumnSizes[COLUMNID_PROTO] = g_iIconSX + 4;
FindAddDlgData *dat = (FindAddDlgData*)GetWindowLongPtr(GetParent(hwndResults), GWLP_USERDATA);
columnCount = NUM_COLUMNID;
diff --git a/src/mir_app/src/skin2opts.cpp b/src/mir_app/src/skin2opts.cpp index ace1b18781..7805550d34 100644 --- a/src/mir_app/src/skin2opts.cpp +++ b/src/mir_app/src/skin2opts.cpp @@ -89,7 +89,7 @@ HICON IconItem_GetIcon_Preview(IcolibItem* item) }
if (!hIcon && item->default_file) {
- IconSourceItem_Release(&item->default_icon);
+ IconSourceItem_Release(item->default_icon);
item->default_icon = GetIconSourceItem(item->default_file, item->default_indx, item->cx, item->cy);
if (item->default_icon) {
HICON hRefIcon = IconSourceItem_GetIcon(item->default_icon);
@@ -364,7 +364,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM hwndParent = (HWND)lParam;
hPreview = GetDlgItem(hwndDlg, IDC_PREVIEW);
dragging = dragItem = 0;
- ListView_SetImageList(hPreview, ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 0, 100), LVSIL_NORMAL);
+ ListView_SetImageList(hPreview, ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 0, 100), LVSIL_NORMAL);
ListView_SetIconSpacing(hPreview, 56, 67);
{
RECT rcThis, rcParent;
@@ -536,7 +536,7 @@ INT_PTR CALLBACK DlgProcIconImport(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM dragging = 1;
dragItem = ((LPNMLISTVIEW)lParam)->iItem;
dropHiLite = -1;
- ImageList_BeginDrag(ListView_GetImageList(hPreview, LVSIL_NORMAL), dragItem, GetSystemMetrics(SM_CXICON) / 2, GetSystemMetrics(SM_CYICON) / 2);
+ ImageList_BeginDrag(ListView_GetImageList(hPreview, LVSIL_NORMAL), dragItem, g_iIconX / 2, g_iIconY / 2);
{
POINT pt;
RECT rc;
@@ -653,7 +653,7 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM //
ListView_SetUnicodeFormat(hPreview, TRUE);
ListView_SetExtendedListViewStyleEx(hPreview, LVS_EX_INFOTIP, LVS_EX_INFOTIP);
- ListView_SetImageList(hPreview, ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 0, 30), LVSIL_NORMAL);
+ ListView_SetImageList(hPreview, ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 0, 30), LVSIL_NORMAL);
ListView_SetIconSpacing(hPreview, 56, 67);
SendMessage(hwndDlg, DM_REBUILD_CTREE, 0, 0);
@@ -911,12 +911,12 @@ INT_PTR CALLBACK DlgProcIcoLibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (item->temp_reset) {
db_unset(NULL, "SkinIcons", item->name);
if (item->source_small != item->default_icon) {
- IconSourceItem_Release(&item->source_small);
+ IconSourceItem_Release(item->source_small);
}
}
else if (item->temp_file) {
db_set_ts(NULL, "SkinIcons", item->name, item->temp_file);
- IconSourceItem_Release(&item->source_small);
+ IconSourceItem_Release(item->source_small);
SafeDestroyIcon(&item->temp_icon);
}
}
diff --git a/src/mir_app/src/skinicons.cpp b/src/mir_app/src/skinicons.cpp index 63ba1b81d3..410b30a1d9 100644 --- a/src/mir_app/src/skinicons.cpp +++ b/src/mir_app/src/skinicons.cpp @@ -121,7 +121,7 @@ const char protoIconsFmt[] = LPGEN("%s icons"); // load small icon (shared) it's not need to be destroyed
static HICON LoadSmallIconShared(HINSTANCE hInstance, LPCTSTR lpIconName)
{
- int cx = GetSystemMetrics(SM_CXSMICON);
+ int cx = g_iIconSX;
return (HICON)LoadImage(hInstance, lpIconName, IMAGE_ICON, cx, cx, LR_DEFAULTCOLOR | LR_SHARED);
}
@@ -158,7 +158,7 @@ int ImageList_AddIcon_NotShared(HIMAGELIST hIml, LPCTSTR szResource) int ImageList_AddIcon_IconLibLoaded(HIMAGELIST hIml, int iconId)
{
- HICON hIcon = LoadSkinIcon(iconId);
+ HICON hIcon = Skin_LoadIcon(iconId);
int res = ImageList_AddIcon(hIml, hIcon);
IcoLib_ReleaseIcon(hIcon);
return res;
@@ -166,7 +166,7 @@ int ImageList_AddIcon_IconLibLoaded(HIMAGELIST hIml, int iconId) int ImageList_AddIcon_ProtoIconLibLoaded(HIMAGELIST hIml, const char *szProto, int iconId)
{
- HICON hIcon = LoadSkinProtoIcon(szProto, iconId);
+ HICON hIcon = Skin_LoadProtoIcon(szProto, iconId);
int res = ImageList_AddIcon(hIml, hIcon);
IcoLib_ReleaseIcon(hIcon);
return res;
@@ -189,14 +189,14 @@ int ImageList_ReplaceIcon_IconLibLoaded(HIMAGELIST hIml, int nIndex, HICON hIcon MIR_APP_DLL(void) Window_SetIcon_IcoLib(HWND hWnd, int iconId)
{
- SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinIcon(iconId, true));
- SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadSkinIcon(iconId));
+ SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)Skin_LoadIcon(iconId, true));
+ SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)Skin_LoadIcon(iconId));
}
MIR_APP_DLL(void) Window_SetProtoIcon_IcoLib(HWND hWnd, const char *szProto, int iconId)
{
- SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinProtoIcon(szProto, iconId, true));
- SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadSkinProtoIcon(szProto, iconId));
+ SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)Skin_LoadProtoIcon(szProto, iconId, true));
+ SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)Skin_LoadProtoIcon(szProto, iconId));
}
MIR_APP_DLL(void) Window_FreeIcon_IcoLib(HWND hWnd)
@@ -208,7 +208,7 @@ MIR_APP_DLL(void) Window_FreeIcon_IcoLib(HWND hWnd) MIR_APP_DLL(void) Button_SetIcon_IcoLib(HWND hwndDlg, int itemId, int iconId, const char *tooltip)
{
HWND hWnd = GetDlgItem(hwndDlg, itemId);
- SendMessage(hWnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadSkinIcon(iconId));
+ SendMessage(hWnd, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_LoadIcon(iconId));
SendMessage(hWnd, BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(hWnd, BUTTONADDTOOLTIP, (WPARAM)tooltip, 0);
}
@@ -219,7 +219,7 @@ MIR_APP_DLL(void) Button_FreeIcon_IcoLib(HWND hwndDlg, int itemId) IcoLib_ReleaseIcon(hIcon);
}
-MIR_APP_DLL(HICON) LoadSkinProtoIcon(const char *szProto, int status, bool big)
+MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big)
{
char iconName[MAX_PATH];
INT_PTR caps2;
@@ -336,7 +336,7 @@ MIR_APP_DLL(HICON) LoadSkinProtoIcon(const char *szProto, int status, bool big) return hIcon;
}
-MIR_APP_DLL(HANDLE) GetSkinIconHandle(int idx)
+MIR_APP_DLL(HANDLE) Skin_GetIconHandle(int idx)
{
for (int i = 0; i < SIZEOF(mainIcons); i++)
if (idx == mainIcons[i].id)
@@ -345,7 +345,7 @@ MIR_APP_DLL(HANDLE) GetSkinIconHandle(int idx) return NULL;
}
-char* GetSkinIconName(int idx)
+MIR_APP_DLL(char*) Skin_GetIconName(int idx)
{
static char szIconName[100];
@@ -358,50 +358,24 @@ char* GetSkinIconName(int idx) return NULL;
}
-MIR_APP_DLL(HICON) LoadSkinIcon(int idx, bool big)
+MIR_APP_DLL(HICON) Skin_LoadIcon(int idx, bool big)
{
// Query for global status icons
if (idx < SKINICON_EVENT_MESSAGE) {
if (idx >= SIZEOF(statusIcons))
return NULL;
- return LoadSkinProtoIcon(NULL, statusIcons[idx].id, big);
+ return Skin_LoadProtoIcon(NULL, statusIcons[idx].id, big);
}
- return IcoLib_GetIconByHandle(GetSkinIconHandle(idx), big);
+ return IcoLib_GetIconByHandle(Skin_GetIconHandle(idx), big);
}
/////////////////////////////////////////////////////////////////////////////////////////
// Initializes the icon skin module
-static INT_PTR sttLoadSkinIcon(WPARAM wParam, LPARAM lParam)
-{
- switch (lParam) {
- case 0: return (INT_PTR)LoadSkinIcon(wParam);
- case 1: return (INT_PTR)GetSkinIconHandle(wParam);
- case 2: return (INT_PTR)LoadSkinIcon(wParam, true);
- case 3: return (INT_PTR)GetSkinIconName(wParam);
- }
-
- return 0;
-}
-
-static INT_PTR sttLoadSkinProtoIcon(WPARAM wParam, LPARAM lParam)
-{
- return (INT_PTR)LoadSkinProtoIcon((char*)wParam, (int)lParam, false);
-}
-
-static INT_PTR sttLoadSkinProtoIconBig(WPARAM wParam, LPARAM lParam)
-{
- return (INT_PTR)LoadSkinProtoIcon((char*)wParam, (int)lParam, true);
-}
-
int LoadSkinIcons(void)
{
- CreateServiceFunction(MS_SKIN_LOADICON, sttLoadSkinIcon);
- CreateServiceFunction(MS_SKIN_LOADPROTOICON, sttLoadSkinProtoIcon);
- CreateServiceFunction(MS_SKIN_LOADPROTOICONBIG, sttLoadSkinProtoIconBig);
-
TCHAR modulePath[MAX_PATH];
GetModuleFileName(g_hInst, modulePath, SIZEOF(modulePath));
diff --git a/src/mir_app/src/visibility.cpp b/src/mir_app/src/visibility.cpp index 5c5f85f84e..447bac6beb 100644 --- a/src/mir_app/src/visibility.cpp +++ b/src/mir_app/src/visibility.cpp @@ -138,7 +138,7 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 3, 3);
+ hIml = ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 3, 3);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_SMALLDOT);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_VISIBLE_ALL);
ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_INVISIBLE_ALL);
|