From 88790eed4ffd9ca555c8f9b73cb014a93b57a34f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 22 Jun 2015 20:38:56 +0000 Subject: Menu_ModifyItem unbound from CLISTMENUITEM structure git-svn-id: http://svn.miranda-ng.org/main/trunk@14334 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/WebView/src/webview.cpp | 30 ++++++++++-------------------- plugins/WebView/src/webview.h | 2 +- 2 files changed, 11 insertions(+), 21 deletions(-) (limited to 'plugins/WebView') 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 -- cgit v1.2.3