diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-24 15:02:42 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-24 15:02:42 +0000 |
commit | 727a0432f5909ba54e6d15010fde94dff825fe5e (patch) | |
tree | 2bca1de02335533dc2678c143e7b8ff088c25d47 | |
parent | 0ccdb951979ead80e9264233776b9147ff701fc7 (diff) |
fixes for MENUITEMINFO declarations
git-svn-id: http://svn.miranda-ng.org/main/trunk@14363 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
36 files changed, 152 insertions, 130 deletions
diff --git a/plugins/Alarms/src/alarm_win.cpp b/plugins/Alarms/src/alarm_win.cpp index 1dc974e01f..f4f4708fe2 100644 --- a/plugins/Alarms/src/alarm_win.cpp +++ b/plugins/Alarms/src/alarm_win.cpp @@ -270,15 +270,15 @@ INT_PTR CALLBACK DlgProcAlarm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar ScreenToClient(hwndDlg,&pt_rel);
HMENU hMenu = CreatePopupMenu();
- MENUITEMINFO mmi = {0};
- mmi.cbSize = sizeof(mmi);
- mmi.fMask = MIIM_ID | MIIM_STRING;
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
+ mii.fMask = MIIM_ID | MIIM_STRING;
#define AddItem(x) \
- mmi.wID++; \
- mmi.dwTypeData = TranslateT(x); \
- mmi.cch = ( UINT )mir_tstrlen(mmi.dwTypeData); \
- InsertMenuItem(hMenu, mmi.wID, FALSE, &mmi);
+ mii.wID++; \
+ mii.dwTypeData = TranslateT(x); \
+ mii.cch = ( UINT )mir_tstrlen(mii.dwTypeData); \
+ InsertMenuItem(hMenu, mii.wID, FALSE, &mii);
AddItem(LPGEN("5 mins"));
AddItem(LPGEN("15 mins"));
diff --git a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp index 57cf2ac25f..188639ecf0 100644 --- a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp +++ b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp @@ -100,7 +100,6 @@ int GroupMenuCheckService(WPARAM, LPARAM) INT_PTR GroupMenuonAddService(WPARAM wParam, LPARAM lParam)
{
-
MENUITEMINFO *mii = (MENUITEMINFO*)wParam;
if (mii == NULL)
return 0;
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index cabc2363da..db9139c4b6 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -105,7 +105,8 @@ CListEvent* cli_AddEvent(CLISTEVENT *cle) return NULL;
if (p->cle.hContact != 0 && p->cle.hDbEvent != 1 && !(p->cle.flags & CLEF_ONLYAFEW)) {
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii); mii.fMask = MIIM_DATA | MIIM_BITMAP | MIIM_ID;
if (p->cle.pszService &&
(!strncmp("SRMsg/ReadMessage", p->cle.pszService, _countof("SRMsg/ReadMessage")) ||
@@ -335,16 +336,13 @@ static int EventArea_DrawWorker(HWND hWnd, HDC hDC) }
else if (iCount > 0) {
MENUITEMINFO mii = { 0 };
- struct NotifyMenuItemExData *nmi;
- TCHAR *szName;
- int iIcon;
-
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_DATA;
GetMenuItemInfo(g_CluiData.hMenuNotify, iCount - 1, TRUE, &mii);
- nmi = (struct NotifyMenuItemExData *) mii.dwItemData;
- szName = pcli->pfnGetContactDisplayName(nmi->hContact, 0);
- iIcon = cli_GetContactIcon(nmi->hContact);
+
+ NotifyMenuItemExData *nmi = (struct NotifyMenuItemExData *) mii.dwItemData;
+ TCHAR *szName = pcli->pfnGetContactDisplayName(nmi->hContact, 0);
+ int iIcon = cli_GetContactIcon(nmi->hContact);
ske_ImageList_DrawEx(g_himlCListClc, iIcon, hDC, rc.left, (rc.bottom + rc.top - GetSystemMetrics(SM_CYSMICON)) / 2, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), CLR_NONE, CLR_NONE, ILD_NORMAL);
rc.left += 18;
ske_ImageList_DrawEx(g_himlCListClc, nmi->iIcon, hDC, 4, (rc.bottom + rc.top) / 2 - 8, 16, 16, CLR_NONE, CLR_NONE, ILD_NORMAL);
@@ -488,13 +486,14 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP case WM_COMMAND:
if (LOWORD(wParam) == IDC_NOTIFYBUTTON) {
int iSelection;
- MENUITEMINFO mii = { 0 };
- POINT pt;
struct NotifyMenuItemExData *nmi = 0;
int iCount = GetMenuItemCount(g_CluiData.hMenuNotify);
BOOL result;
+ POINT pt;
GetCursorPos(&pt);
+
+ MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_DATA;
if (iCount > 1)
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 7970ff7f31..3e8532ba70 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -251,7 +251,8 @@ HRESULT CLUI::CreateCluiFrames() {
g_hMenuMain = GetMenu(pcli->hwndContactList);
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_SUBMENU;
mii.hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN, 0, 0);
SetMenuItemInfo(g_hMenuMain, 0, TRUE, &mii);
@@ -1912,7 +1913,8 @@ LRESULT CLUI::OnCreate(UINT, WPARAM, LPARAM) DrawMenuBar(m_hWnd);
cliCluiProtocolStatusChanged(0, 0);
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_TYPE | MIIM_DATA;
mii.dwItemData = MENU_MIRANDAMENU;
mii.fType = MFT_OWNERDRAW;
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index 5bd9b5db27..faea096349 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -1086,7 +1086,8 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM goto clvm_reset_command;
TCHAR szTemp[256];
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_STRING;
mii.dwTypeData = szTemp;
mii.cch = 256;
diff --git a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp index cbce3fa8a4..d203d954c9 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp +++ b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp @@ -108,7 +108,8 @@ INT_PTR GroupMenuCheckService(WPARAM, LPARAM) INT_PTR GroupMenuonAddService(WPARAM wParam, LPARAM lParam)
{
MENUITEMINFO *mii = (MENUITEMINFO *)wParam;
- if (mii == NULL) return 0;
+ if (mii == NULL)
+ return 0;
if (hHideShowMainMenuItem == (HANDLE)lParam) {
mii->fMask |= MIIM_STATE;
@@ -418,7 +419,8 @@ INT_PTR SubGroupMenuCheckService(WPARAM, LPARAM) INT_PTR SubGroupMenuonAddService(WPARAM wParam, LPARAM)
{
MENUITEMINFO *mii = (MENUITEMINFO *)wParam;
- if (mii == NULL) return 0;
+ if (mii == NULL)
+ return 0;
/*
if (hHideShowMainMenuItem == (HANDLE)lParam) {
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp index 47fe8121d9..9d7e722d8b 100644 --- a/plugins/Clist_nicer/src/clistevents.cpp +++ b/plugins/Clist_nicer/src/clistevents.cpp @@ -158,20 +158,21 @@ LRESULT CALLBACK EventAreaWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa case WM_COMMAND:
if (LOWORD(wParam) == IDC_NOTIFYBUTTON) {
int iSelection;
- MENUITEMINFO mii = { 0 };
- POINT pt;
struct NotifyMenuItemExData *nmi = 0;
int iCount = GetMenuItemCount(cfg::dat.hMenuNotify);
- BOOL result;
+ POINT pt;
GetCursorPos(&pt);
+
+ MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_DATA;
if (iCount > 1)
iSelection = TrackPopupMenu(cfg::dat.hMenuNotify, TPM_RETURNCMD, pt.x, pt.y, 0, hwnd, NULL);
else
iSelection = GetMenuItemID(cfg::dat.hMenuNotify, 0);
- result = GetMenuItemInfo(cfg::dat.hMenuNotify, (UINT)iSelection, FALSE, &mii);
+
+ BOOL result = GetMenuItemInfo(cfg::dat.hMenuNotify, (UINT)iSelection, FALSE, &mii);
if (result != 0) {
nmi = (struct NotifyMenuItemExData *) mii.dwItemData;
if (nmi) {
@@ -260,7 +261,8 @@ CListEvent* AddEvent(CLISTEVENT *cle) return NULL;
if (p->cle.hContact != 0 && p->cle.hDbEvent != 1 && !(p->cle.flags & CLEF_ONLYAFEW)) {
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_DATA | MIIM_BITMAP | MIIM_ID;
if (p->cle.pszService && !strncmp("SRMsg/ReadMessage", p->cle.pszService, 17)) {
// dup check only for msg events
diff --git a/plugins/FavContacts/src/menu.cpp b/plugins/FavContacts/src/menu.cpp index 2bb6fef449..7481d07879 100644 --- a/plugins/FavContacts/src/menu.cpp +++ b/plugins/FavContacts/src/menu.cpp @@ -413,7 +413,8 @@ static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam, return MAKELRESULT(1, MNC_SELECT);
case WM_MENURBUTTONUP:
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_DATA;
GetMenuItemInfo((HMENU)lParam, wParam, TRUE, &mii);
MCONTACT hContact = (MCONTACT)mii.dwItemData;
diff --git a/plugins/MirOTR/src/mirotrmenu.cpp b/plugins/MirOTR/src/mirotrmenu.cpp index 87807a5ee2..55dad23416 100644 --- a/plugins/MirOTR/src/mirotrmenu.cpp +++ b/plugins/MirOTR/src/mirotrmenu.cpp @@ -139,7 +139,8 @@ INT_PTR FreeOwnerDataMirOTRMenu(WPARAM, LPARAM lParam) INT_PTR OnAddMenuItemMirOTRMenu(WPARAM wParam, LPARAM lParam) { MENUITEMINFO *mii = (MENUITEMINFO*)wParam; - if (!mii || mii->cbSize != sizeof(MENUITEMINFO)) return 0; + if (!mii || mii->cbSize != sizeof(MENUITEMINFO)) + return 0; TMO_MenuItem mi; if (CallService(MO_GETMENUITEM, (WPARAM)lParam, (LPARAM)&mi) == 0) { diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index c967676e73..e2e4884cb9 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -1407,7 +1407,6 @@ void ShowProtocolStatusMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto int count = GetMenuItemCount(menu);
for (int i = 0; i < count && submenu == NULL; i++) {
MENUITEMINFO mii = { 0 };
-
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_STRING;
@@ -1660,7 +1659,8 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar HMENU menu = CreatePopupMenu();
for (int i = protocols->GetSize() - 1; i >= 0; i--) {
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE;
mii.fType = MFT_STRING;
mii.dwTypeData = protocols->Get(i)->description;
@@ -1886,11 +1886,9 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar // Add this proto to menu
TCHAR tmp[128];
- MENUITEMINFO mii = { 0 };
-
mir_sntprintf(tmp, _countof(tmp), TranslateT("Enable listening to for %s"), proto->description);
- memset(&mii, 0, sizeof(mii));
+ MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE;
mii.fType = MFT_STRING;
diff --git a/plugins/NotesAndReminders/src/notes.cpp b/plugins/NotesAndReminders/src/notes.cpp index 3f553dee1e..8ad6753abf 100644 --- a/plugins/NotesAndReminders/src/notes.cpp +++ b/plugins/NotesAndReminders/src/notes.cpp @@ -1833,15 +1833,14 @@ static void InitListView(HWND AHLV) static BOOL DoListContextMenu(HWND AhWnd,WPARAM wParam,LPARAM lParam,STICKYNOTE *pNote) { - HWND hwndListView; - HMENU hMenuLoad,FhMenu; - MENUITEMINFO mii; - - hwndListView = (HWND)wParam; - if (hwndListView != GetDlgItem(AhWnd,IDC_LISTREMINDERS)) return FALSE; - hMenuLoad = LoadMenu(hinstance,"MNU_NOTELISTPOPUP"); - FhMenu = GetSubMenu(hMenuLoad,0); - + HWND hwndListView = (HWND)wParam; + if (hwndListView != GetDlgItem(AhWnd,IDC_LISTREMINDERS)) + return FALSE; + + HMENU hMenuLoad = LoadMenu(hinstance,"MNU_NOTELISTPOPUP"); + HMENU FhMenu = GetSubMenu(hMenuLoad,0); + + MENUITEMINFO mii = { 0 }; mii.cbSize = sizeof(mii); mii.fMask = MIIM_STATE; mii.fState = MFS_DEFAULT; diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp index 192ea34e5c..8e4238cff7 100644 --- a/plugins/NotesAndReminders/src/reminders.cpp +++ b/plugins/NotesAndReminders/src/reminders.cpp @@ -2343,7 +2343,7 @@ static BOOL DoListContextMenu(HWND AhWnd,WPARAM wParam,LPARAM lParam,REMINDERDAT HMENU hMenuLoad = LoadMenu(hinstance, _T("MNU_REMINDERPOPUP"));
HMENU FhMenu = GetSubMenu(hMenuLoad, 0);
- MENUITEMINFO mii;
+ MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_STATE;
mii.fState = MFS_DEFAULT;
diff --git a/plugins/Scriver/src/chat/tools.cpp b/plugins/Scriver/src/chat/tools.cpp index 280700fbcb..43aa5c669f 100644 --- a/plugins/Scriver/src/chat/tools.cpp +++ b/plugins/Scriver/src/chat/tools.cpp @@ -108,13 +108,13 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s void DestroyGCMenu(HMENU *hMenu, int iIndex)
{
- MENUITEMINFO mi;
- mi.cbSize = sizeof(mi);
- mi.fMask = MIIM_SUBMENU;
- while(GetMenuItemInfo(*hMenu, iIndex, TRUE, &mi))
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
+ mii.fMask = MIIM_SUBMENU;
+ while(GetMenuItemInfo(*hMenu, iIndex, TRUE, &mii))
{
- if (mi.hSubMenu != NULL)
- DestroyMenu(mi.hSubMenu);
+ if (mii.hSubMenu != NULL)
+ DestroyMenu(mii.hSubMenu);
RemoveMenu(*hMenu, iIndex, MF_BYPOSITION);
}
}
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index 1ad222c2d8..00f1cf85da 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -1920,7 +1920,8 @@ LABEL_SHOWWINDOW: case WM_RBUTTONUP:
hToolbarMenu = CreatePopupMenu();
for (int i = 0; i < _countof(toolbarButtons); i++) {
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_STRING | MIIM_STATE | MIIM_DATA | MIIM_BITMAP;
mii.fType = MFT_STRING;
mii.fState = (g_dat.chatBbuttonVisibility & (1 << i)) ? MFS_CHECKED : MFS_UNCHECKED;
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 5157c96e90..e2b3448e1b 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -927,7 +927,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_RBUTTONUP:
hToolbarMenu = CreatePopupMenu();
for (int i = 0; i < _countof(toolbarButtons); i++) {
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_STRING | MIIM_STATE | MIIM_DATA | MIIM_BITMAP;
mii.fType = MFT_STRING;
mii.fState = (g_dat.buttonVisibility & (1 << i)) ? MFS_CHECKED : MFS_UNCHECKED;
diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp index 4e650afb20..e5ed4b3a45 100644 --- a/plugins/Scriver/src/utils.cpp +++ b/plugins/Scriver/src/utils.cpp @@ -407,11 +407,12 @@ void SearchWord(TCHAR * word, int engine) void SetSearchEngineIcons(HMENU hMenu, HIMAGELIST hImageList)
{
for (int i = 0; i < IDI_LASTICON - IDI_GOOGLE; i++) {
- MENUITEMINFO minfo = { sizeof(minfo) };
- minfo.fMask = MIIM_BITMAP | MIIM_DATA;
- minfo.hbmpItem = HBMMENU_CALLBACK;
- minfo.dwItemData = (ULONG_PTR)hImageList;
- SetMenuItemInfo(hMenu, IDM_SEARCH_GOOGLE + i, FALSE, &minfo);
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
+ mii.fMask = MIIM_BITMAP | MIIM_DATA;
+ mii.hbmpItem = HBMMENU_CALLBACK;
+ mii.dwItemData = (ULONG_PTR)hImageList;
+ SetMenuItemInfo(hMenu, IDM_SEARCH_GOOGLE + i, FALSE, &mii);
}
}
diff --git a/plugins/ShellExt/src/shlext.cpp b/plugins/ShellExt/src/shlext.cpp index 780d7f86e3..a8d87632f1 100644 --- a/plugins/ShellExt/src/shlext.cpp +++ b/plugins/ShellExt/src/shlext.cpp @@ -319,8 +319,8 @@ grouploop: static void BuildMenuGroupTree(TGroupNode *p, TEnumData *lParam, HMENU hLastMenu)
{
- MENUITEMINFOA mii;
- mii.cbSize = sizeof(MENUITEMINFO);
+ MENUITEMINFOA mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_DATA | MIIM_TYPE | MIIM_SUBMENU;
// go thru each group and create a menu for it adding submenus too.
@@ -398,7 +398,7 @@ static void BuildMenus(TEnumData *lParam) }
MENUITEMINFOA mii = { 0 };
- mii.cbSize = sizeof(MENUITEMINFO);
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_DATA;
// add all the contacts that have no group (which maybe all of them)
pg = lParam->ipch->ContactsBegin;
@@ -467,7 +467,7 @@ static void BuildMenus(TEnumData *lParam) // allocate display info/memory for "Miranda" string
- mii.cbSize = sizeof(MENUITEMINFO);
+ mii.cbSize = sizeof(mii);
if (bIsVistaPlus)
mii.fMask = MIIM_ID | MIIM_DATA | MIIM_FTYPE | MIIM_SUBMENU | MIIM_STRING | MIIM_BITMAP;
else
@@ -738,8 +738,8 @@ HRESULT ipcGetFiles(THeaderIPC *pipch, IDataObject* pDataObject, MCONTACT hConta HRESULT RequestTransfer(TShellExt *Self, int idxCmd)
{
// get the contact information
- MENUITEMINFOA mii;
- mii.cbSize = sizeof(MENUITEMINFO);
+ MENUITEMINFOA mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_DATA;
if ( !GetMenuItemInfoA(Self->hRootMenu, Self->idCmdFirst + idxCmd, false, &mii))
return E_INVALIDARG;
diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp index f712daa96d..83884c35ae 100644 --- a/plugins/SpellChecker/src/utils.cpp +++ b/plugins/SpellChecker/src/utils.cpp @@ -1047,8 +1047,8 @@ TCHAR *GetWordUnderPoint(Dialog *dlg, POINT pt, CHARRANGE &sel) void AppendSubmenu(HMENU hMenu, HMENU hSubMenu, TCHAR *name)
{
- MENUITEMINFO mii = { sizeof(mii) };
- mii.cbSize = sizeof(MENUITEMINFO);
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_SUBMENU | MIIM_TYPE;
mii.fType = MFT_STRING;
mii.hSubMenu = hSubMenu;
@@ -1062,7 +1062,8 @@ void AppendMenuItem(HMENU hMenu, int id, TCHAR *name, HICON hIcon, BOOL checked) ICONINFO iconInfo;
GetIconInfo(hIcon, &iconInfo);
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii); mii.fMask = MIIM_CHECKMARKS | MIIM_TYPE | MIIM_STATE;
mii.fType = MFT_STRING;
mii.fState = (checked ? MFS_CHECKED : 0);
@@ -1456,7 +1457,7 @@ LRESULT CALLBACK MenuWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) continue;
MENUITEMINFO mii = { 0 };
- mii.cbSize = sizeof(MENUITEMINFO);
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_STATE;
GetMenuItemInfo(hMenu, id, FALSE, &mii);
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index f9d2f56a46..c9e5e5cfd7 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -598,11 +598,12 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO void DestroyGCMenu(HMENU *hMenu, int iIndex)
{
- MENUITEMINFO mi = { sizeof(MENUITEMINFO) };
- mi.fMask = MIIM_SUBMENU;
- while (GetMenuItemInfo(*hMenu, iIndex, TRUE, &mi)) {
- if (mi.hSubMenu != NULL)
- DestroyMenu(mi.hSubMenu);
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
+ mii.fMask = MIIM_SUBMENU;
+ while (GetMenuItemInfo(*hMenu, iIndex, TRUE, &mii)) {
+ if (mii.hSubMenu != NULL)
+ DestroyMenu(mii.hSubMenu);
RemoveMenu(*hMenu, iIndex, MF_BYPOSITION);
}
}
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 0ed7ff9f4c..4074f5966c 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -702,7 +702,8 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro WORD wMyStatus = (wStatus == 0) ? db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE) : wStatus;
const TCHAR *szMyStatus = (szStatus == NULL) ? pcli->pfnGetStatusModeDescription(wMyStatus, 0) : szStatus;
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_DATA | MIIM_ID | MIIM_BITMAP;
mii.wID = (UINT)hContact;
mii.hbmpItem = HBMMENU_CALLBACK;
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp index 5c7faa7def..5d180f3694 100644 --- a/plugins/TabSRMM/src/hotkeyhandler.cpp +++ b/plugins/TabSRMM/src/hotkeyhandler.cpp @@ -302,7 +302,6 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP BOOL iSelection = TrackPopupMenu(submenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL);
if (iSelection) {
MENUITEMINFO mii = { 0 };
-
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_DATA | MIIM_ID;
GetMenuItemInfo(submenu, (UINT_PTR)iSelection, FALSE, &mii);
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 3925cde528..ad4936ee95 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -259,11 +259,12 @@ int TSAPI MsgWindowUpdateMenu(TWindowData *dat, HMENU submenu, int menuID) EnableMenuItem(submenu, ID_TABMENU_CLEARSAVEDTABPOSITION, (M.GetDword(dat->hContact, "tabindex", -1) != -1) ? MF_ENABLED : MF_GRAYED);
}
else if (menuID == MENU_PICMENU) {
- MENUITEMINFO mii = { 0 };
TCHAR *szText = NULL;
char avOverride = (char)M.GetByte(dat->hContact, "hideavatar", -1);
HMENU visMenu = GetSubMenu(submenu, 0);
BOOL picValid = bInfoPanel ? (dat->hOwnPic != 0) : (dat->ace && dat->ace->hbmPic && dat->ace->hbmPic != PluginConfig.g_hbmUnknown);
+
+ MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_STRING;
diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp index 98fdaf9c06..2bea40a6ed 100644 --- a/plugins/TabSRMM/src/trayicon.cpp +++ b/plugins/TabSRMM/src/trayicon.cpp @@ -191,9 +191,8 @@ void TSAPI FlashTrayIcon(HICON hIcon) void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, const char *szProto, TCHAR *szStatus, WORD wStatus, HICON hIcon, BOOL mode, HMENU hMenu)
{
- MENUITEMINFO mii = { 0 };
- TCHAR szMenuEntry[80];
- TCHAR szFinalNick[100];
+ TCHAR szMenuEntry[80];
+ TCHAR szFinalNick[100];
if (szNickname == NULL)
_tcsncpy_s(szFinalNick, pcli->pfnGetContactDisplayName(hContact, 0), _TRUNCATE);
@@ -216,6 +215,7 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, con PROTOACCOUNT *acc = Proto_GetAccount(szProto);
if (acc && acc->tszAccountName) {
+ MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mir_sntprintf(szMenuEntry, _countof(szMenuEntry), _T("%s: %s (%s)"), acc->tszAccountName, szFinalNick, szStatus);
if (mode) {
@@ -236,9 +236,10 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, con AppendMenu(hMenu, MF_BYCOMMAND, (UINT_PTR)hContact, szMenuEntry);
}
else if (hMenu == PluginConfig.g_hMenuFavorites) { // insert the item sorted...
- MENUITEMINFO mii2 = { 0 };
TCHAR szBuffer[142];
int i, c = GetMenuItemCount(PluginConfig.g_hMenuFavorites);
+
+ MENUITEMINFO mii2 = { 0 };
mii2.fMask = MIIM_STRING;
mii2.cbSize = sizeof(mii2);
if (c == 0)
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index 68844d70d1..1bf9e30517 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -802,7 +802,7 @@ void Utils::getIconSize(HICON hIcon, int& sizeX, int& sizeY) // @param uID the item command id
// @param pos zero-based position index
-void Utils::addMenuItem(const HMENU& m, MENUITEMINFO& mii, HICON hIcon, const TCHAR *szText, UINT uID, UINT pos)
+void Utils::addMenuItem(const HMENU& m, MENUITEMINFO &mii, HICON hIcon, const TCHAR *szText, UINT uID, UINT pos)
{
mii.wID = uID;
mii.dwItemData = (ULONG_PTR)hIcon;
diff --git a/plugins/UserInfoEx/src/classPsTree.cpp b/plugins/UserInfoEx/src/classPsTree.cpp index 15b6bf5f8a..033ce4c271 100644 --- a/plugins/UserInfoEx/src/classPsTree.cpp +++ b/plugins/UserInfoEx/src/classPsTree.cpp @@ -717,7 +717,6 @@ int CPsTree::EndLabelEdit(const BYTE bSave) void CPsTree::PopupMenu() { HMENU hPopup; - MENUITEMINFO mii; TVHITTESTINFO hti; TVITEM tvi; POINT pt; @@ -726,7 +725,8 @@ void CPsTree::PopupMenu() // init popup menu if (!(hPopup = CreatePopupMenu())) return; - memset(&mii, 0, sizeof(MENUITEMINFO)); + + MENUITEMINFO mii = { 0 }; mii.cbSize = sizeof(mii); mii.fMask = MIIM_STRING|MIIM_ID; diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.cpp b/plugins/UserInfoEx/src/ctrl_annivedit.cpp index cf8a7ef0d7..25454e73c3 100644 --- a/plugins/UserInfoEx/src/ctrl_annivedit.cpp +++ b/plugins/UserInfoEx/src/ctrl_annivedit.cpp @@ -432,15 +432,14 @@ void CAnnivEditCtrl::OnMenuPopup() {
POINT pt = { 0, 0 };
RECT rc;
- MENUITEMINFO mii;
HMENU hMenu;
WORD i;
if (hMenu = CreatePopupMenu()) {
SetFocus(_hBtnMenu);
- memset(&mii, 0, sizeof(MENUITEMINFO));
- mii.cbSize = sizeof(MENUITEMINFO);
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID|MIIM_STRING|MIIM_STATE;
// insert the items
diff --git a/plugins/UserInfoEx/src/ctrl_contact.cpp b/plugins/UserInfoEx/src/ctrl_contact.cpp index 7576bf10e6..b8780f5b7b 100644 --- a/plugins/UserInfoEx/src/ctrl_contact.cpp +++ b/plugins/UserInfoEx/src/ctrl_contact.cpp @@ -605,15 +605,14 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (HIWORD(wParam) == BN_CLICKED) {
POINT pt = { 0, 0 };
RECT rc;
- MENUITEMINFO mii;
int i, nItems;
HMENU hMenu;
if (!(hMenu = CreatePopupMenu())) return 0;
SetFocus((HWND)lParam);
- memset(&mii, 0, sizeof(MENUITEMINFO));
- mii.cbSize = sizeof(MENUITEMINFO);
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID|MIIM_STRING|MIIM_FTYPE|MIIM_STATE;
mii.fType = MFT_STRING;
diff --git a/plugins/UserInfoEx/src/psp_profile.cpp b/plugins/UserInfoEx/src/psp_profile.cpp index c8773a3419..1cf4dfff49 100644 --- a/plugins/UserInfoEx/src/psp_profile.cpp +++ b/plugins/UserInfoEx/src/psp_profile.cpp @@ -1258,7 +1258,6 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR case NM_RCLICK:
{
HMENU hMenu = CreatePopupMenu();
- MENUITEMINFO mii;
MCONTACT hContact;
LVHITTESTINFO hi;
LPLCITEM pItem;
@@ -1274,8 +1273,8 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR pItem = ProfileList_GetItemData(((LPNMHDR)lParam)->hwndFrom, hi.iItem);
// insert menuitems
- memset(&mii, 0, sizeof(MENUITEMINFO));
- mii.cbSize = sizeof(MENUITEMINFO);
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID|MIIM_STRING;
// insert "Add" Menuitem
mii.wID = BTN_ADD_intEREST;
diff --git a/src/core/stdchat/src/tools.cpp b/src/core/stdchat/src/tools.cpp index 33f2988432..6d8bc79d6a 100644 --- a/src/core/stdchat/src/tools.cpp +++ b/src/core/stdchat/src/tools.cpp @@ -189,12 +189,12 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO void DestroyGCMenu(HMENU *hMenu, int iIndex)
{
- MENUITEMINFO mi;
- mi.cbSize = sizeof(mi);
- mi.fMask = MIIM_SUBMENU;
- while (GetMenuItemInfo(*hMenu, iIndex, TRUE, &mi)) {
- if (mi.hSubMenu != NULL)
- DestroyMenu(mi.hSubMenu);
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
+ mii.fMask = MIIM_SUBMENU;
+ while (GetMenuItemInfo(*hMenu, iIndex, TRUE, &mii)) {
+ if (mii.hSubMenu != NULL)
+ DestroyMenu(mii.hSubMenu);
RemoveMenu(*hMenu, iIndex, MF_BYPOSITION);
}
}
diff --git a/src/mir_app/src/clistmenus.cpp b/src/mir_app/src/clistmenus.cpp index 47e2fa473e..8d7725c402 100644 --- a/src/mir_app/src/clistmenus.cpp +++ b/src/mir_app/src/clistmenus.cpp @@ -379,7 +379,8 @@ BOOL FindMenuHandleByGlobalID(HMENU hMenu, TMO_IntMenuItem *id, MenuItemData* it if (!itdat)
return FALSE;
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_SUBMENU | MIIM_DATA;
for (int i = GetMenuItemCount(hMenu) - 1; i >= 0; i--) {
GetMenuItemInfo(hMenu, i, TRUE, &mii);
@@ -445,25 +446,25 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM) MenuItemData it = { 0 };
if (FindMenuHandleByGlobalID(hStatusMenu, timiParent, &it)) {
- MENUITEMINFO mi = { 0 };
TCHAR d[100];
GetMenuString(it.OwnerMenu, it.position, d, _countof(d), MF_BYPOSITION);
- mi.cbSize = sizeof(mi);
- mi.fMask = MIIM_STRING | MIIM_STATE;
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
+ mii.fMask = MIIM_STRING | MIIM_STATE;
if (timi->iconId != -1) {
- mi.fMask |= MIIM_BITMAP;
+ mii.fMask |= MIIM_BITMAP;
if (IsWinVerVistaPlus() && IsThemeActive()) {
if (timi->hBmp == NULL)
timi->hBmp = ConvertIconToBitmap(NULL, timi->parent->m_hMenuIcons, timi->iconId);
- mi.hbmpItem = timi->hBmp;
+ mii.hbmpItem = timi->hBmp;
}
- else mi.hbmpItem = HBMMENU_CALLBACK;
+ else mii.hbmpItem = HBMMENU_CALLBACK;
}
- mi.fState |= (check && !reset ? MFS_CHECKED : MFS_UNCHECKED);
- mi.dwTypeData = ptszName;
- SetMenuItemInfo(it.OwnerMenu, it.position, TRUE, &mi);
+ mii.fState |= (check && !reset ? MFS_CHECKED : MFS_UNCHECKED);
+ mii.dwTypeData = ptszName;
+ SetMenuItemInfo(it.OwnerMenu, it.position, TRUE, &mii);
}
Menu_ModifyItem(timi->mi.root, ptszName);
@@ -657,7 +658,8 @@ BOOL FindMenuHanleByGlobalID(HMENU hMenu, TMO_IntMenuItem *id, MenuItemData* itd BOOL inSub = FALSE;
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_SUBMENU | MIIM_DATA;
for (int i = GetMenuItemCount(hMenu) - 1; i >= 0; i--) {
GetMenuItemInfo(hMenu, i, TRUE, &mii);
diff --git a/src/mir_app/src/clisttray.cpp b/src/mir_app/src/clisttray.cpp index 688ac9764d..2e45b26994 100644 --- a/src/mir_app/src/clisttray.cpp +++ b/src/mir_app/src/clisttray.cpp @@ -723,16 +723,16 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) HMENU hMenu = GetSubMenu(hMainMenu, 0);
TranslateMenu(hMenu);
- MENUITEMINFO mi = { 0 };
- mi.cbSize = sizeof(mi);
- mi.fMask = MIIM_SUBMENU | MIIM_TYPE;
- mi.fType = MFT_STRING;
- mi.hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN, 0, 0);
- mi.dwTypeData = TranslateT("&Main menu");
- InsertMenuItem(hMenu, 1, TRUE, &mi);
- mi.hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
- mi.dwTypeData = TranslateT("&Status");
- InsertMenuItem(hMenu, 2, TRUE, &mi);
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
+ mii.fMask = MIIM_SUBMENU | MIIM_TYPE;
+ mii.fType = MFT_STRING;
+ mii.hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN, 0, 0);
+ mii.dwTypeData = TranslateT("&Main menu");
+ InsertMenuItem(hMenu, 1, TRUE, &mii);
+ mii.hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
+ mii.dwTypeData = TranslateT("&Status");
+ InsertMenuItem(hMenu, 2, TRUE, &mii);
SetMenuDefaultItem(hMenu, ID_TRAY_HIDE, FALSE);
SetForegroundWindow(msg->hwnd);
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 141ed13b8c..018d4300f4 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -59,7 +59,8 @@ void fnLoadCluiGlobalOpts() static int CluiModulesLoaded(WPARAM, LPARAM)
{
if (cli.hMenuMain) {
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_SUBMENU;
mii.hSubMenu = (HMENU) CallService(MS_CLIST_MENUGETMAIN, 0, 0);
SetMenuItemInfo(cli.hMenuMain, 0, TRUE, &mii);
@@ -428,7 +429,8 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM switch (msg) {
case WM_NCCREATE:
{
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_TYPE | MIIM_DATA;
mii.dwItemData = MENU_MIRANDAMENU;
mii.fType = MFT_OWNERDRAW;
@@ -910,7 +912,8 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM POINT pt;
GetCursorPos(&pt);
if ((pos == 0 || pos == 1) && (HIWORD(wParam) & MF_POPUP) && (!(HIWORD(wParam) & MF_MOUSESELECT) || MenuItemFromPoint(hwnd, cli.hMenuMain, pt) != -1)) {
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_SUBMENU;
mii.hSubMenu = (HMENU)CallService((pos == 0) ? MS_CLIST_MENUGETMAIN : MS_CLIST_MENUGETSTATUS, 0, 0);
SetMenuItemInfo(cli.hMenuMain, pos, TRUE, &mii);
diff --git a/src/mir_app/src/genmenu.cpp b/src/mir_app/src/genmenu.cpp index 290f30d5bf..4a7036d37a 100644 --- a/src/mir_app/src/genmenu.cpp +++ b/src/mir_app/src/genmenu.cpp @@ -745,7 +745,8 @@ TMO_IntMenuItem *MO_AddOldNewMenuItem(HANDLE menuobjecthandle, TMO_MenuItem *pmi static int WhereToPlace(HMENU hMenu, TMO_MenuItem *mi)
{
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_SUBMENU | MIIM_DATA;
for (int i = GetMenuItemCount(hMenu) - 1; i >= 0; i--) {
GetMenuItemInfo(hMenu, i, TRUE, &mii);
@@ -764,7 +765,8 @@ static int WhereToPlace(HMENU hMenu, TMO_MenuItem *mi) static DWORD GetMenuItemType(HMENU hMenu, int uItem)
{
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_TYPE;
GetMenuItemInfo(hMenu, uItem, TRUE, &mii);
return mii.fType;
@@ -772,7 +774,8 @@ static DWORD GetMenuItemType(HMENU hMenu, int uItem) static UINT GetMenuItemTypeData(HMENU hMenu, int uItem, TMO_IntMenuItem* &p)
{
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_DATA | MIIM_TYPE;
GetMenuItemInfo(hMenu, uItem, TRUE, &mii);
p = MO_GetIntMenuItem((HGENMENU)mii.dwItemData);
@@ -781,7 +784,8 @@ static UINT GetMenuItemTypeData(HMENU hMenu, int uItem, TMO_IntMenuItem* &p) static void InsertSeparator(HMENU hMenu, int uItem)
{
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_TYPE;
mii.fType = MFT_SEPARATOR;
InsertMenuItem(hMenu, uItem, TRUE, &mii);
@@ -944,7 +948,8 @@ HMENU BuildRecursiveMenu(HMENU hMenu, TMO_IntMenuItem *pRootMenu, ListParam *par int i = WhereToPlace(hMenu, mi);
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.dwItemData = (LPARAM)pmi;
mii.fMask = MIIM_DATA | MIIM_ID | MIIM_STRING;
if (pmi->iconId != -1) {
diff --git a/src/mir_app/src/groups.cpp b/src/mir_app/src/groups.cpp index 9775eb39ba..c342ca8b8c 100644 --- a/src/mir_app/src/groups.cpp +++ b/src/mir_app/src/groups.cpp @@ -480,7 +480,8 @@ static INT_PTR BuildGroupMenu(WPARAM, LPARAM) pNextField = dbv.ptszVal + 1;
hThisMenu = hRootMenu;
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
do {
pBackslash = _tcschr(pNextField, '\\');
if (pBackslash == NULL) {
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp index 2379458374..20b09ae5c4 100644 --- a/src/mir_app/src/meta_services.cpp +++ b/src/mir_app/src/meta_services.cpp @@ -593,7 +593,8 @@ static int Meta_SrmmIconClicked(WPARAM hMeta, LPARAM lParam) HMENU hMenu = CreatePopupMenu();
int iDefault = Meta_GetContactNumber(cc, db_mc_getSrmmSub(cc->contactID));
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_STATE | MIIM_STRING;
for (int i = 0; i < cc->nSubs; i++) {
char *szProto = GetContactProto(cc->pSubs[i]);
diff --git a/src/mir_core/src/langpack.cpp b/src/mir_core/src/langpack.cpp index 9f048b21ec..c93dee0a3e 100644 --- a/src/mir_core/src/langpack.cpp +++ b/src/mir_core/src/langpack.cpp @@ -522,7 +522,9 @@ MIR_CORE_DLL(void) TranslateMenu_LP(HMENU hMenu, int hLangpack) {
MUUID *uuid = Langpack_LookupUuid(hLangpack);
- MENUITEMINFO mii = { sizeof(mii) };
+ MENUITEMINFO mii = { 0 };
+ mii.cbSize = sizeof(mii);
+
for (int i = GetMenuItemCount(hMenu) - 1; i >= 0; i--) {
TCHAR str[256];
mii.fMask = MIIM_TYPE | MIIM_SUBMENU;
|