From eb9d0e929afd7e8ddabfe3dacfc9a6655e672c72 Mon Sep 17 00:00:00 2001 From: "Dimitrie O. Paun" Date: Mon, 15 Mar 2004 20:07:44 +0000 Subject: [PATCH] Add all needed accelerators to regedit. Cleanups. --- programs/regedit/main.c | 22 ++++------------------ programs/regedit/rsrc.rc | 10 ++++++++++ 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/programs/regedit/main.c b/programs/regedit/main.c index 4f2f5db6dd3..33d413793dc 100644 --- a/programs/regedit/main.c +++ b/programs/regedit/main.c @@ -151,29 +151,15 @@ int APIENTRY WinMain(HINSTANCE hInstance, { MSG msg; HACCEL hAccel; - /* - int hCrt; - FILE *hf; - AllocConsole(); - hCrt = _open_osfhandle((long)GetStdHandle(STD_OUTPUT_HANDLE), _O_TEXT); - hf = _fdopen(hCrt, "w"); - *stdout = *hf; - setvbuf(stdout, NULL, _IONBF, 0); - - wprintf(L"command line exit, hInstance = %d\n", hInstance); - getch(); - FreeConsole(); - return 0; - */ if (ProcessCmdLine(lpCmdLine)) { return 0; } /* Initialize global strings */ - LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); - LoadString(hInstance, IDC_REGEDIT_FRAME, szFrameClass, MAX_LOADSTRING); - LoadString(hInstance, IDC_REGEDIT, szChildClass, MAX_LOADSTRING); + LoadString(hInstance, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle)); + LoadString(hInstance, IDC_REGEDIT_FRAME, szFrameClass, COUNT_OF(szFrameClass)); + LoadString(hInstance, IDC_REGEDIT, szChildClass, COUNT_OF(szChildClass)); /* Store instance handle in our global variable */ hInst = hInstance; @@ -186,7 +172,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, /* Main message loop */ while (GetMessage(&msg, (HWND)NULL, 0, 0)) { - if (!TranslateAccelerator(msg.hwnd, hAccel, &msg) && + if (!TranslateAccelerator(hFrameWnd, hAccel, &msg) && !IsDialogMessage(hFrameWnd, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); diff --git a/programs/regedit/rsrc.rc b/programs/regedit/rsrc.rc index a8e3e7c020e..3c5d87951a1 100644 --- a/programs/regedit/rsrc.rc +++ b/programs/regedit/rsrc.rc @@ -25,6 +25,16 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +IDC_REGEDIT ACCELERATORS +{ + "^F", ID_EDIT_FIND + "^P", ID_REGISTRY_PRINT + VK_DELETE, ID_EDIT_DELETE, VIRTKEY + VK_F1, ID_HELP_HELPTOPICS, VIRTKEY + VK_F3, ID_EDIT_FINDNEXT, VIRTKEY + VK_F5, ID_VIEW_REFRESH, VIRTKEY +} + #include "resource.rc" /* include localised resources */