diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-28 21:45:37 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-28 21:45:37 +0000 |
commit | 30707c980d1560b358dbf2671a4d2a26a1e8173c (patch) | |
tree | 74aee5adaaac976e1398274ca64c5461a60f1feb /plugins/Clist_mw/src/CLUIFrames | |
parent | 335ec43a4bfdcbbd0b2257037f1f3e0553d89076 (diff) |
various menu initialization quirks
git-svn-id: http://svn.miranda-ng.org/main/trunk@2552 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_mw/src/CLUIFrames')
-rw-r--r-- | plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp index 7c9381f7cc..0326de4745 100644 --- a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp +++ b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp @@ -629,13 +629,10 @@ int CLUIFramesGetalClientFrame(void) HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,HGENMENU (*pfnAdd )( CLISTMENUITEM* ))
{
- CLISTMENUITEM mi;
HANDLE menuid;
int framepos = id2pos(frameid);
- ZeroMemory(&mi,sizeof(mi));
-
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.hIcon = LoadIcon(g_hInst,MAKEINTRESOURCE(IDI_CLIENTMIRANDA));
mi.pszPopupName = (char *)root;
mi.popupPosition = frameid;
@@ -807,16 +804,11 @@ INT_PTR ModifyMItem(WPARAM wParam,LPARAM lParam) static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam,LPARAM lParam)
{
- int pos;
- CLISTMENUITEM mi;
- //TMO_MenuItem tmi;
-
lockfrm();
- pos = id2pos(wParam);
+ int pos = id2pos(wParam);
if (pos >= 0 && pos < nFramescount) {
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME|CMIF_CHILDPOPUP|CMIF_TCHAR;
mi.ptszName = Frames[pos].TitleBar.tbname ? Frames[pos].TitleBar.tbname : Frames[pos].name;
ModifyMItem((WPARAM)contMITitle,(LPARAM)&mi);
@@ -868,8 +860,7 @@ INT_PTR CLUIFramesModifyMainMenuItems(WPARAM wParam,LPARAM lParam) int pos = id2pos(wParam);
if (pos >= 0 && pos < nFramescount) {
- CLISTMENUITEM mi = { 0 };
- mi.cbSize = sizeof(mi);
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_NAME|CMIF_CHILDPOPUP|CMIF_TCHAR;
mi.ptszName = Frames[pos].TitleBar.tbname ? Frames[pos].TitleBar.tbname : Frames[pos].name;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)Frames[pos].MenuHandles.MITitle,(LPARAM)&mi);
@@ -1415,14 +1406,11 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam,LPARAM lParam) static int CLUIFramesLoadMainMenu()
{
- CLISTMENUITEM mi;
int i,separator;
if ( !(ServiceExists(MS_CLIST_REMOVEMAINMENUITEM))) {
- //hmm new menu system not used..so display only two items and warning message
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
// create "show all frames" menu
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.hIcon = NULL;//LoadIcon(g_hInst,MAKEINTRESOURCE(IDI_MIRANDA));
mi.flags = CMIF_GRAYED;
mi.position = 10000000;
@@ -1455,10 +1443,8 @@ static int CLUIFramesLoadMainMenu() MainMIRoot = (HGENMENU)-1;
}
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize = sizeof(mi);
-
// create root menu
+ CLISTMENUITEM mi = { sizeof(mi) };
mi.hIcon = LoadIcon(g_hInst,MAKEINTRESOURCE(IDI_CLIENTMIRANDA));
mi.flags = CMIF_ROOTPOPUP;
mi.position = 3000090000;
|