From 65e6aa9b5468f26485a236a46fcb18541e1acf1a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 25 Jun 2015 15:22:06 +0000 Subject: rest of genmenu api died git-svn-id: http://svn.miranda-ng.org/main/trunk@14382 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- bin10/lib/mir_app.lib | Bin 59118 -> 60474 bytes bin10/lib/mir_app64.lib | Bin 57606 -> 58850 bytes bin10/mir_dev.sln | 10 ++ bin12/lib/mir_app.lib | Bin 59118 -> 60474 bytes bin12/lib/mir_app64.lib | Bin 57606 -> 58850 bytes include/delphi/m_genmenu.inc | 100 ++------------ include/delphi/m_helpers.inc | 14 -- include/m_clist.h | 12 -- include/m_genmenu.h | 144 +++++---------------- .../ClientChangeNotify/src/ClientChangeNotify.cpp | 4 +- plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp | 4 +- plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp | 2 +- plugins/Clist_modern/src/modern_clui.cpp | 8 +- plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp | 6 +- plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp | 2 +- plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp | 80 ++++++------ plugins/Clist_nicer/src/clui.cpp | 4 +- plugins/ContactsPlus/src/receive.cpp | 4 +- plugins/ContactsPlus/src/send.cpp | 4 +- plugins/Dropbox/src/dropbox_menus.cpp | 4 +- plugins/FTPFileYM/src/common.h | 1 + plugins/FTPFileYM/src/dialog.cpp | 10 +- plugins/FavContacts/src/menu.cpp | 4 +- plugins/FloatingContacts/src/main.cpp | 4 +- plugins/HistoryStats/src/settings.cpp | 2 +- plugins/MirOTR/src/mirotrmenu.cpp | 8 +- plugins/MyDetails/src/frame.cpp | 4 +- plugins/NewAwaySysMod/src/ContactList.cpp | 4 +- plugins/NewAwaySysMod/src/Notification.cpp | 4 +- plugins/NewXstatusNotify/src/popup.cpp | 4 +- plugins/NewsAggregator/Src/Services.cpp | 2 - plugins/Popup/src/headers.h | 1 + plugins/Popup/src/popup_wnd2.cpp | 4 +- plugins/QuickContacts/src/commons.h | 1 + plugins/QuickContacts/src/quickcontacts.cpp | 13 +- plugins/RecentContacts/src/RecentContacts.cpp | 4 +- plugins/SMS/src/SMS_svc.cpp | 2 +- plugins/Scriver/src/chat/window.cpp | 8 +- plugins/Scriver/src/infobar.cpp | 2 +- plugins/Scriver/src/msgdialog.cpp | 4 +- plugins/Scriver/src/msgwindow.cpp | 4 +- plugins/SeenPlugin/src/history.cpp | 4 +- plugins/SeenPlugin/src/seen.h | 1 + plugins/TabSRMM/src/chat/window.cpp | 8 +- plugins/TabSRMM/src/container.cpp | 4 +- plugins/TabSRMM/src/msgdialog.cpp | 2 +- plugins/TabSRMM/src/msgdlgutils.cpp | 4 +- plugins/UserInfoEx/src/dlg_anniversarylist.cpp | 4 +- plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp | 3 +- plugins/UserInfoEx/src/mir_menuitems.cpp | 4 +- plugins/Weather/src/weather_mwin.cpp | 4 +- plugins/Weather/src/weather_popup.cpp | 6 +- protocols/JabberG/src/jabber_disco.cpp | 4 +- src/core/stdchat/src/window.cpp | 8 +- src/core/stdfile/src/filerecvdlg.cpp | 4 +- src/core/stdfile/src/filesenddlg.cpp | 4 +- src/core/stdfile/src/filexferdlg.cpp | 4 +- src/core/stdmsg/src/msgdialog.cpp | 4 +- src/core/stdurl/urldialogs.cpp | 8 +- src/mir_app/src/clc.cpp | 4 +- src/mir_app/src/clistmenus.cpp | 19 +-- src/mir_app/src/clui.cpp | 10 +- src/mir_app/src/genmenu.cpp | 71 +++++----- src/mir_app/src/genmenu.h | 2 - src/mir_app/src/mir_app.def | 6 + src/mir_app/src/mir_app64.def | 6 + 66 files changed, 252 insertions(+), 438 deletions(-) diff --git a/bin10/lib/mir_app.lib b/bin10/lib/mir_app.lib index a8f702a7ef..5423cf29ea 100644 Binary files a/bin10/lib/mir_app.lib and b/bin10/lib/mir_app.lib differ diff --git a/bin10/lib/mir_app64.lib b/bin10/lib/mir_app64.lib index b9770ef7b3..c7fee9b18e 100644 Binary files a/bin10/lib/mir_app64.lib and b/bin10/lib/mir_app64.lib differ diff --git a/bin10/mir_dev.sln b/bin10/mir_dev.sln index c1a8819eb8..d536bb8bc0 100644 --- a/bin10/mir_dev.sln +++ b/bin10/mir_dev.sln @@ -431,6 +431,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MessageState", "..\plugins\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MirLua", "..\plugins\MirLua\MirLua.vcxproj", "{27D41D81-991F-4DC6-8749-B0321C87E694}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StdUrl", "..\src\core\stdurl\stdurl_10.vcxproj", "{769FAC86-C761-11E1-A66F-0BE76188709B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -1966,6 +1968,14 @@ Global {27D41D81-991F-4DC6-8749-B0321C87E694}.Release|Win32.Build.0 = Release|Win32 {27D41D81-991F-4DC6-8749-B0321C87E694}.Release|x64.ActiveCfg = Release|x64 {27D41D81-991F-4DC6-8749-B0321C87E694}.Release|x64.Build.0 = Release|x64 + {769FAC86-C761-11E1-A66F-0BE76188709B}.Debug|Win32.ActiveCfg = Debug|Win32 + {769FAC86-C761-11E1-A66F-0BE76188709B}.Debug|Win32.Build.0 = Debug|Win32 + {769FAC86-C761-11E1-A66F-0BE76188709B}.Debug|x64.ActiveCfg = Debug|x64 + {769FAC86-C761-11E1-A66F-0BE76188709B}.Debug|x64.Build.0 = Debug|x64 + {769FAC86-C761-11E1-A66F-0BE76188709B}.Release|Win32.ActiveCfg = Release|Win32 + {769FAC86-C761-11E1-A66F-0BE76188709B}.Release|Win32.Build.0 = Release|Win32 + {769FAC86-C761-11E1-A66F-0BE76188709B}.Release|x64.ActiveCfg = Release|x64 + {769FAC86-C761-11E1-A66F-0BE76188709B}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/bin12/lib/mir_app.lib b/bin12/lib/mir_app.lib index a8f702a7ef..5423cf29ea 100644 Binary files a/bin12/lib/mir_app.lib and b/bin12/lib/mir_app.lib differ diff --git a/bin12/lib/mir_app64.lib b/bin12/lib/mir_app64.lib index b9770ef7b3..c7fee9b18e 100644 Binary files a/bin12/lib/mir_app64.lib and b/bin12/lib/mir_app64.lib differ diff --git a/include/delphi/m_genmenu.inc b/include/delphi/m_genmenu.inc index 42e0d2c4bd..400abdf6ec 100644 --- a/include/delphi/m_genmenu.inc +++ b/include/delphi/m_genmenu.inc @@ -86,29 +86,6 @@ plugin may add different menu items with some service. (pszPopupName=(AnsiChar *)hMenuItem - for make child of popup) } -const -{ - builds the SubGroup menu - wParam=lParam=0 - returns a HMENU identifying the menu. -} - MS_CLIST_MENUBUILDSUBGROUP:PAnsiChar = 'CList/MenuBuildSubGroup'; - -{ - add a new item to the SubGroup menus - wParam=lpGroupMenuParam, params to call when exec menuitem - lParam=(LPARAM)(CLISTMENUITEM*)&mi -} - MS_CLIST_ADDSUBGROUPMENUITEM:PAnsiChar = 'CList/AddSubGroupMenuItem'; - -{ - the SubGroup menu is about to be built - wParam=lParam=0 -} - ME_CLIST_PREBUILDSUBGROUPMENU:PAnsiChar = 'CList/PreBuildSubGroupMenu'; - -// SubGroup MENU - // Group MENU type PGroupMenuParam = ^TGroupMenuParam; @@ -118,34 +95,13 @@ type end; const -{ - builds the Group menu - wParam=lParam=0 - returns a HMENU identifying the menu. -} - MS_CLIST_MENUBUILDGROUP:PAnsiChar = 'CList/MenuBuildGroup'; - -{ - add a new item to the Group menus - wParam=lpGroupMenuParam, params to call when exec menuitem - lParam=(LPARAM)(CLISTMENUITEM*)&mi -} - MS_CLIST_ADDGROUPMENUITEM:PAnsiChar = 'CList/AddGroupMenuItem'; - { the Group menu is about to be built wParam=lParam=0 } ME_CLIST_PREBUILDGROUPMENU:PAnsiChar = 'CList/PreBuildGroupMenu'; - // TRAY MENU -{ - builds the tray menu - wParam=lParam=0 - returns a HMENU identifying the menu. -} - MS_CLIST_MENUBUILDTRAY:PAnsiChar = 'CList/MenuBuildTray'; { add a new item to the tray menus @@ -168,20 +124,6 @@ const } ME_CLIST_PREBUILDSTATUSMENU:PAnsiChar = 'CList/PreBuildStatusMenu'; -{ - add a new item to the status menu - wParam=0 - lParam=(LPARAM)(CLISTMENUITEM*)&mi -} -//!! MS_CLIST_ADDSTATUSMENUITEM = 'CList/AddStatusMenuItem'; // defined in m_clist.inc - -{ - builds the main menu - wParam=lParam=0 - returns a HMENU identifying the menu. -} - MS_CLIST_MENUBUILDMAIN:PAnsiChar = 'CList/MenuBuildMain'; - { the main menu is about to be built wParam=lParam=0 @@ -306,33 +248,25 @@ function Menu_AddItem(hMenuObject:THANDLE; var tmi:TMO_MenuItem) : integer; stdc external AppDLL name 'Menu_AddItem'; { - wparam MenuItemHandle - returns ownerdata on success,NULL on failure Useful to get and free ownerdata before delete menu item. } -const - MO_MENUITEMGETOWNERDATA:PAnsiChar = 'MO/MenuItemGetOwnerData'; + +function Menu_GetItemData(hMenuItem:HGENMENU) : pointer; stdcall; + external AppDLL name 'Menu_GetItemData'; { - wparam MenuItemHandle - lparam PMO_MenuItem returns 0 on success,-1 on failure } - MO_MODIFYMENUITEM:PAnsiChar = 'MO/ModifyMenuItem'; -{ - wparam=MenuItemHandle - lparam=PMO_MenuItem - returns 0 and filled PMO_MenuItem structure on success and -1 on failure -} - MO_GETMENUITEM:PAnsiChar = 'MO/GetMenuItem'; +function Menu_GetItemInfo(hMenuItem:HGENMENU; var mi:TMO_MenuItem) : integer; stdcall; + external AppDLL name 'Menu_GetItemInfo'; { - wparam=MenuItemHandle - lparam=0 returns a menu handle on success or NULL on failure } - MO_GETDEFAULTMENUITEM:PAnsiChar = 'MO/GetDefaultMenuItem'; + +function Menu_GetDefaultItem(hMenuItem:HGENMENU) : HGENMENU; stdcall; + external AppDLL name 'Menu_GetDefaultItem'; { wparam=MenuObjectHandle @@ -340,23 +274,9 @@ const returns TRUE if it processed the command, FALSE otherwise this should be called in WM_KEYDOWN } - MO_PROCESSHOTKEYS:PAnsiChar = 'MO/ProcessHotKeys'; - -{ - process a WM_DRAWITEM message - wparam=0 - lparam=LPDRAWITEMSTRUCT - returns TRUE if it processed the command, FALSE otherwise -} - MO_DRAWMENUITEM:PAnsiChar = 'MO/DrawMenuItem'; -{ - process a WM_MEASUREITEM message - wparam=0 - lparam=LPMEASUREITEMSTRUCT - returns TRUE if it processed the command, FALSE otherwise -} - MO_MEASUREMENUITEM:PAnsiChar = 'MO/MeasureMenuItem'; +function Menu_ProcessHotKey(hMenuObject:THANDLE; vKey:DWORD) : integer; stdcall; + external AppDLL name 'Menu_ProcessHotKey'; { sets an option for the whole menu object diff --git a/include/delphi/m_helpers.inc b/include/delphi/m_helpers.inc index a005f5c9ec..1d68b6501e 100644 --- a/include/delphi/m_helpers.inc +++ b/include/delphi/m_helpers.inc @@ -57,8 +57,6 @@ function Menu_AddMainMenuItem (mi:PCLISTMENUITEM):HGENMENU; function Menu_AddContactMenuItem (mi:PCLISTMENUITEM):HGENMENU; function Menu_AddStatusMenuItem (mi:PCLISTMENUITEM):HGENMENU; function Menu_AddProtoMenuItem (mi:PCLISTMENUITEM):HGENMENU; -function Menu_AddSubGroupMenuItem (mi:PCLISTMENUITEM):HGENMENU; -function Menu_AddGroupMenuItem (mi:PCLISTMENUITEM):HGENMENU; function Menu_AddTrayMenuItem (mi:PCLISTMENUITEM):HGENMENU; function UserInfo_AddPage(wParam:WPARAM; odp:POPTIONSDIALOGPAGE):int_ptr; @@ -416,18 +414,6 @@ begin result:=CallService(MS_CLIST_ADDPROTOMENUITEM, 0,LPARAM(mi)); end; -function Menu_AddSubGroupMenuItem(mi:PCLISTMENUITEM):HGENMENU; -begin - mi^.hLangpack:=hLangpack; - result:=CallService(MS_CLIST_ADDSUBGROUPMENUITEM, 0,LPARAM(mi)); -end; - -function Menu_AddGroupMenuItem(mi:PCLISTMENUITEM):HGENMENU; -begin - mi^.hLangpack:=hLangpack; - result:=CallService(MS_CLIST_ADDGROUPMENUITEM, 0,LPARAM(mi)); -end; - function Menu_AddTrayMenuItem(mi:PCLISTMENUITEM):HGENMENU; begin mi^.hLangpack:=hLangpack; diff --git a/include/m_clist.h b/include/m_clist.h index 22d3a5634b..f2d104a6bd 100644 --- a/include/m_clist.h +++ b/include/m_clist.h @@ -313,18 +313,6 @@ typedef struct { //will get the event that will be got if the user clicks the systray icon. #define MS_CLIST_GETEVENT "CList/GetEvent" -//process a WM_MEASUREITEM message for user context menus v0.1.1.0+ -//wParam, lParam, return value as for WM_MEASUREITEM -//This is for displaying the icons by the menu items. If you don't call this -//and clist/menudrawitem whne drawing a menu returned by one of the three menu -//services below then it'll work but you won't get any icons -#define MS_CLIST_MENUMEASUREITEM "CList/MenuMeasureItem" - -//process a WM_DRAWITEM message for user context menus v0.1.1.0+ -//wParam, lParam, return value as for WM_MEASUREITEM -//See comments for clist/menumeasureitem -#define MS_CLIST_MENUDRAWITEM "CList/MenuDrawItem" - //builds the context menu for a specific contact v0.1.1.0+ //wParam = (MCONTACT)hContact //lParam = 0 diff --git a/include/m_genmenu.h b/include/m_genmenu.h index dd7840e0b5..d62b5463eb 100644 --- a/include/m_genmenu.h +++ b/include/m_genmenu.h @@ -7,97 +7,6 @@ extern int hLangpack; -/* - Main features: - 1) Independet from clist,may be used in any module. - 2) Module defined Exec and Check services. - 3) Menu with any level of popups,icons for root of popup. - 4) You may use measure/draw/processcommand even if menuobject is unknown. - - Idea of GenMenu module consists of that, - it must be independet and offers only general menu purpose services: - MO_CREATENEWMENUOBJECT - MO_REMOVEMENUOBJECT - MO_ADDNEWMENUITEM - MO_REMOVEMENUITEM - ...etc - - And then each module that want use and offer to others menu handling - must create own services.For example i rewrited mainmenu and - contactmenu code in clistmenus.c.If you look at code all functions - are very identical, and vary only in check/exec services. - - So template set of function will like this: - RemoveItem - AddItem - Build - ExecService - CheckService - - ExecService and CheckService used as callbacks when GenMenu must - processcommand for menu item or decide to show or not item.This make - GenMenu independet of which params must passed to service when user - click on menu,this decide each module. - 28-04-2003 Bethoven - -*/ - - - -/* -Analog to CLISTMENUITEM,but invented two params root and ownerdata. -root is used for creating any level popup menus,set to -1 to build -at first level and root=MenuItemHandle to place items in submenu -of this item.Must be used two new flags CMIF_ROOTPOPUP and CMIF_CHILDPOPUP -(defined in m_clist.h) - -ownerdata is passed to callback services(ExecService and CheckService) -when building menu or processed command. -*/ - -/*GENMENU_MODULE*/ -/* -Changes: - -28-04-2003 -Moved all general stuff to genmenu.c(m_genmenu.h,genmenu.h), -so removed all frames stuff. - - -Changes: - -28-12-2002 - -Contact menu item service called with wparam=hcontact,lparam=popupPosition - -plugin may add different menu items with some service. -(old behavior wparam=hcontact lparam=0) - - - -25-11-2002 Full support of runtime build of all menus. - Contact MS_CLIST_ADDCONTACTMENUITEM - MS_CLIST_MENUBUILDCONTACT - ME_CLIST_PREBUILDCONTACTMENU - - MainMenu MS_CLIST_ADDMAINMENUITEM - MS_CLIST_REMOVEMAINMENUITEM - MS_CLIST_MENUBUILDMAIN - ME_CLIST_PREBUILDMAINMENU - - FrameMenu MS_CLIST_ADDCONTEXTFRAMEMENUITEM - MS_CLIST_REMOVECONTEXTFRAMEMENUITEM - MS_CLIST_MENUBUILDFRAMECONTEXT - ME_CLIST_PREBUILDFRAMEMENU - - For All menus may be used - MS_CLIST_MODIFYMENUITEM - - All menus supported any level of popups - (pszPopupName=(char *)hMenuItem - for make child of popup) -*/ - -// SubGroup MENU - // Group MENU typedef struct { @@ -250,28 +159,45 @@ EXTERN_C MIR_APP_DLL(int) Menu_RemoveItem(HGENMENU hMenuItem); EXTERN_C MIR_APP_DLL(HGENMENU) Menu_AddItem(HANDLE hMenuObject, TMO_MenuItem *pItem); -//wparam MenuItemHandle -//returns ownerdata on success,NULL on failure -//Useful to get and free ownerdata before delete menu item. +///////////////////////////////////////////////////////////////////////////////////////// +// Retrieves user info from a menu item +// Returns ownerdata on success, NULL on failure +// Useful to get and free ownerdata before delete menu item. + +EXTERN_C MIR_APP_DLL(void*) Menu_GetItemData(HGENMENU hMenuItem); + +///////////////////////////////////////////////////////////////////////////////////////// +// Retrieves menu item structure by handle. +// Returns 0 and filled TMO_MenuItem structure on success, or -1 on failure + +EXTERN_C MIR_APP_DLL(int) Menu_GetItemInfo(HGENMENU hMenuItem, TMO_MenuItem &pInfo); + +///////////////////////////////////////////////////////////////////////////////////////// +// Retrieves a default menu item for the menu passed +// Returns a menu handle on success or NULL on failure + +EXTERN_C MIR_APP_DLL(HGENMENU) Menu_GetDefaultItem(HGENMENU hMenu); + +///////////////////////////////////////////////////////////////////////////////////////// +// Tries to process a keystroke +// returns TRUE if a key was, FALSE otherwise +// this should be called in WM_KEYDOWN + +EXTERN_C MIR_APP_DLL(BOOL) Menu_ProcessHotKey(HANDLE hMenuObject, int key); -#define MO_MENUITEMGETOWNERDATA "MO/MenuItemGetOwnerData" +//process a WM_MEASUREITEM message for user context menus v0.1.1.0+ +//wParam, lParam, return value as for WM_MEASUREITEM +//This is for displaying the icons by the menu items. If you don't call this +//and clist/menudrawitem whne drawing a menu returned by one of the three menu +//services below then it'll work but you won't get any icons -//wparam=MenuItemHandle -//lparam=PMO_MenuItem -//returns 0 and filled PMO_MenuItem structure on success and -//-1 on failure -#define MO_GETMENUITEM "MO/GetMenuItem" +EXTERN_C MIR_APP_DLL(BOOL) Menu_MeasureItem(MEASUREITEMSTRUCT *mis); -//wparam=MenuItemHandle -//lparam=0 -//returns a menu handle on success or NULL on failure -#define MO_GETDEFAULTMENUITEM "MO/GetDefaultMenuItem" +//process a WM_DRAWITEM message for user context menus v0.1.1.0+ +//wParam, lParam, return value as for WM_MEASUREITEM +//See comments for clist/menumeasureitem -//wparam=MenuObjectHandle -//lparam=vKey -//returns TRUE if it processed the command, FALSE otherwise -//this should be called in WM_KEYDOWN -#define MO_PROCESSHOTKEYS "MO/ProcessHotKeys" +EXTERN_C MIR_APP_DLL(BOOL) Menu_DrawItem(DRAWITEMSTRUCT *dis); ///////////////////////////////////////////////////////////////////////////////////////// // Creates a new menu object diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp index 5db1b10683..f9483e7bd1 100644 --- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp +++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp @@ -56,10 +56,10 @@ static int CALLBACK MenuWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar { switch (uMsg) { case WM_MEASUREITEM: - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_DRAWITEM: - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); } return DefWindowProc(hWnd, uMsg, wParam, lParam); } diff --git a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp index 7f8f7269e1..94543dbc94 100644 --- a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp +++ b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp @@ -2679,10 +2679,10 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam return FALSE; case WM_MEASUREITEM: - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_DRAWITEM: - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); case WM_USER + 100: return 1; diff --git a/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp b/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp index 35e6b95a7f..fc512f7ea9 100644 --- a/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp +++ b/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp @@ -65,7 +65,7 @@ INT_PTR FrameMenuCheckService(WPARAM wParam, LPARAM) return FALSE; TMO_MenuItem mi; - if (CallService(MO_GETMENUITEM, (WPARAM)pcpp->MenuItemHandle, (LPARAM)&mi) == 0) { + if (Menu_GetItemInfo(pcpp->MenuItemHandle, mi) == 0) { lpFrameMenuExecParam fmep = (lpFrameMenuExecParam)mi.ownerdata; if (fmep != NULL) { //pcpp->wParam - frameid diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 3e8532ba70..8ab38f6e47 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -2442,7 +2442,7 @@ LRESULT CLUI::OnContextMenu(UINT, WPARAM, LPARAM lParam) return FALSE; } -LRESULT CLUI::OnMeasureItem(UINT, WPARAM wParam, LPARAM lParam) +LRESULT CLUI::OnMeasureItem(UINT, WPARAM, LPARAM lParam) { LPMEASUREITEMSTRUCT pmis = (LPMEASUREITEMSTRUCT)lParam; switch (pmis->itemData) { @@ -2461,10 +2461,10 @@ LRESULT CLUI::OnMeasureItem(UINT, WPARAM wParam, LPARAM lParam) ReleaseDC(m_hWnd, hdc); return TRUE; } - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); } -LRESULT CLUI::OnDrawItem(UINT, WPARAM wParam, LPARAM lParam) +LRESULT CLUI::OnDrawItem(UINT, WPARAM, LPARAM lParam) { ClcData *dat = (ClcData*)GetWindowLongPtr(pcli->hwndContactTree, 0); LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam; @@ -2539,7 +2539,7 @@ LRESULT CLUI::OnDrawItem(UINT, WPARAM wParam, LPARAM lParam) nMirMenuState = dis->itemState; } - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); } LRESULT CLUI::OnDestroy(UINT, WPARAM, LPARAM) diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp index 4dcb13a226..011221b82a 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp +++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp @@ -2360,10 +2360,12 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA switch (msg) { case WM_CREATE: return FALSE; + case WM_MEASUREITEM: - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); + case WM_DRAWITEM: - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); case WM_ENABLE: if (hwnd != 0) InvalidateRect(hwnd, NULL, FALSE); diff --git a/plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp b/plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp index d013caefd9..3b7d343b8f 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp +++ b/plugins/Clist_nicer/src/CLUIFrames/framesmenu.cpp @@ -66,7 +66,7 @@ INT_PTR FrameMenuCheckService(WPARAM wParam, LPARAM) return FALSE; TMO_MenuItem mi; - if (CallService(MO_GETMENUITEM, (WPARAM)pcpp->MenuItemHandle, (LPARAM)&mi) == 0) { + if (Menu_GetItemInfo(pcpp->MenuItemHandle, mi) == 0) { lpFrameMenuExecParam fmep = (lpFrameMenuExecParam)mi.ownerdata; if (fmep != NULL) { //pcpp->wParam - frameid diff --git a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp index dd77bc9232..d05cd7e509 100644 --- a/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp +++ b/plugins/Clist_nicer/src/CLUIFrames/groupmenu.cpp @@ -229,7 +229,7 @@ void InitGroupMenus(void) InitSubGroupMenus(); - //Group menu + // Group menu hGroupMenuObject = Menu_AddObject("GroupMenu", LPGEN("Group menu"), 0, "CLISTMENUSGroup/ExecService"); Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_USERDEFINEDITEMS, TRUE); Menu_ConfigureObject(hGroupMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSGroup/FreeOwnerDataGroupMenu"); @@ -476,46 +476,44 @@ void InitSubGroupMenus(void) Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_FREE_SERVICE, "CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu"); Menu_ConfigureObject(hSubGroupMenuObject, MCO_OPT_ONADD_SERVICE, "CLISTMENUSSubGroup/SubGroupMenuonAddService"); - { - //add exit command to menu - GroupMenuParam gmp; - - CLISTMENUITEM mi = { 0 }; - mi.position = 1000; - mi.icolibItem = iconItem[0].hIcolib; - mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy"; - mi.pszName = LPGEN("&New subgroup"); - gmp.lParam = 0; - gmp.wParam = POPUP_NEWSUBGROUP; - hNewSubGroupMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi); - - memset(&mi, 0, sizeof(mi)); - mi.position = 1001; - mi.hIcon = NULL; - mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy"; - mi.pszName = LPGEN("&Hide offline users in here"); - gmp.lParam = 0; - gmp.wParam = POPUP_GROUPHIDEOFFLINE; - hHideOfflineUsersHereMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi); - - memset(&mi, 0, sizeof(mi)); - mi.position = 900001; - mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_RENAME); - mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy"; - mi.pszName = LPGEN("&Rename group"); - gmp.lParam = 0; - gmp.wParam = POPUP_RENAMEGROUP; - AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi); - - memset(&mi, 0, sizeof(mi)); - mi.position = 900002; - mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_DELETE); - mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy"; - mi.pszName = LPGEN("&Delete group"); - gmp.lParam = 0; - gmp.wParam = POPUP_DELETEGROUP; - AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi); - } + // add exit command to menu + GroupMenuParam gmp; + + CLISTMENUITEM mi = { 0 }; + mi.position = 1000; + mi.icolibItem = iconItem[0].hIcolib; + mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy"; + mi.pszName = LPGEN("&New subgroup"); + gmp.lParam = 0; + gmp.wParam = POPUP_NEWSUBGROUP; + hNewSubGroupMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi); + + memset(&mi, 0, sizeof(mi)); + mi.position = 1001; + mi.hIcon = NULL; + mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy"; + mi.pszName = LPGEN("&Hide offline users in here"); + gmp.lParam = 0; + gmp.wParam = POPUP_GROUPHIDEOFFLINE; + hHideOfflineUsersHereMenuItem = (HGENMENU)AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi); + + memset(&mi, 0, sizeof(mi)); + mi.position = 900001; + mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_RENAME); + mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy"; + mi.pszName = LPGEN("&Rename group"); + gmp.lParam = 0; + gmp.wParam = POPUP_RENAMEGROUP; + AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi); + + memset(&mi, 0, sizeof(mi)); + mi.position = 900002; + mi.icolibItem = Skin_GetIconHandle(SKINICON_OTHER_DELETE); + mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy"; + mi.pszName = LPGEN("&Delete group"); + gmp.lParam = 0; + gmp.wParam = POPUP_DELETEGROUP; + AddSubGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi); } //////////////////////////////END SubGroup MENU///////////////////////// diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 810855072a..753a30e51d 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -1654,7 +1654,7 @@ buttons_done: ((LPMEASUREITEMSTRUCT)lParam)->itemHeight = 0; return TRUE; } - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_DRAWITEM: { @@ -1754,7 +1754,7 @@ buttons_done: else if (dis->CtlType == ODT_MENU) { if (dis->itemData == MENU_MIRANDAMENU) break; - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); } } return 0; diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp index 798d3d44d0..d14df1492f 100644 --- a/plugins/ContactsPlus/src/receive.cpp +++ b/plugins/ContactsPlus/src/receive.cpp @@ -466,11 +466,11 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara break; case WM_MEASUREITEM: - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_DRAWITEM: DrawProtocolIcon(hwndDlg, lParam, wndData->mhContact); - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); case WM_SIZE: if (!IsIconic(hwndDlg)) // make the dlg resizeable diff --git a/plugins/ContactsPlus/src/send.cpp b/plugins/ContactsPlus/src/send.cpp index f06309e72b..f5aaf412e7 100644 --- a/plugins/ContactsPlus/src/send.cpp +++ b/plugins/ContactsPlus/src/send.cpp @@ -444,11 +444,11 @@ INT_PTR CALLBACK SendDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara break; case WM_MEASUREITEM: - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_DRAWITEM: DrawProtocolIcon(hwndDlg, lParam, wndData->hContact); - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); case DM_UPDATETITLE: UpdateDialogTitle(hwndDlg, wndData ? wndData->hContact : NULL, TranslateT("Send Contacts to")); diff --git a/plugins/Dropbox/src/dropbox_menus.cpp b/plugins/Dropbox/src/dropbox_menus.cpp index 9255a758ed..432bd211ec 100644 --- a/plugins/Dropbox/src/dropbox_menus.cpp +++ b/plugins/Dropbox/src/dropbox_menus.cpp @@ -29,7 +29,7 @@ int CDropbox::OnPrebuildContactMenu(WPARAM hContact, LPARAM) if (!hContact) return 0; - BOOL bShow = FALSE; + bool bShow = false; if (HasAccessToken() && !hTransferContact && hContact != GetDefaultContact()) { @@ -41,7 +41,7 @@ int CDropbox::OnPrebuildContactMenu(WPARAM hContact, LPARAM) WORD status = db_get_w(hContact, proto, "Status", ID_STATUS_OFFLINE); bool canSendOffline = (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_IMSENDOFFLINE) > 0; if (isProtoOnline && (status != ID_STATUS_OFFLINE || canSendOffline)) - bShow = TRUE; + bShow = true; } } diff --git a/plugins/FTPFileYM/src/common.h b/plugins/FTPFileYM/src/common.h index 74a23391d3..aca753f605 100644 --- a/plugins/FTPFileYM/src/common.h +++ b/plugins/FTPFileYM/src/common.h @@ -33,6 +33,7 @@ using namespace std; #include #include #include +#include #include #include #include diff --git a/plugins/FTPFileYM/src/dialog.cpp b/plugins/FTPFileYM/src/dialog.cpp index c16bd30ea5..afe0f4131c 100644 --- a/plugins/FTPFileYM/src/dialog.cpp +++ b/plugins/FTPFileYM/src/dialog.cpp @@ -222,13 +222,11 @@ INT_PTR CALLBACK UploadDialog::UploadDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar break; } case WM_MEASUREITEM: - { - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); - } + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); + case WM_DRAWITEM: - { - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); - } + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); + case WM_COMMAND: { MCONTACT hContact = uDlg->tabs[uDlg->activeTab]->job->hContact; diff --git a/plugins/FavContacts/src/menu.cpp b/plugins/FavContacts/src/menu.cpp index 7481d07879..f4aca7de25 100644 --- a/plugins/FavContacts/src/menu.cpp +++ b/plugins/FavContacts/src/menu.cpp @@ -368,7 +368,7 @@ static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam, return FALSE; if ((lpmis->itemID >= CLISTMENUIDMIN) && (lpmis->itemID <= CLISTMENUIDMAX)) - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem(lpmis); return MenuMeasureItem(lpmis); } @@ -380,7 +380,7 @@ static LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam, return FALSE; if ((lpdis->itemID >= CLISTMENUIDMIN) && (lpdis->itemID <= CLISTMENUIDMAX)) - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); return MenuDrawItem(lpdis); } diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp index 8f6ad70b15..38aeeeee45 100644 --- a/plugins/FloatingContacts/src/main.cpp +++ b/plugins/FloatingContacts/src/main.cpp @@ -382,11 +382,11 @@ static LRESULT __stdcall CommWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM } case WM_MEASUREITEM: - CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); break; case WM_DRAWITEM: - CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); break; case WM_LBUTTONDOWN: diff --git a/plugins/HistoryStats/src/settings.cpp b/plugins/HistoryStats/src/settings.cpp index a9c2b6ec06..730db1a4ee 100644 --- a/plugins/HistoryStats/src/settings.cpp +++ b/plugins/HistoryStats/src/settings.cpp @@ -21,7 +21,7 @@ Settings::CharMapper::CharMapper(const Settings& settings) } LCID lcid = GetUserDefaultLCID(); - int len = LCMapString( + LCMapString( lcid, LCMAP_LINGUISTIC_CASING | LCMAP_LOWERCASE, m_CharMap + 1, array_len(m_CharMap) - 1, m_CharMap + 1, array_len(m_CharMap) - 1); diff --git a/plugins/MirOTR/src/mirotrmenu.cpp b/plugins/MirOTR/src/mirotrmenu.cpp index 38a1623905..377afc4547 100644 --- a/plugins/MirOTR/src/mirotrmenu.cpp +++ b/plugins/MirOTR/src/mirotrmenu.cpp @@ -57,7 +57,7 @@ INT_PTR MirOTRMenuCheckService(WPARAM wParam, LPARAM) TrustLevel level = (TrustLevel)otr_context_get_trust(context); TMO_MenuItem mi; - if (CallService(MO_GETMENUITEM, (WPARAM)pcpp->MenuItemHandle, (LPARAM)&mi) == 0) { + if (Menu_GetItemInfo(pcpp->MenuItemHandle, mi) == 0) { if (mi.flags & CMIF_HIDDEN) return FALSE; if (mi.flags & CMIF_NOTPRIVATE && level == TRUST_PRIVATE) return FALSE; if (mi.flags & CMIF_NOTFINISHED && level == TRUST_FINISHED) return FALSE; @@ -111,7 +111,7 @@ INT_PTR OnAddMenuItemMirOTRMenu(WPARAM wParam, LPARAM lParam) return 0; TMO_MenuItem mi; - if (CallService(MO_GETMENUITEM, (WPARAM)lParam, (LPARAM)&mi) == 0) { + if (Menu_GetItemInfo((HGENMENU)lParam, mi) == 0) { if (mi.flags & CMIF_DISABLED) { mii->fMask |= MIIM_STATE; mii->fState |= MF_DISABLED; @@ -124,10 +124,10 @@ LRESULT CALLBACK PopupMenuWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM { switch (message) { case WM_MEASUREITEM: - if (CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam)) return TRUE; + if (Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam)) return TRUE; break; case WM_DRAWITEM: - if (CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam)) return TRUE; + if (Menu_DrawItem((LPDRAWITEMSTRUCT)lParam)) return TRUE; break; case WM_COMMAND: if (Menu_ProcessCommandById(wParam, GetWindowLongPtr(hwnd, GWLP_USERDATA))) diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index e2e4884cb9..c7a9b9480a 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -1694,10 +1694,10 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar break; case WM_MEASUREITEM: - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_DRAWITEM: - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); case WM_CONTEXTMENU: proto = protocols->Get(data->protocol_number); diff --git a/plugins/NewAwaySysMod/src/ContactList.cpp b/plugins/NewAwaySysMod/src/ContactList.cpp index 8d7784a42e..6b5e192793 100644 --- a/plugins/NewAwaySysMod/src/ContactList.cpp +++ b/plugins/NewAwaySysMod/src/ContactList.cpp @@ -284,12 +284,12 @@ static LRESULT CALLBACK ContactListSubclassProc(HWND hWnd, UINT Msg, WPARAM wPar case WM_MEASUREITEM: if (!wParam) // if the message was sent by a menu - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); break; case WM_DRAWITEM: if (!wParam) // if the message was sent by a menu - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); break; case WM_CONTEXTMENU: diff --git a/plugins/NewAwaySysMod/src/Notification.cpp b/plugins/NewAwaySysMod/src/Notification.cpp index 6527a0731b..c25182270e 100644 --- a/plugins/NewAwaySysMod/src/Notification.cpp +++ b/plugins/NewAwaySysMod/src/Notification.cpp @@ -41,10 +41,10 @@ static int CALLBACK MenuWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar { switch (uMsg) { case WM_MEASUREITEM: - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_DRAWITEM: - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); } return DefWindowProc(hWnd, uMsg, wParam, lParam); } diff --git a/plugins/NewXstatusNotify/src/popup.cpp b/plugins/NewXstatusNotify/src/popup.cpp index fd1127dae2..336b88f267 100644 --- a/plugins/NewXstatusNotify/src/popup.cpp +++ b/plugins/NewXstatusNotify/src/popup.cpp @@ -155,10 +155,10 @@ LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa switch (message) { case WM_MEASUREITEM: //Needed by the contact's context menu - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_DRAWITEM: //Needed by the contact's context menu - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); case WM_COMMAND: //This one returns TRUE if it processed the menu command, and FALSE if it did not process it. diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp index a37fbf5ac0..ff5a09c348 100644 --- a/plugins/NewsAggregator/Src/Services.cpp +++ b/plugins/NewsAggregator/Src/Services.cpp @@ -229,8 +229,6 @@ INT_PTR NewsAggrRecvMessage(WPARAM, LPARAM lParam) void UpdateMenu(bool State) { - CLISTMENUITEM mi = { 0 }; - if (!State) // to enable auto-update Menu_ModifyItem(hService2[0], LPGENT("Auto Update Enabled"), GetIconHandle("enabled")); else // to disable auto-update diff --git a/plugins/Popup/src/headers.h b/plugins/Popup/src/headers.h index 56b8d1b625..4db076f80a 100644 --- a/plugins/Popup/src/headers.h +++ b/plugins/Popup/src/headers.h @@ -76,6 +76,7 @@ http://miranda-ng.org/distr/ #include #include #include +#include #include #include #include diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index f31013e2e6..31dc8a4962 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -1317,10 +1317,10 @@ LRESULT CALLBACK MenuHostWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM break; case WM_MEASUREITEM: - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_DRAWITEM: - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); } return DefWindowProc(hwnd, message, wParam, lParam); diff --git a/plugins/QuickContacts/src/commons.h b/plugins/QuickContacts/src/commons.h index 98e8b0d5dd..e308aab019 100644 --- a/plugins/QuickContacts/src/commons.h +++ b/plugins/QuickContacts/src/commons.h @@ -30,6 +30,7 @@ Boston, MA 02111-1307, USA. #include #include #include +#include #include #include #include diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index 97cbccc467..9f52e186bd 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -999,9 +999,8 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if(lpdis->CtlID != IDC_USERNAME) { if (lpdis->CtlType == ODT_MENU) - return CallService(MS_CLIST_MENUDRAWITEM,wParam,lParam); - else - break; + return Menu_DrawItem(lpdis); + break; } // Handle combo @@ -1094,12 +1093,10 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA LPMEASUREITEMSTRUCT lpmis = (LPMEASUREITEMSTRUCT)lParam; // Handle contact menu - if(lpmis->CtlID != IDC_USERNAME) - { + if(lpmis->CtlID != IDC_USERNAME) { if (lpmis->CtlType == ODT_MENU) - return CallService(MS_CLIST_MENUMEASUREITEM,wParam,lParam); - else - break; + return Menu_MeasureItem(lpmis); + break; } // Handle combo diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index c097b42bd5..fdad9f0104 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -342,10 +342,10 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM } case WM_MEASUREITEM: - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_DRAWITEM: - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); case WM_COMMAND: if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)DlgDat->hContact)) diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp index 0b897825c1..b2d2d5f340 100644 --- a/plugins/SMS/src/SMS_svc.cpp +++ b/plugins/SMS/src/SMS_svc.cpp @@ -54,7 +54,7 @@ int LoadModules(void) int SmsRebuildContactMenu(WPARAM wParam,LPARAM lParam) { - Menu_ShowItem(ssSMSSettings.hContactMenuItems[0], GetContactPhonesCount(wParam)); + Menu_ShowItem(ssSMSSettings.hContactMenuItems[0], GetContactPhonesCount(wParam) != 0); return 0; } diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index 00f1cf85da..a01119de72 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -856,7 +856,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, { MEASUREITEMSTRUCT *mis = (MEASUREITEMSTRUCT *)lParam; if (mis->CtlType == ODT_MENU) - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); } return FALSE; @@ -864,7 +864,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, { DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)lParam; if (dis->CtlType == ODT_MENU) - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); } return FALSE; @@ -1360,7 +1360,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR if (!MeasureMenuItem(wParam, lParam)) { MEASUREITEMSTRUCT *mis = (MEASUREITEMSTRUCT *)lParam; if (mis->CtlType == ODT_MENU) - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); int ih = GetTextPixelSize(_T("AQGgl'"), g_Settings.UserListFont, FALSE); int ih2 = GetTextPixelSize(_T("AQGg'"), g_Settings.UserListHeadingsFont, FALSE); @@ -1377,7 +1377,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR if (!DrawMenuItem(wParam, lParam)) { DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)lParam; if (dis->CtlType == ODT_MENU) - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); if (dis->CtlID == IDC_CHAT_LIST) { int index = dis->itemID; diff --git a/plugins/Scriver/src/infobar.cpp b/plugins/Scriver/src/infobar.cpp index 1aa9bfcae4..027dc2dd47 100644 --- a/plugins/Scriver/src/infobar.cpp +++ b/plugins/Scriver/src/infobar.cpp @@ -263,7 +263,7 @@ static INT_PTR CALLBACK InfobarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA return TRUE; } } - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); case WM_LBUTTONDOWN: SendMessage(idat->mwd->hwnd, WM_LBUTTONDOWN, wParam, lParam); diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index e2b3448e1b..aa95a35a46 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -1504,7 +1504,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case WM_MEASUREITEM: if (!MeasureMenuItem(wParam, lParam)) - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); return TRUE; case WM_DRAWITEM: @@ -1552,7 +1552,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP return TRUE; } } - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_COMMAND: if (!lParam && CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)dat->hContact)) diff --git a/plugins/Scriver/src/msgwindow.cpp b/plugins/Scriver/src/msgwindow.cpp index 6a88b6ea87..c95aa5b503 100644 --- a/plugins/Scriver/src/msgwindow.cpp +++ b/plugins/Scriver/src/msgwindow.cpp @@ -881,7 +881,7 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR return TRUE; case WM_MEASUREITEM: - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_DRAWITEM: { @@ -897,7 +897,7 @@ INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR return TRUE; } } - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); case WM_COMMAND: if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)dat->hContact)) diff --git a/plugins/SeenPlugin/src/history.cpp b/plugins/SeenPlugin/src/history.cpp index 857719e78f..9bc055125f 100644 --- a/plugins/SeenPlugin/src/history.cpp +++ b/plugins/SeenPlugin/src/history.cpp @@ -198,10 +198,10 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hwndDlg, UINT Message, WPARAM wparam, LPARA return TRUE; case WM_MEASUREITEM: - return CallService(MS_CLIST_MENUMEASUREITEM, wparam, lparam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lparam); case WM_DRAWITEM: - return CallService(MS_CLIST_MENUDRAWITEM, wparam, lparam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lparam); case WM_COMMAND: hContact = (MCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); diff --git a/plugins/SeenPlugin/src/seen.h b/plugins/SeenPlugin/src/seen.h index 4a83833fe6..6808ca7683 100644 --- a/plugins/SeenPlugin/src/seen.h +++ b/plugins/SeenPlugin/src/seen.h @@ -34,6 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include +#include #include #include #include diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index a37f241b9d..4197ca245b 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -1509,7 +1509,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, { MEASUREITEMSTRUCT *mis = (MEASUREITEMSTRUCT *)lParam; if (mis->CtlType == ODT_MENU) - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); } return FALSE; @@ -1517,7 +1517,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, { DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)lParam; if (dis->CtlType == ODT_MENU) - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); } return FALSE; @@ -2121,7 +2121,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar mis->itemWidth = 6; return TRUE; } - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); } mis->itemHeight = g_Settings.iNickListFontHeight; } @@ -2135,7 +2135,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar DrawMenuItem(dis, (HICON)dis->itemData, 0); return TRUE; } - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); } if (dis->CtlID == IDC_LIST) { diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 8af158731f..f863d29df0 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -1603,10 +1603,10 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, return TRUE; } } - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); case WM_MEASUREITEM: - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case DM_QUERYCLIENTAREA: { diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 1d5a3f4f60..452252e78d 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -2570,7 +2570,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP return TRUE; } } - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_NCHITTEST: SendMessage(hwndContainer, WM_NCHITTEST, wParam, lParam); diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index ad4936ee95..614a5aa83d 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -1407,7 +1407,7 @@ void TSAPI HandlePasteAndSend(const TWindowData *dat) // draw various elements of the message window, like avatar(s), info panel fields // and the color formatting menu -int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat) +int TSAPI MsgWindowDrawHandler(WPARAM, LPARAM lParam, TWindowData *dat) { if (!dat) return 0; @@ -1604,7 +1604,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat) return TRUE; } - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); } void TSAPI LoadThemeDefaults(TContainerData *pContainer) diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp index 880ce91789..89acc46117 100644 --- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp @@ -498,10 +498,10 @@ class CAnnivList break; case WM_DRAWITEM: - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); case WM_MEASUREITEM: - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_WINDOWPOSCHANGING: if (PtrIsValid(pDlg)) { diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp index f8047def59..87b68032ac 100644 --- a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp +++ b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp @@ -326,12 +326,13 @@ typedef struct * * @return always 0 **/ + INT_PTR svcExIm_Account_Service(WPARAM wParam, LPARAM lParam) { ExImParam ExIm; memset(&ExIm, 0, sizeof(ExIm)); HWND hClist = (HWND)CallService(MS_CLUI_GETHWNDTREE,0,0); - lpStatusMenuExecParam smep = (lpStatusMenuExecParam)Menu_GetUserData((HGENMENU)lParam); + lpStatusMenuExecParam smep = (lpStatusMenuExecParam)Menu_GetItemData((HGENMENU)lParam); ExIm.pszName = mir_strdup(smep->proto); ExIm.Typ = EXIM_ACCOUNT; diff --git a/plugins/UserInfoEx/src/mir_menuitems.cpp b/plugins/UserInfoEx/src/mir_menuitems.cpp index 9d44263735..cd38f94387 100644 --- a/plugins/UserInfoEx/src/mir_menuitems.cpp +++ b/plugins/UserInfoEx/src/mir_menuitems.cpp @@ -298,7 +298,7 @@ void RebuildGroup() { int flag = 0; BYTE item = 0; - GroupMenuParam gmp = {0}; + GroupMenuParam gmp = { 0 }; HGENMENU mhRoot = HGENMENU_ROOT; HGENMENU mhExIm = HGENMENU_ROOT; @@ -395,7 +395,7 @@ void RebuildSubGroup() { int flag = 0; BYTE item = 0; - GroupMenuParam gmp = {0}; + GroupMenuParam gmp = { 0 }; HGENMENU mhRoot = HGENMENU_ROOT; HGENMENU mhExIm = HGENMENU_ROOT; diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index 0e7ed6998f..cb88a50811 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -112,10 +112,10 @@ static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara return FALSE; case WM_MEASUREITEM: //Needed by the contact's context menu - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_DRAWITEM: //Needed by the contact's context menu - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); case WM_NOTIFY: if (((LPNMHDR)lParam)->code == NM_AVATAR_CHANGED) diff --git a/plugins/Weather/src/weather_popup.cpp b/plugins/Weather/src/weather_popup.cpp index 8e5397ac0d..30c4c2a78e 100644 --- a/plugins/Weather/src/weather_popup.cpp +++ b/plugins/Weather/src/weather_popup.cpp @@ -187,15 +187,15 @@ LRESULT CALLBACK PopupWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam CallService(MS_USERINFO_SHOWDIALOG, wParam, 0); case WM_COMMAND: //Needed by the contact's context menu - if ( CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam),MPCF_CONTACTMENU), (LPARAM)hPopupContact)) + if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)hPopupContact)) break; return FALSE; case WM_MEASUREITEM: //Needed by the contact's context menu - return CallService(MS_CLIST_MENUMEASUREITEM,wParam,lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_DRAWITEM: //Needed by the contact's context menu - return CallService(MS_CLIST_MENUDRAWITEM,wParam,lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); } return DefWindowProc(hWnd, uMsg, wParam, lParam);//FALSE; diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp index 744d175452..80ca0aba1e 100644 --- a/protocols/JabberG/src/jabber_disco.cpp +++ b/protocols/JabberG/src/jabber_disco.cpp @@ -1125,9 +1125,9 @@ INT_PTR CJabberDlgDiscovery::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) break; case WM_MEASUREITEM: - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_DRAWITEM: - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); } diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp index d480705827..bb9dbffbd3 100644 --- a/src/core/stdchat/src/window.cpp +++ b/src/core/stdchat/src/window.cpp @@ -1060,7 +1060,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, { MEASUREITEMSTRUCT *mis = (MEASUREITEMSTRUCT *) lParam; if (mis->CtlType == ODT_MENU) - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); } return FALSE; @@ -1068,7 +1068,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, { DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *) lParam; if (dis->CtlType == ODT_MENU) - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); } return FALSE; @@ -1786,7 +1786,7 @@ END_REMOVETAB: { MEASUREITEMSTRUCT *mis = (MEASUREITEMSTRUCT *) lParam; if (mis->CtlType == ODT_MENU) - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); int ih = GetTextPixelSize( _T("AQGgl'"), g_Settings.UserListFont,FALSE); int ih2 = GetTextPixelSize( _T("AQGg'"), g_Settings.UserListHeadingsFont,FALSE); @@ -1805,7 +1805,7 @@ END_REMOVETAB: { DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *) lParam; if (dis->CtlType == ODT_MENU) - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); if (dis->CtlID == IDC_LIST) { int index = dis->itemID; diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp index 591cf78834..09c19b331b 100644 --- a/src/core/stdfile/src/filerecvdlg.cpp +++ b/src/core/stdfile/src/filerecvdlg.cpp @@ -293,7 +293,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l return TRUE; case WM_MEASUREITEM: - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_DRAWITEM: { @@ -309,7 +309,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l } } } - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); case WM_COMMAND: if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)dat->hContact)) diff --git a/src/core/stdfile/src/filesenddlg.cpp b/src/core/stdfile/src/filesenddlg.cpp index aa9cbee487..56aaf3bb88 100644 --- a/src/core/stdfile/src/filesenddlg.cpp +++ b/src/core/stdfile/src/filesenddlg.cpp @@ -276,7 +276,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l return TRUE; case WM_MEASUREITEM: - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_DRAWITEM: { @@ -292,7 +292,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l } } } - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); case M_FILECHOOSEDONE: if (lParam != 0) { diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp index a256f7316e..1db269962e 100644 --- a/src/core/stdfile/src/filexferdlg.cpp +++ b/src/core/stdfile/src/filexferdlg.cpp @@ -328,10 +328,10 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR break; case WM_MEASUREITEM: - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_DRAWITEM: - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); case WM_FT_CLEANUP: if (!dat->fs) { diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 583f6acd8d..acb7c0049d 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -1320,7 +1320,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP { LPMEASUREITEMSTRUCT mis = (LPMEASUREITEMSTRUCT)lParam; if (mis->CtlType == ODT_MENU) - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); } break; @@ -1328,7 +1328,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP { LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam; if (dis->CtlType == ODT_MENU) - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); if (dis->hwndItem == dat->hwndStatus) { DrawStatusIcons(dat->hContact, dis->hDC, dis->rcItem, 2); return TRUE; diff --git a/src/core/stdurl/urldialogs.cpp b/src/core/stdurl/urldialogs.cpp index 3fb66a7e25..0d781abc76 100644 --- a/src/core/stdurl/urldialogs.cpp +++ b/src/core/stdurl/urldialogs.cpp @@ -128,7 +128,7 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP return TRUE; case WM_MEASUREITEM: - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_DRAWITEM: { @@ -144,7 +144,7 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP } } } - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); case DM_UPDATETITLE: sttUpdateTitle(hwndDlg, dat->hContact); @@ -502,7 +502,7 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP break; case WM_MEASUREITEM: - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_DRAWITEM: { @@ -518,7 +518,7 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP } } } - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); case DM_UPDATETITLE: sttUpdateTitle(hwndDlg, dat->hContact); diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index 517aaceac5..6c3a6c3125 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -1277,10 +1277,10 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, return 0; case WM_MEASUREITEM: - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_DRAWITEM: - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); case WM_COMMAND: hit = cli.pfnGetRowByIndex(dat, dat->selection, &contact, NULL); diff --git a/src/mir_app/src/clistmenus.cpp b/src/mir_app/src/clistmenus.cpp index 32193ed18d..9baf333882 100644 --- a/src/mir_app/src/clistmenus.cpp +++ b/src/mir_app/src/clistmenus.cpp @@ -342,7 +342,7 @@ INT_PTR ContactMenuCheckService(WPARAM wParam, LPARAM) } TMO_MenuItem mi; - if (MO_GetMenuItem((WPARAM)pcpp->MenuItemHandle, (LPARAM)&mi) == 0) { + if (Menu_GetItemInfo(pcpp->MenuItemHandle, mi) == 0) { if (mi.flags & CMIF_HIDDEN) return FALSE; if (mi.flags & CMIF_NOTONLIST && bcp->isOnList) return FALSE; if (mi.flags & CMIF_NOTOFFLIST && !bcp->isOnList) return FALSE; @@ -681,8 +681,8 @@ static INT_PTR MenuProcessHotkey(WPARAM vKey, LPARAM) prochotkey = true; bool res = - MO_ProcessHotKeys(hStatusMenuObject, vKey) || - MO_ProcessHotKeys(hMainMenuObject, vKey); + Menu_ProcessHotKey(hStatusMenuObject, vKey) || + Menu_ProcessHotKey(hMainMenuObject, vKey); prochotkey = false; @@ -697,16 +697,6 @@ static int MenuIconsChanged(WPARAM, LPARAM) return 0; } -static INT_PTR MeasureMenuItem(WPARAM, LPARAM lParam) -{ - return MO_MeasureMenuItem((LPMEASUREITEMSTRUCT)lParam); -} - -static INT_PTR DrawMenuItem(WPARAM, LPARAM lParam) -{ - return MO_DrawMenuItem((LPDRAWITEMSTRUCT)lParam); -} - int RecursiveDeleteMenu(HMENU hMenu) { int cnt = GetMenuItemCount(hMenu); @@ -1210,9 +1200,6 @@ void InitCustomMenus(void) CreateServiceFunction("CList/AddContactMenuItem", AddContactMenuItem); CreateServiceFunction(MS_CLIST_MENUBUILDCONTACT, BuildContactMenu); - CreateServiceFunction(MS_CLIST_MENUMEASUREITEM, MeasureMenuItem); - CreateServiceFunction(MS_CLIST_MENUDRAWITEM, DrawMenuItem); - CreateServiceFunction(MS_CLIST_MENUGETSTATUS, BuildStatusMenu); CreateServiceFunction(MS_CLIST_MENUPROCESSCOMMAND, MenuProcessCommand); CreateServiceFunction(MS_CLIST_MENUPROCESSHOTKEY, MenuProcessHotkey); diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 018d4300f4..c899b5f1f4 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -965,12 +965,12 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break; case WM_MEASUREITEM: - if (((LPMEASUREITEMSTRUCT) lParam)->itemData == MENU_MIRANDAMENU) { - ((LPMEASUREITEMSTRUCT) lParam)->itemWidth = g_IconWidth * 4 / 3; - ((LPMEASUREITEMSTRUCT) lParam)->itemHeight = 0; + if (((LPMEASUREITEMSTRUCT)lParam)->itemData == MENU_MIRANDAMENU) { + ((LPMEASUREITEMSTRUCT)lParam)->itemWidth = g_IconWidth * 4 / 3; + ((LPMEASUREITEMSTRUCT)lParam)->itemHeight = 0; return TRUE; } - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + return Menu_MeasureItem((LPMEASUREITEMSTRUCT)lParam); case WM_DRAWITEM: { @@ -1029,7 +1029,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM IcoLib_ReleaseIcon(hIcon); return TRUE; } - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + return Menu_DrawItem((LPDRAWITEMSTRUCT)lParam); } } return 0; diff --git a/src/mir_app/src/genmenu.cpp b/src/mir_app/src/genmenu.cpp index 9396daad50..ef63bd933f 100644 --- a/src/mir_app/src/genmenu.cpp +++ b/src/mir_app/src/genmenu.cpp @@ -109,13 +109,11 @@ TMO_IntMenuItem* MO_RecursiveWalkMenu(TMO_IntMenuItem *parent, pfnWalkFunc func, } /////////////////////////////////////////////////////////////////////////////// -// wparam = 0 -// lparam = LPMEASUREITEMSTRUCT -int MO_MeasureMenuItem(LPMEASUREITEMSTRUCT mis) +MIR_APP_DLL(BOOL) Menu_MeasureItem(MEASUREITEMSTRUCT *mis) { if (!bIsGenMenuInited) - return -1; + return FALSE; if (mis == NULL) return FALSE; @@ -137,13 +135,11 @@ int MO_MeasureMenuItem(LPMEASUREITEMSTRUCT mis) } /////////////////////////////////////////////////////////////////////////////// -// wparam = 0 -// lparam = LPDRAWITEMSTRUCT -int MO_DrawMenuItem(LPDRAWITEMSTRUCT dis) +MIR_APP_DLL(BOOL) Menu_DrawItem(DRAWITEMSTRUCT *dis) { if (!bIsGenMenuInited) - return -1; + return FALSE; if (dis == NULL) return FALSE; @@ -184,6 +180,8 @@ int MO_DrawMenuItem(LPDRAWITEMSTRUCT dis) return TRUE; } +///////////////////////////////////////////////////////////////////////////////////////// + int MO_RemoveAllObjects() { for (int i = 0; i < g_menus.getCount(); i++) @@ -193,22 +191,20 @@ int MO_RemoveAllObjects() } ///////////////////////////////////////////////////////////////////////////////////////// -// wparam = MenuObjectHandle -// lparam = vKey -INT_PTR MO_ProcessHotKeys(HANDLE menuHandle, INT_PTR vKey) +EXTERN_C MIR_APP_DLL(BOOL) Menu_ProcessHotKey(HANDLE hMenuObject, int key) { if (!bIsGenMenuInited) return -1; mir_cslock lck(csMenuHook); - int objidx = GetMenuObjbyId((int)menuHandle); + int objidx = GetMenuObjbyId((int)hMenuObject); if (objidx == -1) return FALSE; for (TMO_IntMenuItem *pimi = g_menus[objidx]->m_items.first; pimi != NULL; pimi = pimi->next) { if (pimi->hotKey == 0) continue; - if (HIWORD(pimi->hotKey) != vKey) continue; + if (HIWORD(pimi->hotKey) != key) continue; if (!(LOWORD(pimi->hotKey) & MOD_ALT) != !(GetKeyState(VK_MENU) & 0x8000)) continue; if (!(LOWORD(pimi->hotKey) & MOD_CONTROL) != !(GetKeyState(VK_CONTROL) & 0x8000)) continue; if (!(LOWORD(pimi->hotKey) & MOD_SHIFT) != !(GetKeyState(VK_SHIFT) & 0x8000)) continue; @@ -220,6 +216,8 @@ INT_PTR MO_ProcessHotKeys(HANDLE menuHandle, INT_PTR vKey) return FALSE; } +///////////////////////////////////////////////////////////////////////////////////////// + MIR_APP_DLL(HGENMENU) Menu_GetProtocolRoot(const char *szProto) { if (szProto == NULL) @@ -243,23 +241,23 @@ MIR_APP_DLL(HGENMENU) Menu_GetProtocolRoot(const char *szProto) } ///////////////////////////////////////////////////////////////////////////////////////// -// wparam = MenuItemHandle -// lparam = PMO_MenuItem -INT_PTR MO_GetMenuItem(WPARAM wParam, LPARAM lParam) + +MIR_APP_DLL(int) Menu_GetItemInfo(HGENMENU hMenuItem, TMO_MenuItem &pInfo) { - TMO_MenuItem *mi = (TMO_MenuItem*)lParam; - if (!bIsGenMenuInited || mi == NULL) + if (!bIsGenMenuInited) return -1; - TMO_IntMenuItem *pimi = MO_GetIntMenuItem((HGENMENU)wParam); + TMO_IntMenuItem *pimi = MO_GetIntMenuItem(hMenuItem); mir_cslock lck(csMenuHook); if (pimi == NULL) return -1; - *mi = pimi->mi; + pInfo = pimi->mi; return 0; } +///////////////////////////////////////////////////////////////////////////////////////// + static int FindDefaultItem(TMO_IntMenuItem *pimi, void*) { if (pimi->mi.flags & (CMIF_GRAYED | CMIF_HIDDEN)) @@ -268,19 +266,17 @@ static int FindDefaultItem(TMO_IntMenuItem *pimi, void*) return (pimi->mi.flags & CMIF_DEFAULT) ? TRUE : FALSE; } -INT_PTR MO_GetDefaultMenuItem(WPARAM wParam, LPARAM) +MIR_APP_DLL(HGENMENU) Menu_GetDefaultItem(HGENMENU hMenu) { if (!bIsGenMenuInited) - return -1; + return NULL; - TMO_IntMenuItem *pimi = MO_GetIntMenuItem((HGENMENU)wParam); + TMO_IntMenuItem *pimi = MO_GetIntMenuItem(hMenu); mir_cslock lck(csMenuHook); - return (pimi) ? (INT_PTR)MO_RecursiveWalkMenu(pimi, FindDefaultItem, NULL) : NULL; + return (pimi) ? MO_RecursiveWalkMenu(pimi, FindDefaultItem, NULL) : NULL; } ///////////////////////////////////////////////////////////////////////////////////////// -// wparam MenuItemHandle -// lparam PMO_MenuItem MIR_APP_DLL(int) Menu_ModifyItem(HGENMENU hMenuItem, const TCHAR *ptszName, HANDLE hIcon, int iFlags) { @@ -329,20 +325,19 @@ MIR_APP_DLL(int) Menu_ModifyItem(HGENMENU hMenuItem, const TCHAR *ptszName, HAND } ///////////////////////////////////////////////////////////////////////////////////////// -// wparam MenuItemHandle -// return ownerdata useful to free ownerdata before delete menu item, -// NULL on error. -INT_PTR MO_MenuItemGetOwnerData(WPARAM wParam, LPARAM) +MIR_APP_DLL(void*) Menu_GetItemData(HGENMENU hMenuItem) { if (!bIsGenMenuInited) - return -1; + return NULL; mir_cslock lck(csMenuHook); - TMO_IntMenuItem *pimi = MO_GetIntMenuItem((HGENMENU)wParam); - return (pimi) ? (INT_PTR)pimi->mi.ownerdata : -1; + TMO_IntMenuItem *pimi = MO_GetIntMenuItem(hMenuItem); + return (pimi) ? pimi->mi.ownerdata : NULL; } +///////////////////////////////////////////////////////////////////////////////////////// + TMO_IntMenuItem *MO_GetIntMenuItem(HGENMENU wParam) { TMO_IntMenuItem *result = (TMO_IntMenuItem*)wParam; @@ -1105,7 +1100,7 @@ int TryProcessDoubleClick(MCONTACT hContact) if (iMenuID != -1) { NotifyEventHooks(hPreBuildContactMenuEvent, hContact, 0); - TMO_IntMenuItem *pimi = (TMO_IntMenuItem*)MO_GetDefaultMenuItem((WPARAM)g_menus[iMenuID]->m_items.first, 0); + TMO_IntMenuItem *pimi = Menu_GetDefaultItem(g_menus[iMenuID]->m_items.first); if (pimi != NULL) { Menu_ProcessCommand(pimi, hContact); return 0; @@ -1128,20 +1123,14 @@ static VOID CALLBACK PostRegisterIcons(HWND, UINT, UINT_PTR, DWORD) static int OnModulesLoaded(WPARAM, LPARAM) { - posttimerid = SetTimer((HWND)NULL, 0, 5, (TIMERPROC)PostRegisterIcons); + posttimerid = SetTimer(NULL, 0, 5, (TIMERPROC)PostRegisterIcons); HookEvent(ME_SKIN2_ICONSCHANGED, OnIconLibChanges); return 0; } int InitGenMenu() { - CreateServiceFunction(MO_MENUITEMGETOWNERDATA, MO_MenuItemGetOwnerData); - CreateServiceFunction(MO_GETMENUITEM, MO_GetMenuItem); - CreateServiceFunction(MO_GETDEFAULTMENUITEM, MO_GetDefaultMenuItem); - CreateServiceFunction(MO_PROCESSHOTKEYS, (MIRANDASERVICE)MO_ProcessHotKeys); - bIconsDisabled = db_get_b(NULL, "CList", "DisableMenuIcons", 0) != 0; - bIsGenMenuInited = true; HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); diff --git a/src/mir_app/src/genmenu.h b/src/mir_app/src/genmenu.h index 7ae31f8b25..17c6102763 100644 --- a/src/mir_app/src/genmenu.h +++ b/src/mir_app/src/genmenu.h @@ -110,7 +110,6 @@ TMO_IntMenuItem* MO_AddOldNewMenuItem(HANDLE menuobjecthandle, TMO_MenuItem *pmi int MO_DrawMenuItem(LPDRAWITEMSTRUCT dis); int MO_MeasureMenuItem(LPMEASUREITEMSTRUCT mis); -INT_PTR MO_ProcessHotKeys(HANDLE menuHandle, INT_PTR vKey); int MO_ProcessCommandBySubMenuIdent(int menuID, int command, LPARAM lParam); @@ -137,6 +136,5 @@ int GetMenuItembyId(const int objpos, const int id); int ProtocolOrderOptInit(WPARAM wParam, LPARAM); -INT_PTR MO_GetMenuItem(WPARAM wParam, LPARAM lParam); void FreeAndNil(void **p); #endif diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index f54b171e6c..ee225cae3c 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -212,3 +212,9 @@ Menu_AddItem @209 Menu_RemoveItem @210 Menu_AddObject @211 Menu_RemoveObject @212 +Menu_GetItemData @213 +Menu_GetDefaultItem @214 +Menu_GetItemInfo @215 +Menu_ProcessHotKey @216 +Menu_DrawItem @217 +Menu_MeasureItem @218 diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index c97bd514b1..e0a756b14f 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -212,3 +212,9 @@ Menu_AddItem @209 Menu_RemoveItem @210 Menu_AddObject @211 Menu_RemoveObject @212 +Menu_GetItemData @213 +Menu_GetDefaultItem @214 +Menu_GetItemInfo @215 +Menu_ProcessHotKey @216 +Menu_DrawItem @217 +Menu_MeasureItem @218 -- cgit v1.2.3