(from <Someone>)
This patch implements Michael's idea to have a "NetHack mode" for keypresses. It only does the Alt-keys now, but it should be easy to extend to pressing space in dialogs; I left that out as we still have to agree on a new dialog look. The setting that you choose from the menu is stored in the registry. Reading and writing the registry is done on init_nhwindows and exit_nhwindows; there also is a menu item to delete the registry settings (which makes sure they are not stored again this session.) This provides a framework for future registry settings. Also, Alt-tab should show the app title when a menu or text window is up. I left the app title as it was, although I still favour "Graphical Version" or "With Graphics"; Anyway, that's only one resource string.
This commit is contained in:
@@ -229,6 +229,8 @@ BOOL CALLBACK MenuWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
PNHMenuWindow data;
|
||||
HWND control;
|
||||
HDC hdc;
|
||||
TCHAR title[MAX_LOADSTRING];
|
||||
|
||||
|
||||
data = (PNHMenuWindow)GetWindowLong(hWnd, GWL_USERDATA);
|
||||
switch (message)
|
||||
@@ -254,6 +256,11 @@ BOOL CALLBACK MenuWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
/* subclass edit control */
|
||||
editControlWndProc = (WNDPROC)GetWindowLong(control, GWL_WNDPROC);
|
||||
SetWindowLong(control, GWL_WNDPROC, (LONG)NHMenuTextWndProc);
|
||||
|
||||
/* Even though the dialog has no caption, you can still set the title
|
||||
which shows on Alt-Tab */
|
||||
LoadString(GetNHApp()->hApp, IDS_APP_TITLE, title, MAX_LOADSTRING);
|
||||
SetWindowText(hWnd, title);
|
||||
break;
|
||||
|
||||
case WM_MSNH_COMMAND:
|
||||
|
||||
Reference in New Issue
Block a user