diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-22 20:38:56 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-22 20:38:56 +0000 |
commit | 88790eed4ffd9ca555c8f9b73cb014a93b57a34f (patch) | |
tree | b3e5bfe096005a9cac4bc14fdfbe5f6f5acad98a /plugins/WebView/src | |
parent | 9ecc2aa50e2183e2c4a11861ca6dede7d2151139 (diff) |
Menu_ModifyItem unbound from CLISTMENUITEM structure
git-svn-id: http://svn.miranda-ng.org/main/trunk@14334 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/WebView/src')
-rw-r--r-- | plugins/WebView/src/webview.cpp | 30 | ||||
-rw-r--r-- | plugins/WebView/src/webview.h | 2 |
2 files changed, 11 insertions, 21 deletions
diff --git a/plugins/WebView/src/webview.cpp b/plugins/WebView/src/webview.cpp index 95b5993569..333e501c32 100644 --- a/plugins/WebView/src/webview.cpp +++ b/plugins/WebView/src/webview.cpp @@ -41,42 +41,32 @@ HWND ContactHwnd; HINSTANCE hInst;
HMENU hMenu;
int bpStatus;
-HANDLE hMenuItem1;
-HANDLE hMenuItemCountdown;
+HGENMENU hMenuItem1;
+HGENMENU hMenuItemCountdown;
/*****************************************************************************/
void ChangeMenuItem1()
{
- /*
- * Enable or Disable auto updates
- */
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIM_NAME | CMIM_ICON | CMIF_TCHAR;
- mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE));
-
+ // Enable or Disable auto updates
+ LPCTSTR ptszName;
if (!db_get_b(NULL, MODULENAME, DISABLE_AUTOUPDATE_KEY, 0))
- mi.ptszName = LPGENT("Auto update enabled");
+ ptszName = LPGENT("Auto update enabled");
else
- mi.ptszName = LPGENT("Auto update disabled");
+ ptszName = LPGENT("Auto update disabled");
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItem1, (LPARAM)&mi);
+ Menu_ModifyItem(hMenuItem1, ptszName, LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE)));
}
/*****************************************************************************/
void ChangeMenuItemCountdown()
{
- /*
- * countdown
- */
- CLISTMENUITEM mi = { 0 };
- mi.flags = CMIM_NAME | CMIM_ICON | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
- mi.hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATEALL));
+ // countdown
+ HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_UPDATEALL));
TCHAR countername[100];
mir_sntprintf(countername,_countof(countername), TranslateT("%d minutes to update"), db_get_dw(NULL, MODULENAME, COUNTDOWN_KEY, 0));
- mi.ptszName = countername;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItemCountdown, (LPARAM)&mi);
+ Menu_ModifyItem(hMenuItemCountdown, countername, hIcon, CMIF_KEEPUNTRANSLATED);
}
/*****************************************************************************/
diff --git a/plugins/WebView/src/webview.h b/plugins/WebView/src/webview.h index b78c165caf..1767911e88 100644 --- a/plugins/WebView/src/webview.h +++ b/plugins/WebView/src/webview.h @@ -146,7 +146,7 @@ extern HMENU hMenu; extern int bpStatus;
extern HANDLE hNetlibUser;
extern MWindowList hWindowList;
-extern HANDLE hMenuItem1, hMenuItemCountdown;
+extern HGENMENU hMenuItem1, hMenuItemCountdown;
extern char optionsname[80];
//lets get rid of some warnings
|