diff options
author | George Hazan <ghazan@miranda.im> | 2017-03-24 15:38:17 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-03-24 15:38:17 +0300 |
commit | e84bafdd3f3d2eb67e10a9bd3fbe600748962b6f (patch) | |
tree | 1b563061e473ef8bbe62b86821da21c319cca2c5 /include | |
parent | aa55162ab85df5aa0ac6b87711bfee222b3222dd (diff) |
revolution in chat menus
- common code moved to the core (Chat_CreateGCMenu, Chat_DestroyGCMenu);
- ability added to any plugin to add its own items into any GC menu, not only to the protocol plugins
to do that a plugin calls Chat_AddMenuItems and returns 0 to allow any other plugin to process menu hook
Diffstat (limited to 'include')
-rw-r--r-- | include/m_chat.h | 5 | ||||
-rw-r--r-- | include/m_chat_int.h | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/include/m_chat.h b/include/m_chat.h index 6188353d45..c241b7675c 100644 --- a/include/m_chat.h +++ b/include/m_chat.h @@ -538,13 +538,14 @@ typedef struct { LPWSTR pszID; // The unique identifier of the session that triggered the hook, do NOT change.
LPWSTR pszUID; // Contains the unique identifier if Type = MENU_ON_NICKLIST. do NOT change.
int Type; // Type of menu. MENU_ON_* flags used. do NOT change.
- int nItems; // Set this to the number of menu items you want to add
- gc_item *Item; // pointer to the first in the array of gc_item's
+ HMENU hMenu; // pass this handle to a call of Srmm_AddMenuItems
}
GCMENUITEMS;
#define ME_GC_BUILDMENU "GChat/BuildMenu"
+EXTERN_C MIR_APP_DLL(void) Chat_AddMenuItems(HMENU hMenu, int nItems, const gc_item *Item);
+
//////////////////////////////////////////////////////////////////////////
// Get Chat ToolTip Text for buddy
// wParam = (WPARAM)(wchar_t*) roomID parentdat->ptszID
diff --git a/include/m_chat_int.h b/include/m_chat_int.h index 0538621c60..0d61454f5e 100644 --- a/include/m_chat_int.h +++ b/include/m_chat_int.h @@ -387,6 +387,10 @@ EXTERN_C MIR_APP_DLL(DWORD) CALLBACK Srmm_MessageStreamCallback(DWORD_PTR dwCook // updates options for all windows
EXTERN_C MIR_APP_DLL(void) Chat_UpdateOptions();
+// chat menu creation / destruction
+EXTERN_C MIR_APP_DLL(UINT) Chat_CreateGCMenu(HWND hwnd, HMENU hMenu, POINT pt, SESSION_INFO *si, const wchar_t *pszUID, const wchar_t *pszWordText);
+EXTERN_C MIR_APP_DLL(void) Chat_DestroyGCMenu(HMENU hMenu, int iIndex);
+
/////////////////////////////////////////////////////////////////////////////////////////
#include <chat_resource.h>
|