From b6432457c35f22d5fd4377284e2e7d5d6736e6dc Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 5 Sep 2016 10:56:12 +0000 Subject: compilation fix git-svn-id: http://svn.miranda-ng.org/main/trunk@17254 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- include/delphi/m_clist.inc | 79 ++------------------------------ include/delphi/m_genmenu.inc | 12 +++++ plugins/HistoryPlusPlus/GlobalSearch.pas | 9 ++-- plugins/HistoryPlusPlus/HistoryForm.pas | 9 ++-- plugins/QuickSearch/sr_window.pas | 8 ++-- 5 files changed, 25 insertions(+), 92 deletions(-) diff --git a/include/delphi/m_clist.inc b/include/delphi/m_clist.inc index 2603919212..c5366fcf72 100644 --- a/include/delphi/m_clist.inc +++ b/include/delphi/m_clist.inc @@ -116,28 +116,6 @@ const CLEF_PROTOCOLGLOBAL = 8; // set event globally for protocol, hContact has to // be NULL, lpszProtocol the protocol ID name to be set - { - wParam : ControlID - lParam : Pointer to MEASUREITEMSTRUCT struct - Affect : Process a WM_MEASUREITEM message for user context menus, see notes - Notes : just because wParam, lParam is defined here, only pass them - opaquely to this service, as is. - - - This is just to draw icons, if it is not called, the icons - will not be drawn - Version: v0.1.1.0+ - } - MS_CLIST_MENUMEASUREITEM:PAnsiChar = 'CList/MenuMeasureItem'; - - { - wParam : - lParam : - Affect : Process a WM_DRAWITEM message for user context menus, - wParam, lParam should be passed from such message handler. - Version: v0.1.1.0+ - } - MS_CLIST_MENUDRAWITEM:PAnsiChar = 'CList/MenuDrawItem'; - { wParam : 0 lParam : 0 @@ -161,74 +139,24 @@ const CLISTMENUIDMIN = $4000; // reserved range for clist menu ids CLISTMENUIDMAX = $7FFF; - { - NOTE: v0.7.0.26+ - Due to it is generic practice to handle menu command via WM_COMMAND - window message handle and practice to process it via calling service - in form: CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), - MPCF_CONTACTMENU),(LPARAM) hContact)) - to ensure that WM_COMMAND was realy from clist menu not from other menu - it is reserved range of menu ids from CLISTMENUIDMIN to CLISTMENUIDMAX - the menu items with ids outside from such range will not be processed by service. - Moreover if you process WM_COMMAND youself and your window contains self menu - please be sure that you will not call service for non-clist menu items. - The simplest way is to ensure that your menus are not use item ids from such range. - Otherwise, you HAVE TO distinguish WM_COMMAND from clist menus and from your - internal menu and DO NOT call MS_CLIST_MENUPROCESSCOMMAND for non clist menus. - } + MPCF_CONTACTMENU = 1; // test commands from a contact menu MPCF_MAINMENU = 2; // test commands from the main menu { - wParam : MAKEWPARAM(LOWORD(wParam of WM_COMMAND),flags) - lParam : TMCONTACT Affect : Process a menu selection from a menu, see notes Returns: True if it processed the command, False otherwise notes : hContact is the currently selected contact, it is not used if this is a main menu command, if this is NULL then the command is a contact menu one, the command is ignored - Version: v0.1.1.0+ } - MS_CLIST_MENUPROCESSCOMMAND:PAnsiChar = 'CList/MenuProcessCommand'; + function Clist_MenuProcessCommand(menuid,flags:int; hContact:TMCONTACT) : integer; stdcall; external AppDll; { - wParam : virtual key code - lParam : MPCF_* flags Affect : Process a menu hotkey, see notes Returns: True if it processed the command, False otherwise Notes : this should be called in WM_KEYDOWN - Version: v0.1.1.0+ } - MS_CLIST_MENUPROCESSHOTKEY:PAnsiChar = 'CList/MenuProcessHotkey'; - - { - wParam : Pointer to a MSG structurer - lParam : Pointer to an LRESULT - Affect : Process all the messages required for docking, see notes - Returns: True if the message should NOT be processed anymore, False otherwise - Notes : only msg.hwnd, msg.message, msg.wParam and msg.lParam are used - your WndProc should return the lResult if AND only IF, TRUE is returned - Version: v0.1.1.0+ - } - MS_CLIST_DOCKINGPROCESSMESSAGE:PAnsiChar = 'CList/DockingProcessMessage'; - - { - wParam : 0 - lParam : 0 - Affect : Determines wheter the contact list docked - Returns: pnon zero] if the contact list is docked, or 0 if it's not - Version: v0.1.1.0+ - } - MS_CLIST_DOCKINGISDOCKED:PAnsiChar = 'CList/DockingIsDocked'; - - { - wParam : Pointer to TMSG - lParam : Pointer to an LRESULT - Affect : Process all the messages required for hotkeys, see notes - Returns: True if the message should not be processed anymore or False otherwise - Notes : only msg.hwnd, msg.message, msg.wParam, msg.lParam are used - Version: v0.1.1.0+ - } - MS_CLIST_HOTKEYSPROCESSMESSAGE:PAnsiChar = 'CList/HotkeysProcessMessage'; + function Clist_MenuProcessHotkey(virtKey:uint) : integer; stdcall; external AppDll; { wParam : 0 @@ -237,6 +165,7 @@ const Returns: 0 on success, [non zero] on failure Version: v0.1.1.0+ } +const MS_CLIST_SHOWHIDE:PAnsiChar = 'CList/ShowHide'; { diff --git a/include/delphi/m_genmenu.inc b/include/delphi/m_genmenu.inc index 2c7546f916..15ee72abeb 100644 --- a/include/delphi/m_genmenu.inc +++ b/include/delphi/m_genmenu.inc @@ -279,6 +279,18 @@ function Menu_GetItemInfo(hMenuItem:HGENMENU; var mi:TMO_MenuItem) : integer; st function Menu_GetDefaultItem(hMenuItem:HGENMENU) : HGENMENU; stdcall; external AppDLL; +{ + processes a WM_DRAWITEM message for user context menus, +} + +function Menu_DrawItem(dis:LPARAM) : integer; stdcall; external AppDll; + +{ + processes a WM_MEASUREITEM message for user context menus, see notes +} + +function Menu_MeasureItem(mis:LPARAM) : integer; stdcall; external AppDll; + { wparam=MenuObjectHandle lparam=vKey diff --git a/plugins/HistoryPlusPlus/GlobalSearch.pas b/plugins/HistoryPlusPlus/GlobalSearch.pas index a868423ead..44eb3283ea 100644 --- a/plugins/HistoryPlusPlus/GlobalSearch.pas +++ b/plugins/HistoryPlusPlus/GlobalSearch.pas @@ -1672,23 +1672,20 @@ begin inherited; if Message.Result <> 0 then exit; - Message.Result := CallService(MS_CLIST_MENUPROCESSCOMMAND, - MAKEWPARAM(Message.WParamLo, MPCF_CONTACTMENU), UserMenuContact); + Message.Result := Clist_MenuProcessCommand(Message.WParamLo, MPCF_CONTACTMENU, UserMenuContact); exit; end; WM_MEASUREITEM: if Self.UserMenu <> 0 then begin - Message.Result := CallService(MS_CLIST_MENUMEASUREITEM, Message.wParam, - Message.LParam); + Message.Result := Menu_MeasureItem(Message.LParam); if Message.Result <> 0 then exit; end; WM_DRAWITEM: if Self.UserMenu <> 0 then begin - Message.Result := CallService(MS_CLIST_MENUDRAWITEM, Message.wParam, - Message.LParam); + Message.Result := Menu_DrawItem(Message.LParam); if Message.Result <> 0 then exit; end; diff --git a/plugins/HistoryPlusPlus/HistoryForm.pas b/plugins/HistoryPlusPlus/HistoryForm.pas index 5593f130f1..2eed1dd124 100644 --- a/plugins/HistoryPlusPlus/HistoryForm.pas +++ b/plugins/HistoryPlusPlus/HistoryForm.pas @@ -3626,23 +3626,20 @@ begin inherited; if Message.Result <> 0 then Exit; - Message.Result := CallService(MS_CLIST_MENUPROCESSCOMMAND, - MAKEWPARAM(Message.WParamLo, MPCF_CONTACTMENU), hContact); + Message.Result := Clist_MenuProcessCommand(Message.WParamLo, MPCF_CONTACTMENU, hContact); Exit; end; WM_MEASUREITEM: if Self.UserMenu <> 0 then begin - Message.Result := CallService(MS_CLIST_MENUMEASUREITEM, Message.wParam, - Message.lParam); + Message.Result := Menu_MeasureItem(Message.LParam); if Message.Result <> 0 then Exit; end; WM_DRAWITEM: if Self.UserMenu <> 0 then begin - Message.Result := CallService(MS_CLIST_MENUDRAWITEM, Message.wParam, - Message.lParam); + Message.Result := Menu_DrawItem(Message.LParam); if Message.Result <> 0 then Exit; end; diff --git a/plugins/QuickSearch/sr_window.pas b/plugins/QuickSearch/sr_window.pas index 9521d9525e..a2f96e4098 100644 --- a/plugins/QuickSearch/sr_window.pas +++ b/plugins/QuickSearch/sr_window.pas @@ -2095,9 +2095,9 @@ begin end; WM_MEASUREITEM: - CallService(MS_CLIST_MENUMEASUREITEM,wParam,lParam); + Menu_MeasureItem(lParam); WM_DRAWITEM: - CallService(MS_CLIST_MENUDRAWITEM,wParam,lParam); + Menu_DrawItem(lParam); WM_MOUSEMOVE: begin if TTInstalled then @@ -2128,9 +2128,7 @@ begin end; WM_COMMAND: begin - if CallService(MS_CLIST_MENUPROCESSCOMMAND, - MAKEWPARAM(LOWORD(wParam),MPCF_CONTACTMENU), - GetFocusedhContact)<>0 then + if Clist_MenuProcessCommand(LOWORD(wParam),MPCF_CONTACTMENU,GetFocusedhContact)<>0 then begin if (qsopt.flags and QSO_AUTOCLOSE)<>0 then CloseSrWindow; -- cgit v1.2.3