From 82011595ca58ce31524a07954150a6022475987e Mon Sep 17 00:00:00 2001 From: Mataes Date: Fri, 1 May 2020 23:43:49 +0300 Subject: newstory: add function OnContextMenu --- plugins/NewStory/src/history_control.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'plugins/NewStory/src') diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index 5a44e50107..419161855f 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -33,6 +33,11 @@ struct NewstoryListData : public MZeroedObject HWND hwnd; HWND hwndEditBox; + void OnContextMenu(int index) + { + ItemData* item = items.get(index, ItemData::ELM_DATA); + } + void BeginEditItem(int index) { if (hwndEditBox) @@ -924,9 +929,8 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case WM_CONTEXTMENU: { - HMENU menu = LoadMenu(g_plugin.getInst(), MAKEINTRESOURCE(IDR_POPUPS)); - HMENU submenu = GetSubMenu(menu, 2); - TranslateMenu(submenu); + int index = SendMessage(hwnd, NSM_GETITEMFROMPIXEL, LOWORD(lParam), HIWORD(lParam)); + data->OnContextMenu(index); } break; } -- cgit v1.2.3