From 22cf7a0a7d9d2f749949ab2fee8e2ad862da91a5 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Thu, 1 Jan 2004 17:47:48 +0000 Subject: [PATCH] some more fixes svn path=/trunk/; revision=7393 --- reactos/subsys/system/regedit/En.rc | 23 +++++++++++++++++++++++ reactos/subsys/system/regedit/edit.c | 2 +- reactos/subsys/system/regedit/listview.c | 16 ++++++++++++++++ reactos/subsys/system/regedit/main.c | 2 ++ reactos/subsys/system/regedit/main.h | 4 ++++ reactos/subsys/system/regedit/resource.h | 2 ++ 6 files changed, 48 insertions(+), 1 deletion(-) diff --git a/reactos/subsys/system/regedit/En.rc b/reactos/subsys/system/regedit/En.rc index 87b72d30ae1..4406ed416a2 100644 --- a/reactos/subsys/system/regedit/En.rc +++ b/reactos/subsys/system/regedit/En.rc @@ -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 diff --git a/reactos/subsys/system/regedit/edit.c b/reactos/subsys/system/regedit/edit.c index 35fae09da56..e55ee659b15 100644 --- a/reactos/subsys/system/regedit/edit.c +++ b/reactos/subsys/system/regedit/edit.c @@ -159,7 +159,7 @@ BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCTSTR valueName) } if (DialogBox(0, MAKEINTRESOURCE(IDD_EDIT_STRING), hwnd, modify_string_dlgproc) == IDOK) { if(stringValueData) - {MessageBox(0, stringValueData, valueName, 0); + { lRet = RegSetValueEx(hKey, valueName, 0, type, stringValueData, lstrlen(stringValueData) + 1); } else diff --git a/reactos/subsys/system/regedit/listview.c b/reactos/subsys/system/regedit/listview.c index fc7c68a9635..97f58101595 100644 --- a/reactos/subsys/system/regedit/listview.c +++ b/reactos/subsys/system/regedit/listview.c @@ -368,6 +368,22 @@ 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; + int cnt; + pt = MAKEPOINTS(lParam); + cnt = ListView_GetNextItem(hWnd, -1, LVNI_FOCUSED | LVNI_SELECTED); + if(cnt == -1) + { + TrackPopupMenu(GetSubMenu(hPopupMenus, PM_NEW), TPM_RIGHTBUTTON, pt.x, pt.y, 0, hFrameWnd, NULL); + } + else + { + TrackPopupMenu(GetSubMenu(hPopupMenus, PM_MODIFYVALUE), TPM_RIGHTBUTTON, pt.x, pt.y, 0, hFrameWnd, NULL); + } + break; + } case WM_KEYDOWN: if (wParam == VK_TAB) { /*TODO: SetFocus(Globals.hDriveBar) */ diff --git a/reactos/subsys/system/regedit/main.c b/reactos/subsys/system/regedit/main.c index 268d9c7ff6e..cd1b534c47a 100644 --- a/reactos/subsys/system/regedit/main.c +++ b/reactos/subsys/system/regedit/main.c @@ -41,6 +41,7 @@ HINSTANCE hInst; HWND hFrameWnd; HWND hStatusBar; HMENU hMenuFrame; +HMENU hPopupMenus = 0; UINT nClipboardFormat; LPCTSTR strClipboardFormat = _T("TODO: SET CORRECT FORMAT"); @@ -103,6 +104,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(); diff --git a/reactos/subsys/system/regedit/main.h b/reactos/subsys/system/regedit/main.h index 8aa69cd7356..6f86a50e81a 100644 --- a/reactos/subsys/system/regedit/main.h +++ b/reactos/subsys/system/regedit/main.h @@ -33,6 +33,9 @@ #define COUNT_OF(a) (sizeof(a)/sizeof(a[0])) +#define PM_MODIFYVALUE 0 +#define PM_NEW 1 + extern HINSTANCE hInst; /******************************************************************************/ @@ -65,6 +68,7 @@ extern HINSTANCE hInst; extern HWND hFrameWnd; extern HMENU hMenuFrame; extern HWND hStatusBar; +extern HMENU hPopupMenus; extern HFONT hFont; extern enum OPTION_FLAGS Options; diff --git a/reactos/subsys/system/regedit/resource.h b/reactos/subsys/system/regedit/resource.h index 173ee75550e..5c161df3013 100644 --- a/reactos/subsys/system/regedit/resource.h +++ b/reactos/subsys/system/regedit/resource.h @@ -42,6 +42,7 @@ #define IDI_ROOT 134 #define IDI_STRING 135 #define IDI_BIN 136 +#define IDR_POPUP_MENUS 137 #define IDC_LICENSE_EDIT 1029 #define ID_REGISTRY_EXIT 32770 #define ID_FAVOURITES_ADDTOFAVOURITES 32772 @@ -107,6 +108,7 @@ #define IDS_BAD_VALUE 32837 #define IDS_UNSUPPORTED_TYPE 32838 #define IDS_TOO_BIG_VALUE 32839 +#define ID_EDIT_MODIFY_BIN 32840 #define IDD_EDIT_STRING 2000 #define IDC_VALUE_NAME 2001