comparison os2/dw.c @ 466:c3dfa117b080

Added new code to make the menu handlers window local instead of global. According to the docs this will only work on Win2k/98 and above, so I added a WINNT_COMPAT define to allow Dynamic Windows to work on WinNT and Win95 without the new menu code. Also improved on this same fix for OS/2.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 08 Oct 2003 09:36:10 +0000
parents 4ff2c7210973
children 0a2f13ba2d5c
comparison
equal deleted inserted replaced
465:4ff2c7210973 466:c3dfa117b080
2155 case WM_COMMAND: 2155 case WM_COMMAND:
2156 { 2156 {
2157 int (* API clickfunc)(HWND, void *) = (int (* API)(HWND, void *))tmp->signalfunction; 2157 int (* API clickfunc)(HWND, void *) = (int (* API)(HWND, void *))tmp->signalfunction;
2158 ULONG command = COMMANDMSG(&msg)->cmd; 2158 ULONG command = COMMANDMSG(&msg)->cmd;
2159 2159
2160 if(tmp->id) 2160 if(tmp->id && command == tmp->id)
2161 { 2161 {
2162 HWND menuowner = _menu_owner(tmp->window); 2162 HWND menuowner = _menu_owner(tmp->window);
2163 2163
2164 if((menuowner == hWnd || menuowner == NULLHANDLE) && command == tmp->id) 2164 if(menuowner == hWnd || menuowner == NULLHANDLE)
2165 { 2165 {
2166 result = clickfunc(tmp->window, tmp->data); 2166 result = clickfunc(tmp->window, tmp->data);
2167 tmp = NULL; 2167 tmp = NULL;
2168 } 2168 }
2169 } 2169 }