diff options
author | George Hazan <ghazan@miranda.im> | 2019-03-28 00:01:57 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-03-28 00:02:08 +0300 |
commit | 874bfd75183b781c0087087502133f5bea8ade1c (patch) | |
tree | 4f7c8c08ee71005b69574ae3820ddd7611894f52 /plugins | |
parent | 7e852468c6d1a45cd4c78c4744b74e51d29e26b0 (diff) |
Menu_ModifyItem to receive icolib handle, not HICON
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Boltun/src/boltun.cpp | 8 | ||||
-rw-r--r-- | plugins/ClientChangeNotify/src/ClientChangeNotify.cpp | 4 | ||||
-rw-r--r-- | plugins/Db_autobackups/src/main.cpp | 4 | ||||
-rw-r--r-- | plugins/HTTPServer/src/Glob.h | 2 | ||||
-rw-r--r-- | plugins/HTTPServer/src/GuiElements.cpp | 25 | ||||
-rw-r--r-- | plugins/HTTPServer/src/IndexHTML.cpp | 2 | ||||
-rw-r--r-- | plugins/HTTPServer/src/main.cpp | 18 | ||||
-rw-r--r-- | plugins/MenuItemEx/src/main.cpp | 8 | ||||
-rw-r--r-- | plugins/NewAwaySysMod/src/AwaySys.cpp | 6 | ||||
-rw-r--r-- | plugins/NewEventNotify/src/menuitem.cpp | 4 | ||||
-rw-r--r-- | plugins/ProxySwitch/src/main.cpp | 20 | ||||
-rw-r--r-- | plugins/SeenPlugin/src/menu.cpp | 4 | ||||
-rw-r--r-- | plugins/SimpleStatusMsg/src/awaymsg.cpp | 4 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/svc_refreshci.cpp | 4 | ||||
-rw-r--r-- | plugins/Watrack/i_gui.inc | 6 | ||||
-rw-r--r-- | plugins/WhoUsesMyFiles/src/wumfplug.cpp | 4 | ||||
-rw-r--r-- | plugins/mRadio/i_tray.inc | 4 | ||||
-rw-r--r-- | plugins/mRadio/i_visual.inc | 8 |
18 files changed, 64 insertions, 71 deletions
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index 49296ac118..9150f943bc 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -500,14 +500,14 @@ static int OnContactMenuPrebuild(WPARAM hContact, LPARAM) if (bEnable) {
if (g_plugin.getByte(hContact, DB_CONTACT_BOLTUN_AUTO_CHAT, FALSE))
- Menu_ModifyItem(hMenuItemAutoChat, nullptr, Skin_LoadIcon(SKINICON_OTHER_TICK), CMIF_CHECKED);
+ Menu_ModifyItem(hMenuItemAutoChat, nullptr, Skin_GetIconHandle(SKINICON_OTHER_TICK), CMIF_CHECKED);
else
- Menu_ModifyItem(hMenuItemAutoChat, nullptr, Skin_LoadIcon(SKINICON_OTHER_NOTICK), 0);
+ Menu_ModifyItem(hMenuItemAutoChat, nullptr, Skin_GetIconHandle(SKINICON_OTHER_NOTICK), 0);
if (g_plugin.getByte(hContact, DB_CONTACT_BOLTUN_NOT_TO_CHAT, FALSE))
- Menu_ModifyItem(hMenuItemNotToChat, nullptr, Skin_LoadIcon(SKINICON_OTHER_TICK), CMIF_CHECKED);
+ Menu_ModifyItem(hMenuItemNotToChat, nullptr, Skin_GetIconHandle(SKINICON_OTHER_TICK), CMIF_CHECKED);
else
- Menu_ModifyItem(hMenuItemNotToChat, nullptr, Skin_LoadIcon(SKINICON_OTHER_NOTICK), 0);
+ Menu_ModifyItem(hMenuItemNotToChat, nullptr, Skin_GetIconHandle(SKINICON_OTHER_NOTICK), 0);
}
return 0;
}
diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp index 3774de9ca6..97eff14c37 100644 --- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp +++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp @@ -269,9 +269,9 @@ static int PrebuildMainMenu(WPARAM, LPARAM) {
// we have to use ME_CLIST_PREBUILDMAINMENU instead of updating menu items only on settings change, because "popup_enabled" and "popup_disabled" icons are not always available yet in ModulesLoaded
if (g_PopupOptPage.GetDBValueCopy(IDC_POPUPOPTDLG_POPUPNOTIFY))
- Menu_ModifyItem(g_hTogglePopupsMenuItem, LPGENW("Disable c&lient change notification"), IcoLib_GetIcon("popup_enabled"));
+ Menu_ModifyItem(g_hTogglePopupsMenuItem, LPGENW("Disable c&lient change notification"), IcoLib_GetIconHandle("popup_enabled"));
else
- Menu_ModifyItem(g_hTogglePopupsMenuItem, LPGENW("Enable c&lient change notification"), IcoLib_GetIcon("popup_disabled"));
+ Menu_ModifyItem(g_hTogglePopupsMenuItem, LPGENW("Enable c&lient change notification"), IcoLib_GetIconHandle("popup_disabled"));
return 0;
}
diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp index e0522f1c18..39e12fced4 100644 --- a/plugins/Db_autobackups/src/main.cpp +++ b/plugins/Db_autobackups/src/main.cpp @@ -42,9 +42,9 @@ CMPlugin::CMPlugin() : static void UpdateMenuIcons()
{
if (g_plugin.disable_popups)
- Menu_ModifyItem(g_hPopupMenu, LPGENW("Enable &AutoBackups notification"), Skin_LoadIcon(SKINICON_OTHER_NOPOPUP));
+ Menu_ModifyItem(g_hPopupMenu, LPGENW("Enable &AutoBackups notification"), Skin_GetIconHandle(SKINICON_OTHER_NOPOPUP));
else
- Menu_ModifyItem(g_hPopupMenu, LPGENW("Disable &AutoBackups notification"), Skin_LoadIcon(SKINICON_OTHER_POPUP));
+ Menu_ModifyItem(g_hPopupMenu, LPGENW("Disable &AutoBackups notification"), Skin_GetIconHandle(SKINICON_OTHER_POPUP));
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/HTTPServer/src/Glob.h b/plugins/HTTPServer/src/Glob.h index ba1cb0e1e9..fe853b5e00 100644 --- a/plugins/HTTPServer/src/Glob.h +++ b/plugins/HTTPServer/src/Glob.h @@ -54,7 +54,7 @@ using namespace std; #define SD_BOTH 0x02
#define MODULENAME "HTTPServer"
-#define MSG_BOX_TITEL Translate("Miranda NG HTTP-Server")
+#define MSG_BOX_TITLE "Miranda NG HTTP-Server"
#define SplitIpAddress( p ) (BYTE)(p>>24),(BYTE)(p>>16),(BYTE)(p>>8),(BYTE)(p)
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index a8b08272a7..285cc7595f 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -416,7 +416,6 @@ UINT_PTR CALLBACK ShareNewFileDialogHook( return false;
}
-
/////////////////////////////////////////////////////////////////////
// Member Function : bShowShareNewFileDlg
// Type : Global
@@ -432,13 +431,12 @@ UINT_PTR CALLBACK ShareNewFileDialogHook( bool bShowShareNewFileDlg(HWND hwndOwner, STFileShareInfo * pstNewShare)
{
- OPENFILENAME ofn = { 0 };
- ofn.lStructSize = sizeof(OPENFILENAME);
-
char temp[MAX_PATH];
mir_snprintf(temp, "%s (*.*)%c*.*%c%c", Translate("All files"), 0, 0, 0);
- ofn.lpstrFilter = temp;
+ OPENFILENAME ofn = { 0 };
+ ofn.lStructSize = sizeof(OPENFILENAME);
+ ofn.lpstrFilter = temp;
ofn.lpstrFile = pstNewShare->pszRealPath;
ofn.nMaxFile = pstNewShare->dwMaxRealPath;
@@ -449,7 +447,6 @@ bool bShowShareNewFileDlg(HWND hwndOwner, STFileShareInfo * pstNewShare) *ofn.lpstrFile = '\0';
}
-
ofn.Flags = /*OFN_DONTADDTORECENT |*/ OFN_NOREADONLYRETURN
| OFN_ENABLEHOOK | OFN_ENABLETEMPLATE | OFN_EXPLORER | OFN_ENABLESIZING
| OFN_ALLOWMULTISELECT;
@@ -477,10 +474,10 @@ bool bShowShareNewFileDlg(HWND hwndOwner, STFileShareInfo * pstNewShare) pszFileNamePos = strchr(pszFileNamePos, '"');
if (pszFileNamePos) {
pszFileNamePos++;
- char* start = pszFileNamePos;
+ char *start = pszFileNamePos;
pszFileNamePos = strchr(pszFileNamePos, '"');
if (pszFileNamePos) {
- char* end = pszFileNamePos;
+ char *end = pszFileNamePos;
memmove(pstNewShare->pszSrvPath + 1, start, end - start);
*(end - (start - (pstNewShare->pszSrvPath + 1))) = '\0';
@@ -490,7 +487,7 @@ bool bShowShareNewFileDlg(HWND hwndOwner, STFileShareInfo * pstNewShare) pstNewShare->pszRealPath[pstNewShare->dwMaxRealPath] = '\0';
if (CallService(MS_HTTP_ADD_CHANGE_REMOVE, 0, (LPARAM)pstNewShare)) {
- MessageBox(nullptr, Translate("Failed to share new file"), MSG_BOX_TITEL, MB_OK);
+ MessageBoxW(nullptr, TranslateT("Failed to share new file"), TranslateW(_A2W(MSG_BOX_TITLE)), MB_OK);
return false;
}
pszFileNamePos++;
@@ -501,7 +498,7 @@ bool bShowShareNewFileDlg(HWND hwndOwner, STFileShareInfo * pstNewShare) }
else {
if (CallService(MS_HTTP_ADD_CHANGE_REMOVE, 0, (LPARAM)pstNewShare)) {
- MessageBox(nullptr, Translate("Failed to share new file"), MSG_BOX_TITEL, MB_OK);
+ MessageBoxW(nullptr, TranslateT("Failed to share new file"), TranslateW(_A2W(MSG_BOX_TITLE)), MB_OK);
return false;
}
}
@@ -790,7 +787,7 @@ static INT_PTR CALLBACK DlgProcStatsticView(HWND hwndDlg, UINT msg, WPARAM wPara strncpy(&szServPath[1], fileName + 1, MAX_PATH - 2);
if (CallService(MS_HTTP_ADD_CHANGE_REMOVE, 0, (LPARAM)&stNewShare)) {
- MessageBox(nullptr, Translate("Failed to share new file"), MSG_BOX_TITEL, MB_OK);
+ MessageBoxW(nullptr, TranslateT("Failed to share new file"), TranslateW(_A2W(MSG_BOX_TITLE)), MB_OK);
return false;
}
}
@@ -1192,7 +1189,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP mir_snprintf(szKeyWord, Translate("Your external IP was detected as %d.%d.%d.%d\r\nby: %s"),
SplitIpAddress(dwExternalIP),
szUrl);
- MessageBox(hwndDlg, szKeyWord, MSG_BOX_TITEL, MB_OK);
+ MessageBox(hwndDlg, szKeyWord, Translate(MSG_BOX_TITLE), MB_OK);
}
break;
@@ -1209,14 +1206,14 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP bool bNew = IsDlgButtonChecked(hwndDlg, IDC_ADD_STATISTICS_MENU_ITEM) == BST_CHECKED;
if (b != bNew) {
g_plugin.setByte("AddStatisticsMenuItem", bNew);
- MessageBox(hwndDlg, Translate("You need to restart Miranda to change the main menu"), MSG_BOX_TITEL, MB_OK);
+ MessageBoxW(hwndDlg, TranslateT("You need to restart Miranda to change the main menu"), TranslateW(_A2W(MSG_BOX_TITLE)), MB_OK);
}
b = g_plugin.getByte("AddAcceptConMenuItem", 1) != 0;
bNew = IsDlgButtonChecked(hwndDlg, IDC_ACCEPT_COM_MENU_ITEM) == BST_CHECKED;
if (b != bNew) {
g_plugin.setByte("AddAcceptConMenuItem", bNew);
- MessageBox(hwndDlg, Translate("You need to restart Miranda to change the main menu"), MSG_BOX_TITEL, MB_OK);
+ MessageBoxW(hwndDlg, TranslateT("You need to restart Miranda to change the main menu"), TranslateW(_A2W(MSG_BOX_TITLE)), MB_OK);
}
bNew = IsDlgButtonChecked(hwndDlg, IDC_WRITE_LOG_FILE) == BST_CHECKED;
diff --git a/plugins/HTTPServer/src/IndexHTML.cpp b/plugins/HTTPServer/src/IndexHTML.cpp index c32f782f81..b46ce7bb6b 100644 --- a/plugins/HTTPServer/src/IndexHTML.cpp +++ b/plugins/HTTPServer/src/IndexHTML.cpp @@ -69,7 +69,7 @@ bool LoadIndexHTMLTemplate() HANDLE hFile = CreateFile(pszBuf, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
if (hFile == INVALID_HANDLE_VALUE) {
- MessageBox(nullptr, "HTTPServerIndex.html not found in Plugin Path", MSG_BOX_TITEL, MB_OK);
+ MessageBoxW(nullptr, L"HTTPServerIndex.html not found in Plugin Path", TranslateW(_A2W(MSG_BOX_TITLE)), MB_OK);
return false;
}
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index c430b0574f..80b12983a3 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -42,6 +42,12 @@ const char* pszDefaultShares[] = { nullptr, nullptr
};
+static IconItem iconList[] =
+{
+ { "Disable server", "disable", IDI_DISABLE_SERVER },
+ { "Enable server", "enable", IDI_SHARE_NEW_FILE },
+};
+
int OptionsInitialize(WPARAM, LPARAM);
int PreShutdown(WPARAM, LPARAM);
@@ -628,18 +634,18 @@ INT_PTR nToggelAcceptConnections(WPARAM wparam, LPARAM /*lparam*/) char szTemp[200];
mir_snprintf(szTemp, Translate("Failed to bind to port %s\r\nThis is most likely because another program or service is using this port"),
nlb.wPort == 80 ? "80" : nus.szIncomingPorts);
- MessageBox(nullptr, szTemp, MSG_BOX_TITEL, MB_OK);
+ MessageBox(nullptr, szTemp, MSG_BOX_TITLE, MB_OK);
return 1001;
}
dwLocalPortUsed = nlb.wPort;
dwLocalIpAddress = nlb.dwInternalIP;
- Menu_ModifyItem(hAcceptConnectionsMenuItem, LPGENW("Disable HTTP server"), LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_DISABLE_SERVER)));
+ Menu_ModifyItem(hAcceptConnectionsMenuItem, LPGENW("Disable HTTP server"), iconList[0].hIcolib);
}
else if (hDirectBoundPort && wparam == 0) {
Netlib_CloseHandle(hDirectBoundPort);
hDirectBoundPort = nullptr;
- Menu_ModifyItem(hAcceptConnectionsMenuItem, LPGENW("Enable HTTP server"), LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_SHARE_NEW_FILE)));
+ Menu_ModifyItem(hAcceptConnectionsMenuItem, LPGENW("Enable HTTP server"), iconList[1].hIcolib);
}
else return 0; // no changes;
@@ -785,6 +791,8 @@ int nSystemShutdown(WPARAM /*wparam*/, LPARAM /*lparam*/) int CMPlugin::Load()
{
+ g_plugin.registerIcon(MSG_BOX_TITLE, iconList, MODULENAME);
+
hHttpAcceptConnectionsService = CreateServiceFunction(MS_HTTP_ACCEPT_CONNECTIONS, nToggelAcceptConnections);
hHttpAddChangeRemoveService = CreateServiceFunction(MS_HTTP_ADD_CHANGE_REMOVE, nAddChangeRemoveShare);
hHttpGetShareService = CreateServiceFunction(MS_HTTP_GET_SHARE, nGetShare);
@@ -797,7 +805,7 @@ int CMPlugin::Load() mir_strncat(szPluginPath, "\\HTTPServer\\", _countof(szPluginPath) - mir_strlen(szPluginPath));
int err = CreateDirectoryTree(szPluginPath);
if ((err != 0) && (err != ERROR_ALREADY_EXISTS)) {
- MessageBox(nullptr, "Failed to create HTTPServer directory.", MSG_BOX_TITEL, MB_OK);
+ MessageBoxW(nullptr, L"Failed to create HTTPServer directory.", TranslateW(_A2W(MSG_BOX_TITLE)), MB_OK);
return 1;
}
@@ -807,7 +815,7 @@ int CMPlugin::Load() sLogFilePath += "HTTPServer.log";
if (!bInitMimeHandling())
- MessageBox(nullptr, "Failed to read configuration file : " szMimeTypeConfigFile, MSG_BOX_TITEL, MB_OK);
+ MessageBoxW(nullptr, L"Failed to read configuration file : " szMimeTypeConfigFile, TranslateW(_A2W(MSG_BOX_TITLE)), MB_OK);
nMaxUploadSpeed = g_plugin.getDword("MaxUploadSpeed", nMaxUploadSpeed);
nMaxConnectionsTotal = g_plugin.getDword("MaxConnectionsTotal", nMaxConnectionsTotal);
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index 0c355b9e1a..48d89f3b61 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -386,12 +386,12 @@ static INT_PTR onHide(WPARAM wparam, LPARAM) // following 4 functions should be self-explanatory
static void ModifyVisibleSet(int mode, BOOL alpha)
{
- Menu_ModifyItem(hmenuVis, nullptr, (mode) ? hIcons[1] : (alpha ? hIcons[3] : Skin_LoadIcon(SKINICON_OTHER_SMALLDOT)));
+ Menu_ModifyItem(hmenuVis, nullptr, (mode) ? hIcons[1] : (alpha ? hIcons[3] : Skin_GetIconHandle(SKINICON_OTHER_SMALLDOT)));
}
static void ModifyInvisSet(int mode, BOOL alpha)
{
- Menu_ModifyItem(hmenuOff, nullptr, (mode) ? hIcons[2] : (alpha ? hIcons[4] : Skin_LoadIcon(SKINICON_OTHER_SMALLDOT)));
+ Menu_ModifyItem(hmenuOff, nullptr, (mode) ? hIcons[2] : (alpha ? hIcons[4] : Skin_GetIconHandle(SKINICON_OTHER_SMALLDOT)));
}
static void ModifyCopyID(MCONTACT hContact, BOOL bShowID, BOOL bTrimID)
@@ -697,9 +697,9 @@ static int BuildMenu(WPARAM wparam, LPARAM) if (bEnabled) {
BYTE bHidden = db_get_b(hContact, "CList", "Hidden", 0);
if (bHidden)
- Menu_ModifyItem(hmenuHide, LPGENW("Show in list"), IcoLib_GetIcon("miex_showil"));
+ Menu_ModifyItem(hmenuHide, LPGENW("Show in list"), IcoLib_GetIconHandle("miex_showil"));
else
- Menu_ModifyItem(hmenuHide, LPGENW("Hide from list"), IcoLib_GetIcon("miex_hidefl"));
+ Menu_ModifyItem(hmenuHide, LPGENW("Hide from list"), IcoLib_GetIconHandle("miex_hidefl"));
}
bEnabled = bShowAll || (flags & VF_IGN);
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index 13b44630cc..2d8fbf1c6e 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -235,7 +235,7 @@ int PreBuildContactMenu(WPARAM hContact, LPARAM) int iContactMode = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
wchar_t szSetStr[256], szReadStr[256];
szSetStr[0] = szReadStr[0] = 0;
- HICON hReadMsgIcon = nullptr;
+ HANDLE hReadMsgIcon = nullptr;
if (szProto) {
int i;
@@ -251,7 +251,7 @@ int PreBuildContactMenu(WPARAM hContact, LPARAM) // the protocol supports status message reading for contact's status
if (Flag1 & PF1_MODEMSGRECV && CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iContactMode)) {
mir_snwprintf(szReadStr, TranslateT("Re&ad %s message"), Clist_GetStatusModeDescription(iContactMode, 0));
- hReadMsgIcon = Skin_LoadProtoIcon(szProto, iContactMode);
+ hReadMsgIcon = Skin_GetProtoIcon(szProto, iContactMode);
}
}
if (g_hContactMenuItem) {
@@ -265,7 +265,7 @@ int PreBuildContactMenu(WPARAM hContact, LPARAM) int iAutoreply = CContactSettings(g_ProtoStates[szProto].m_status, hContact).Autoreply;
HANDLE hIcon;
switch (iAutoreply) {
- case VAL_USEDEFAULT: hIcon = Skin_LoadIcon(IDI_DOT); break;
+ case VAL_USEDEFAULT: hIcon = Skin_GetIconHandle(IDI_DOT); break;
case 0: hIcon = iconList[0].hIcolib; break;
default: iAutoreply = 1; hIcon = iconList[1].hIcolib; break;
}
diff --git a/plugins/NewEventNotify/src/menuitem.cpp b/plugins/NewEventNotify/src/menuitem.cpp index c077bf25be..6b29935b6f 100644 --- a/plugins/NewEventNotify/src/menuitem.cpp +++ b/plugins/NewEventNotify/src/menuitem.cpp @@ -40,9 +40,9 @@ static INT_PTR MenuitemNotifyCmd(WPARAM, LPARAM) int MenuitemUpdate(BOOL bStatus)
{
if (bStatus)
- Menu_ModifyItem(hMenuitemNotify, MENUITEM_DISABLE, Skin_LoadIcon(SKINICON_OTHER_POPUP));
+ Menu_ModifyItem(hMenuitemNotify, MENUITEM_DISABLE, Skin_GetIconHandle(SKINICON_OTHER_POPUP));
else
- Menu_ModifyItem(hMenuitemNotify, MENUITEM_ENABLE, Skin_LoadIcon(SKINICON_OTHER_NOPOPUP));
+ Menu_ModifyItem(hMenuitemNotify, MENUITEM_ENABLE, Skin_GetIconHandle(SKINICON_OTHER_NOPOPUP));
return 0;
}
diff --git a/plugins/ProxySwitch/src/main.cpp b/plugins/ProxySwitch/src/main.cpp index c79840bde7..5d61c866ed 100644 --- a/plugins/ProxySwitch/src/main.cpp +++ b/plugins/ProxySwitch/src/main.cpp @@ -156,30 +156,18 @@ void UpdateInterfacesMenu(void) void UpdatePopupMenu(BOOL State) { - CMenuItem mi(&g_plugin); - if (!hEnableDisablePopupMenu) return; - //ZeroMemory(&mi, sizeof(mi)); - //mi.cbSize = sizeof(mi); - // popup is now disabled if (State == FALSE) { - mi.name.w = LPGENW("Enable &IP change notification"); - mi.hIcon = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_NOTIF_0)); - - // popup is now enabled + Menu_ModifyItem(hEnableDisablePopupMenu, LPGENW("Enable &IP change notification")); + // mi.hIcon = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_NOTIF_0)); } else { - mi.name.w = LPGENW("Disable &IP change notification"); - mi.hIcon = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_NOTIF_1)); + Menu_ModifyItem(hEnableDisablePopupMenu, LPGENW("Disable &IP change notification")); + // mi.hIcon = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_NOTIF_1)); } - //mi.flags = CMIM_ICON | CMIM_NAME; - - // update menu item - Menu_ModifyItem(hEnableDisablePopupMenu, mi.name.w); - //CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hEnableDisablePopupMenu, (LPARAM)&mi); } static INT_PTR PopupSwitch(WPARAM, LPARAM) diff --git a/plugins/SeenPlugin/src/menu.cpp b/plugins/SeenPlugin/src/menu.cpp index 75a35626d3..1683c303dc 100644 --- a/plugins/SeenPlugin/src/menu.cpp +++ b/plugins/SeenPlugin/src/menu.cpp @@ -50,7 +50,7 @@ int BuildContactMenu(WPARAM hContact, LPARAM) ptszName = ParseString(DEFAULT_MENUSTAMP, hContact);
int flags = 0;
- HICON hIcon = nullptr;
+ HANDLE hIcon = nullptr;
if (!mir_wstrcmp(ptszName, TranslateT("<unknown>"))) {
if (IsWatchedProtocol(szProto))
flags |= CMIF_GRAYED;
@@ -59,7 +59,7 @@ int BuildContactMenu(WPARAM hContact, LPARAM) }
else if (g_plugin.getByte("ShowIcon", 1)) {
int isetting = g_plugin.getWord(hContact, "StatusTriger", -1);
- hIcon = Skin_LoadProtoIcon(szProto, isetting | 0x8000);
+ hIcon = Skin_GetProtoIcon(szProto, isetting | 0x8000);
}
Menu_ModifyItem(hmenuitem, ptszName, hIcon, flags);
return 0;
diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp index 114789ed5b..d5ce014c16 100644 --- a/plugins/SimpleStatusMsg/src/awaymsg.cpp +++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp @@ -301,10 +301,10 @@ static int AwayMsgPreBuildMenu(WPARAM hContact, LPARAM) if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGRECV) {
if (CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iStatus == ID_STATUS_OFFLINE ? ID_STATUS_INVISIBLE : iStatus)) {
wchar_t str[128];
- HICON hIcon = Skin_LoadProtoIcon(szProto, iStatus);
+ HANDLE hIcon = Skin_GetProtoIcon(szProto, iStatus);
mir_snwprintf(str, TranslateT("Re&ad %s message"), Clist_GetStatusModeDescription(iStatus, 0));
Menu_ModifyItem(hAwayMsgMenuItem, str, hIcon, 0);
- IcoLib_ReleaseIcon(hIcon);
+ IcoLib_ReleaseIcon((HICON)hIcon);
ptrA szMsg(db_get_sa(hContact, "CList", "StatusMsg"));
if (szMsg != nullptr) {
diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp index a6204e6401..0d7bc2b4de 100644 --- a/plugins/UserInfoEx/src/svc_refreshci.cpp +++ b/plugins/UserInfoEx/src/svc_refreshci.cpp @@ -565,7 +565,7 @@ class CContactUpdater : public CContactQueue // reset menu
if (hMenuItemRefresh)
- Menu_ModifyItem(hMenuItemRefresh, LPGENW("Refresh contact details"), IcoLib_GetIcon(ICO_BTN_UPDATE));
+ Menu_ModifyItem(hMenuItemRefresh, LPGENW("Refresh contact details"), IcoLib_GetIconHandle(ICO_BTN_UPDATE));
}
/**
@@ -645,7 +645,7 @@ public: // if there are contacts in the queue, change the main menu item to indicate it is meant for canceling.
if (hMenuItemRefresh && Size() > 0)
- Menu_ModifyItem(hMenuItemRefresh, LPGENW("Abort Refreshing Contact Details"), IcoLib_GetIcon(ICO_BTN_CANCEL));
+ Menu_ModifyItem(hMenuItemRefresh, LPGENW("Abort Refreshing Contact Details"), IcoLib_GetIconHandle(ICO_BTN_CANCEL));
}
void Cancel()
diff --git a/plugins/Watrack/i_gui.inc b/plugins/Watrack/i_gui.inc index 0128d7c566..3137780f27 100644 --- a/plugins/Watrack/i_gui.inc +++ b/plugins/Watrack/i_gui.inc @@ -46,9 +46,9 @@ var p:PAnsiChar;
begin
if f1<>0 then
- Menu_ModifyItem(hMenuDisable, 'Enable WATrack', IcoLib_GetIcon(IcoBtnDisable,0), f1)
+ Menu_ModifyItem(hMenuDisable, 'Enable WATrack', IcoLib_GetIconHandle(IcoBtnDisable), f1)
else
- Menu_ModifyItem(hMenuDisable, 'Disable WATrack', IcoLib_GetIcon(IcoBtnEnable,0));
+ Menu_ModifyItem(hMenuDisable, 'Disable WATrack', IcoLib_GetIconHandle(IcoBtnEnable));
if ServiceExists(MS_TTB_SETBUTTONSTATE) then
begin
@@ -72,7 +72,7 @@ var ttb:m_api.TTBButton;
begin
result:=0;
- Menu_ModifyItem(hMenuDisable, nil, IcoLib_GetIcon(IcoBtnEnable,0));
+ Menu_ModifyItem(hMenuDisable, nil, IcoLib_GetIconHandle(IcoBtnEnable));
// toptoolbar
if ServiceExists(MS_TTB_GETBUTTONOPTIONS) then
diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp index 4183876a8c..1ebafe4386 100644 --- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp +++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp @@ -187,11 +187,11 @@ static INT_PTR WumfMenuCommand(WPARAM, LPARAM) {
if (WumfOptions.PopupsEnabled == TRUE) {
WumfOptions.PopupsEnabled = FALSE;
- Menu_ModifyItem(hMenuItem, LPGENW("Enable WUMF popups"), Skin_LoadIcon(SKINICON_OTHER_NOPOPUP));
+ Menu_ModifyItem(hMenuItem, LPGENW("Enable WUMF popups"), Skin_GetIconHandle(SKINICON_OTHER_NOPOPUP));
}
else {
WumfOptions.PopupsEnabled = TRUE;
- Menu_ModifyItem(hMenuItem, LPGENW("Disable WUMF popups"), Skin_LoadIcon(SKINICON_OTHER_POPUP));
+ Menu_ModifyItem(hMenuItem, LPGENW("Disable WUMF popups"), Skin_GetIconHandle(SKINICON_OTHER_POPUP));
}
g_plugin.setByte(POPUPS_ENABLED, (BYTE)WumfOptions.PopupsEnabled);
diff --git a/plugins/mRadio/i_tray.inc b/plugins/mRadio/i_tray.inc index ff8b76a585..49408f1fb9 100644 --- a/plugins/mRadio/i_tray.inc +++ b/plugins/mRadio/i_tray.inc @@ -219,9 +219,9 @@ begin Menu_ModifyItem(trayprotoh, 'mRadio on');
if gVolume<0 then
- Menu_ModifyItem(traymute, nil, IcoLib_GetIcon(IcoBtnOff,0))
+ Menu_ModifyItem(traymute, nil, IcoLib_GetIconHandle(IcoBtnOff))
else
- Menu_ModifyItem(traymute, nil, IcoLib_GetIcon(IcoBtnOn,0));
+ Menu_ModifyItem(traymute, nil, IcoLib_GetIconHandle(IcoBtnOn));
if CallService(MS_RADIO_COMMAND,MRC_STATUS,RD_STATUS_GET)<>RD_STATUS_PLAYING then
Menu_ModifyItem(trayplay, 'Play')
diff --git a/plugins/mRadio/i_visual.inc b/plugins/mRadio/i_visual.inc index 2f95f0daa2..e8a319d15c 100644 --- a/plugins/mRadio/i_visual.inc +++ b/plugins/mRadio/i_visual.inc @@ -14,15 +14,15 @@ begin begin
// play/Stop
if THANDLE(hContact)<>ActiveContact then
- Menu_ModifyItem(hCMenuItemPlay, 'Start broadcasting', IcoLib_GetIcon(IcoBtnOn,0))
+ Menu_ModifyItem(hCMenuItemPlay, 'Start broadcasting', IcoLib_GetIconHandle(IcoBtnOn))
else
- Menu_ModifyItem(hCMenuItemPlay, 'Stop broadcasting', IcoLib_GetIcon(IcoBtnOff,0));
+ Menu_ModifyItem(hCMenuItemPlay, 'Stop broadcasting', IcoLib_GetIconHandle(IcoBtnOff));
// record
if Service_RadioRecord(0,1)<>0 then
- Menu_ModifyItem(hCMenuItemRec, 'Stop record', IcoLib_GetIcon(IcoBtnRecDn,0))
+ Menu_ModifyItem(hCMenuItemRec, 'Stop record', IcoLib_GetIconHandle(IcoBtnRecDn))
else
- Menu_ModifyItem(hCMenuItemRec, 'Start record', IcoLib_GetIcon(IcoBtnRecUp,0));
+ Menu_ModifyItem(hCMenuItemRec, 'Start record', IcoLib_GetIconHandle(IcoBtnRecUp));
end;
result:=0;
|