Changeset 6762 for trunk/src/user32/winaccel.cpp
- Timestamp:
- Sep 19, 2001, 5:39:52 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/winaccel.cpp
r5935 r6762 1 /* $Id: winaccel.cpp,v 1. 8 2001-06-09 14:50:24sandervl Exp $ */1 /* $Id: winaccel.cpp,v 1.9 2001-09-19 15:39:52 sandervl Exp $ */ 2 2 /* 3 3 * Win32 accelerator key functions for OS/2 … … 19 19 #include <heapstring.h> 20 20 #include "win32wbase.h" 21 #include "win32wmdiclient.h"22 21 #include <win\winnls.h> 23 22 … … 213 212 return 0; 214 213 } 215 //******************************************************************************216 //******************************************************************************217 BOOL WIN32API TranslateMDISysAccel(HWND hwndClient, LPMSG msg)218 {219 SetLastError(ERROR_SUCCESS);220 221 if(IsWindow(hwndClient) && (msg->message == WM_KEYDOWN || msg->message == WM_SYSKEYDOWN))222 {223 Win32MDIClientWindow *clientWnd;224 Win32MDIChildWindow *mdichild;225 HWND hwndChild;226 227 clientWnd = (Win32MDIClientWindow *)Win32BaseWindow::GetWindowFromHandle(hwndClient);228 if(!clientWnd) {229 dprintf(("TranslateMDISysAccel window %x not found", hwndClient));230 SetLastError(ERROR_INVALID_WINDOW_HANDLE);231 return FALSE;232 }233 234 hwndChild = clientWnd->getActiveChild();235 RELEASE_WNDOBJ(clientWnd);236 if(!hwndChild) {237 dprintf(("TranslateMDISysAccel NO active MDI child!!"));238 return FALSE;239 }240 241 if(IsWindow(hwndChild) && !(GetWindowLongA(hwndChild,GWL_STYLE) & WS_DISABLED) )242 {243 WPARAM wParam = 0;244 245 /* translate if the Ctrl key is down and Alt not. */246 if( (GetKeyState(VK_CONTROL) & 0x8000) &&247 !(GetKeyState(VK_MENU) & 0x8000))248 {249 switch( msg->wParam )250 {251 case VK_F6:252 case VK_TAB:253 wParam = ( GetKeyState(VK_SHIFT) & 0x8000 )254 ? SC_NEXTWINDOW : SC_PREVWINDOW;255 break;256 case VK_F4:257 case VK_RBUTTON:258 wParam = SC_CLOSE;259 break;260 default:261 return 0;262 }263 SendMessageA(hwndChild, WM_SYSCOMMAND, wParam, (LPARAM)msg->wParam);264 return 1;265 }266 }267 }268 return 0; /* failure */269 }270 214 /********************************************************************** 271 215 * LoadAccelerators32W [USER.177]
Note:
See TracChangeset
for help on using the changeset viewer.