Commit 649643aa authored by Thomas Weidenmueller's avatar Thomas Weidenmueller Committed by Alexandre Julliard

Added context menu support.

parent f3957f52
......@@ -102,6 +102,29 @@ BEGIN
END
END
IDR_POPUP_MENUS MENU DISCARDABLE
BEGIN
POPUP ""
BEGIN
MENUITEM "&Modify", ID_EDIT_MODIFY
MENUITEM "Modify Binary Data", ID_EDIT_MODIFY_BIN
MENUITEM SEPARATOR
MENUITEM "&Delete\tDel", ID_EDIT_DELETE
MENUITEM "&Rename", ID_EDIT_RENAME
END
POPUP ""
BEGIN
POPUP "&New"
BEGIN
MENUITEM "&Key", ID_EDIT_NEW_KEY
MENUITEM SEPARATOR
MENUITEM "&String Value", ID_EDIT_NEW_STRINGVALUE
MENUITEM "&Binary Value", ID_EDIT_NEW_BINARYVALUE
MENUITEM "&DWORD Value", ID_EDIT_NEW_DWORDVALUE
END
END
END
/*
* Dialog
......
......@@ -346,6 +346,13 @@ static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
return CallWindowProc(g_orgListWndProc, hWnd, message, wParam, lParam);
}
break;
case WM_CONTEXTMENU: {
POINTS pt = MAKEPOINTS(lParam);
int cnt = ListView_GetNextItem(hWnd, -1, LVNI_FOCUSED | LVNI_SELECTED);
TrackPopupMenu(GetSubMenu(hPopupMenus, cnt == -1 ? PM_NEW : PM_MODIFYVALUE),
TPM_RIGHTBUTTON, pt.x, pt.y, 0, hFrameWnd, NULL);
break;
}
case WM_KEYDOWN:
if (wParam == VK_TAB) {
/*TODO: SetFocus(Globals.hDriveBar) */
......
......@@ -42,6 +42,7 @@ HINSTANCE hInst;
HWND hFrameWnd;
HWND hStatusBar;
HMENU hMenuFrame;
HMENU hPopupMenus = 0;
UINT nClipboardFormat;
LPCTSTR strClipboardFormat = _T("TODO: SET CORRECT FORMAT");
......@@ -104,6 +105,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
hChildWndClass = hChildWndClass; /* warning eater */
hMenuFrame = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_REGEDIT_MENU));
hPopupMenus = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_POPUP_MENUS));
/* Initialize the Windows Common Controls DLL */
InitCommonControls();
......
......@@ -32,6 +32,9 @@
#define COUNT_OF(a) (sizeof(a)/sizeof(a[0]))
#define PM_MODIFYVALUE 0
#define PM_NEW 1
extern HINSTANCE hInst;
/******************************************************************************/
......@@ -64,6 +67,7 @@ extern HINSTANCE hInst;
extern HWND hFrameWnd;
extern HMENU hMenuFrame;
extern HWND hStatusBar;
extern HMENU hPopupMenus;
extern HFONT hFont;
extern enum OPTION_FLAGS Options;
......
......@@ -41,6 +41,7 @@
#define IDD_DIALOG2 132
#define IDB_CLOSED_FILE 133
#define IDB_ROOT 134
#define IDR_POPUP_MENUS 137
#define IDC_LICENSE_EDIT 1029
#define ID_REGISTRY_EXIT 32770
#define ID_FAVOURITES_ADDTOFAVOURITES 32772
......@@ -114,6 +115,7 @@
#define IDC_DWORD_DEC 32854
#define IDS_NEWKEY 32860
#define IDS_NEWVALUE 32861
#define ID_EDIT_MODIFY_BIN 32870
#define IDD_EDIT_STRING 2000
#define IDC_VALUE_NAME 2001
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment