diff options
Diffstat (limited to 'src/modules/clist')
-rw-r--r-- | src/modules/clist/clistmenus.cpp | 35 | ||||
-rw-r--r-- | src/modules/clist/clisttray.cpp | 3 | ||||
-rw-r--r-- | src/modules/clist/clui.cpp | 7 | ||||
-rw-r--r-- | src/modules/clist/genmenu.cpp | 41 | ||||
-rw-r--r-- | src/modules/clist/groups.cpp | 4 |
5 files changed, 32 insertions, 58 deletions
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp index 3540aee387..1ae87be532 100644 --- a/src/modules/clist/clistmenus.cpp +++ b/src/modules/clist/clistmenus.cpp @@ -406,8 +406,7 @@ BOOL FindMenuHandleByGlobalID(HMENU hMenu, PMO_IntMenuItem id, MenuItemData* itd if ( !itdat)
return FALSE;
- MENUITEMINFO mii = {0};
- mii.cbSize = MENUITEMINFO_V4_SIZE;
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_SUBMENU | MIIM_DATA;
for (int i = GetMenuItemCount(hMenu)-1; i >= 0; i--) {
GetMenuItemInfo(hMenu, i, TRUE, &mii);
@@ -480,24 +479,16 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM) TCHAR d[100];
GetMenuString(it.OwnerMenu, it.position, d, SIZEOF(d), MF_BYPOSITION);
- if ( !IsWinVer98Plus()) {
- mi.cbSize = MENUITEMINFO_V4_SIZE;
- mi.fMask = MIIM_TYPE | MIIM_STATE;
- mi.fType = MFT_STRING;
- }
- else {
- mi.cbSize = sizeof(mi);
- mi.fMask = MIIM_STRING | MIIM_STATE;
- if (timi->iconId != -1) {
- mi.fMask |= MIIM_BITMAP;
- if (IsWinVerVistaPlus() && IsThemeActive()) {
- if (timi->hBmp == NULL)
- timi->hBmp = ConvertIconToBitmap(NULL, timi->parent->m_hMenuIcons, timi->iconId);
- mi.hbmpItem = timi->hBmp;
- }
- else
- mi.hbmpItem = HBMMENU_CALLBACK;
+ mi.cbSize = sizeof(mi);
+ mi.fMask = MIIM_STRING | MIIM_STATE;
+ if (timi->iconId != -1) {
+ mi.fMask |= MIIM_BITMAP;
+ if (IsWinVerVistaPlus() && IsThemeActive()) {
+ if (timi->hBmp == NULL)
+ timi->hBmp = ConvertIconToBitmap(NULL, timi->parent->m_hMenuIcons, timi->iconId);
+ mi.hbmpItem = timi->hBmp;
}
+ else mi.hbmpItem = HBMMENU_CALLBACK;
}
mi.fState |= (check && !reset ? MFS_CHECKED : MFS_UNCHECKED);
@@ -710,8 +701,7 @@ BOOL FindMenuHanleByGlobalID(HMENU hMenu, PMO_IntMenuItem id, MenuItemData* itda BOOL inSub = FALSE;
- MENUITEMINFO mii = {0};
- mii.cbSize = MENUITEMINFO_V4_SIZE;
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_SUBMENU | MIIM_DATA;
for (int i = GetMenuItemCount(hMenu)-1; i >= 0; i--) {
GetMenuItemInfo(hMenu, i, TRUE, &mii);
@@ -1395,8 +1385,7 @@ void InitCustomMenus(void) cli.currentStatusMenuItem = ID_STATUS_OFFLINE;
cli.currentDesiredStatusMode = ID_STATUS_OFFLINE;
- if (IsWinVer98Plus())
- HookEvent(ME_SKIN_ICONSCHANGED, MenuIconsChanged);
+ HookEvent(ME_SKIN_ICONSCHANGED, MenuIconsChanged);
}
void UninitCustomMenus(void)
diff --git a/src/modules/clist/clisttray.cpp b/src/modules/clist/clisttray.cpp index 9d337f33ab..518580d531 100644 --- a/src/modules/clist/clisttray.cpp +++ b/src/modules/clist/clisttray.cpp @@ -737,8 +737,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) HMENU hMenu = GetSubMenu(hMainMenu, 0);
TranslateMenu(hMenu);
- MENUITEMINFO mi = { 0 };
- mi.cbSize = MENUITEMINFO_V4_SIZE;
+ MENUITEMINFO mi = { sizeof(mi) };
mi.fMask = MIIM_SUBMENU | MIIM_TYPE;
mi.fType = MFT_STRING;
mi.hSubMenu = (HMENU) CallService(MS_CLIST_MENUGETMAIN, 0, 0);
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp index af5b739943..cb277cbeed 100644 --- a/src/modules/clist/clui.cpp +++ b/src/modules/clist/clui.cpp @@ -58,8 +58,7 @@ void fnLoadCluiGlobalOpts() static int CluiModulesLoaded(WPARAM, LPARAM)
{
if (cli.hMenuMain) {
- MENUITEMINFO mii = { 0 };
- mii.cbSize = MENUITEMINFO_V4_SIZE;
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_SUBMENU;
mii.hSubMenu = (HMENU) CallService(MS_CLIST_MENUGETMAIN, 0, 0);
SetMenuItemInfo(cli.hMenuMain, 0, TRUE, &mii);
@@ -449,7 +448,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM switch (msg) {
case WM_NCCREATE:
{
- MENUITEMINFO mii = { MENUITEMINFO_V4_SIZE };
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_TYPE | MIIM_DATA;
mii.dwItemData = MENU_MIRANDAMENU;
mii.fType = MFT_OWNERDRAW;
@@ -931,7 +930,7 @@ 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 = { MENUITEMINFO_V4_SIZE };
+ MENUITEMINFO mii = { 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/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp index 333624777a..b6d3af6cec 100644 --- a/src/modules/clist/genmenu.cpp +++ b/src/modules/clist/genmenu.cpp @@ -740,8 +740,7 @@ PMO_IntMenuItem MO_AddOldNewMenuItem(HANDLE menuobjecthandle, PMO_MenuItem pmi) static int WhereToPlace(HMENU hMenu, PMO_MenuItem mi)
{
- MENUITEMINFO mii = { 0 };
- mii.cbSize = MENUITEMINFO_V4_SIZE;
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_SUBMENU | MIIM_DATA;
for (int i = GetMenuItemCount(hMenu)-1; i >= 0; i--) {
GetMenuItemInfo(hMenu, i, TRUE, &mii);
@@ -760,8 +759,7 @@ static int WhereToPlace(HMENU hMenu, PMO_MenuItem mi) static DWORD GetMenuItemType(HMENU hMenu, int uItem)
{
- MENUITEMINFO mii = { 0 };
- mii.cbSize = MENUITEMINFO_V4_SIZE;
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_TYPE;
GetMenuItemInfo(hMenu, uItem, TRUE, &mii);
return mii.fType;
@@ -769,8 +767,7 @@ static DWORD GetMenuItemType(HMENU hMenu, int uItem) static UINT GetMenuItemTypeData(HMENU hMenu, int uItem, PMO_IntMenuItem& p)
{
- MENUITEMINFO mii = { 0 };
- mii.cbSize = MENUITEMINFO_V4_SIZE;
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_DATA | MIIM_TYPE;
GetMenuItemInfo(hMenu, uItem, TRUE, &mii);
p = MO_GetIntMenuItem((HGENMENU)mii.dwItemData);
@@ -779,8 +776,7 @@ static UINT GetMenuItemTypeData(HMENU hMenu, int uItem, PMO_IntMenuItem& p) static void InsertSeparator(HMENU hMenu, int uItem)
{
- MENUITEMINFO mii;
- mii.cbSize = MENUITEMINFO_V4_SIZE;
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_TYPE;
mii.fType = MFT_SEPARATOR;
InsertMenuItem(hMenu, uItem, TRUE, &mii);
@@ -944,28 +940,19 @@ HMENU BuildRecursiveMenu(HMENU hMenu, PMO_IntMenuItem pRootMenu, ListParam *para if (rootlevel != (int)pmi->mi.root)
continue;
- MENUITEMINFO mii = { 0 };
- mii.dwItemData = (LPARAM)pmi;
-
int i = WhereToPlace(hMenu, mi);
- if ( !IsWinVer98Plus()) {
- mii.cbSize = MENUITEMINFO_V4_SIZE;
- mii.fMask = MIIM_DATA | MIIM_TYPE | MIIM_ID;
- mii.fType = MFT_STRING;
- }
- else {
- mii.cbSize = sizeof(mii);
- mii.fMask = MIIM_DATA | MIIM_ID | MIIM_STRING;
- if (pmi->iconId != -1) {
- mii.fMask |= MIIM_BITMAP;
- if (IsWinVerVistaPlus() && IsThemeActive()) {
- if (pmi->hBmp == NULL)
- pmi->hBmp = ConvertIconToBitmap(NULL, pmi->parent->m_hMenuIcons, pmi->iconId);
- mii.hbmpItem = pmi->hBmp;
- }
- else mii.hbmpItem = HBMMENU_CALLBACK;
+ MENUITEMINFO mii = { sizeof(mii) };
+ mii.dwItemData = (LPARAM)pmi;
+ mii.fMask = MIIM_DATA | MIIM_ID | MIIM_STRING;
+ if (pmi->iconId != -1) {
+ mii.fMask |= MIIM_BITMAP;
+ if (IsWinVerVistaPlus() && IsThemeActive()) {
+ if (pmi->hBmp == NULL)
+ pmi->hBmp = ConvertIconToBitmap(NULL, pmi->parent->m_hMenuIcons, pmi->iconId);
+ mii.hbmpItem = pmi->hBmp;
}
+ else mii.hbmpItem = HBMMENU_CALLBACK;
}
mii.fMask |= MIIM_STATE;
diff --git a/src/modules/clist/groups.cpp b/src/modules/clist/groups.cpp index d01e485dd2..73aba22dab 100644 --- a/src/modules/clist/groups.cpp +++ b/src/modules/clist/groups.cpp @@ -470,7 +470,6 @@ static INT_PTR BuildGroupMenu(WPARAM, LPARAM) int nextMenuId = 100;
TCHAR *pBackslash, *pNextField, szThisField[128], szThisMenuItem[128];
int menuId, compareResult, menuItemCount;
- MENUITEMINFO mii = { 0 };
if (db_get_utf(NULL, "CListGroups", "0", &dbv))
return (INT_PTR) (HMENU) NULL;
@@ -483,7 +482,8 @@ static INT_PTR BuildGroupMenu(WPARAM, LPARAM) pNextField = dbv.ptszVal + 1;
hThisMenu = hRootMenu;
- mii.cbSize = MENUITEMINFO_V4_SIZE;
+
+ MENUITEMINFO mii = { sizeof(mii) };
do {
pBackslash = _tcschr(pNextField, '\\');
if (pBackslash == NULL) {
|