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 /plugins/TabSRMM | |
parent | 0ccdb951979ead80e9264233776b9147ff701fc7 (diff) |
fixes for MENUITEMINFO declarations
git-svn-id: http://svn.miranda-ng.org/main/trunk@14363 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r-- | plugins/TabSRMM/src/chat/tools.cpp | 11 | ||||
-rw-r--r-- | plugins/TabSRMM/src/eventpopups.cpp | 3 | ||||
-rw-r--r-- | plugins/TabSRMM/src/hotkeyhandler.cpp | 1 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.cpp | 3 | ||||
-rw-r--r-- | plugins/TabSRMM/src/trayicon.cpp | 9 | ||||
-rw-r--r-- | plugins/TabSRMM/src/utils.cpp | 2 |
6 files changed, 16 insertions, 13 deletions
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;
|