- Timestamp:
- Sep 5, 1999, 5:53:10 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/makefile
r833 r835 1 # $Id: makefile,v 1.4 4 1999-09-05 12:03:32sandervl Exp $1 # $Id: makefile,v 1.45 1999-09-05 15:53:08 sandervl Exp $ 2 2 3 3 # … … 87 87 msgbox.obj: msgbox.cpp 88 88 window.obj: window.cpp win32class.h win32wbase.h win32wndchild.h oslibwin.h win32wmdiclient.h 89 windowmsg.obj: windowmsg.cpp win32class.h win32wbase.h win32wndchild.h 89 windowmsg.obj: windowmsg.cpp win32class.h win32wbase.h win32wndchild.h oslibmsg.h 90 90 winprop.obj: winprop.cpp 91 91 wingdi.obj: wingdi.cpp win32wbase.h oslibgdi.h … … 103 103 win32wbase.obj: win32wbase.cpp win32class.h win32wbase.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h 104 104 win32wnd.obj: win32wnd.cpp win32class.h win32wbase.h win32wnd.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h $(PDWIN32_INCLUDE)\winres.h oslibres.h win32wndhandle.h oslibdos.h oslibmenu.h 105 win32dlg.obj: win32dlg.cpp win32class.h win32wbase.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h 105 win32dlg.obj: win32dlg.cpp win32class.h win32wbase.h win32dlg.h gen_object.h heapshared.h oslibwin.h win32wndchild.h oslibmsg.h 106 106 win32wndchild.obj: win32wndchild.cpp win32wndchild.h 107 107 win32wmdiclient.obj: win32wmdiclient.cpp win32wbase.h win32wmdiclient.h win32wmdichild.h -
trunk/src/user32/new/oslibmsg.cpp
r740 r835 1 /* $Id: oslibmsg.cpp,v 1. 3 1999-08-29 20:05:07sandervl Exp $ */1 /* $Id: oslibmsg.cpp,v 1.4 1999-09-05 15:53:08 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 75 75 //****************************************************************************** 76 76 //****************************************************************************** 77 BOOL OSLibWinGetMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, BOOL isUnicode) 77 BOOL OSLibWinGetMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, 78 BOOL isUnicode) 78 79 { 79 80 BOOL rc; … … 85 86 //****************************************************************************** 86 87 //****************************************************************************** 88 BOOL OSLibWinPeekMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, 89 BOOL fRemove, BOOL isUnicode) 90 { 91 BOOL rc; 92 93 rc = WinPeekMsg(GetThreadHAB(), MsgThreadPtr, hwnd, TranslateWinMsg(uMsgFilterMin), 94 TranslateWinMsg(uMsgFilterMax), (fRemove == MSG_REMOVE) ? PM_REMOVE : PM_NOREMOVE); 95 OS2ToWinMsgTranslate(MsgThreadPtr, pMsg, isUnicode); 96 return rc; 97 } 98 //****************************************************************************** 99 //****************************************************************************** -
trunk/src/user32/new/oslibmsg.h
r342 r835 1 /* $Id: oslibmsg.h,v 1. 2 1999-07-20 07:42:35sandervl Exp $ */1 /* $Id: oslibmsg.h,v 1.3 1999-09-05 15:53:08 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 13 13 #define __OSLIBMSG_H__ 14 14 15 #define MSG_NOREMOVE 0 16 #define MSG_REMOVE 1 17 15 18 ULONG TranslateWinMsg(ULONG msg); 19 20 #ifdef OS2DEF_INCLUDED 16 21 void OS2ToWinMsgTranslate(QMSG *os2Msg, MSG *winMsg, BOOL isUnicode); 17 22 void WinToOS2MsgTranslate(MSG *winMsg, QMSG *os2Msg, BOOL isUnicode); 23 #endif 24 25 BOOL OSLibWinGetMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, BOOL isUnicode = FALSE); 26 BOOL OSLibWinPeekMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, BOOL fRemove, BOOL isUnicode = FALSE); 27 void OSLibWinPostQuitMessage(ULONG nExitCode); 28 LONG OSLibWinDispatchMsg(MSG *msg, BOOL isUnicode = FALSE); 18 29 19 30 BOOL OSLibInitMsgQueue(); -
trunk/src/user32/new/oslibwin.h
r724 r835 1 /* $Id: oslibwin.h,v 1.2 3 1999-08-28 14:09:29 sandervl Exp $ */1 /* $Id: oslibwin.h,v 1.24 1999-09-05 15:53:09 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 217 217 HWND OSLibWinQueryWindow(HWND hwnd, ULONG lCode); 218 218 219 220 void OSLibWinPostQuitMessage(ULONG nExitCode);221 LONG OSLibWinDispatchMsg(MSG *msg, BOOL isUnicode = FALSE);222 223 BOOL OSLibWinGetMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, BOOL isUnicode = FALSE);224 225 219 LONG OSLibWinQueryWindowTextLength(HWND hwnd); 226 220 LONG OSLibWinQueryWindowText(HWND hwnd, LONG length, LPSTR lpsz); -
trunk/src/user32/new/win32dlg.cpp
r833 r835 1 /* $Id: win32dlg.cpp,v 1. 4 1999-09-05 12:03:33sandervl Exp $ */1 /* $Id: win32dlg.cpp,v 1.5 1999-09-05 15:53:09 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Dialog Code for OS/2 … … 18 18 #include <misc.h> 19 19 #include <win32dlg.h> 20 #include "oslibmsg.h" 20 21 21 22 //****************************************************************************** … … 214 215 if (hMenu) DestroyMenu( hMenu ); 215 216 217 } 218 /*********************************************************************** 219 * DIALOG_DoDialogBox 220 */ 221 INT Win32Dialog::doDialogBox() 222 { 223 Win32BaseWindow *topOwner; 224 MSG msg; 225 INT retval; 226 227 /* Owner must be a top-level window */ 228 if(getOwner() == NULL) { 229 dprintf(("Dialog box has no owner!!!")); 230 return -1; 231 } 232 topOwner = getOwner()->getTopParent(); 233 if(topOwner == NULL) { 234 dprintf(("Dialog box has no top owner!!!")); 235 return -1; 236 } 237 238 if (!dialogFlags & DF_END) /* was EndDialog called in WM_INITDIALOG ? */ 239 { 240 topOwner->EnableWindow( FALSE ); 241 ShowWindow( SW_SHOW ); 242 243 while (OSLibWinPeekMsg(&msg, getOS2FrameWindowHandle(), topOwner->getOS2FrameWindowHandle(), 244 0, 0, MSG_REMOVE)) 245 // while (OSLibWinPeekMsg(&msg, getWindowHandle(), owner, MSGF_DIALOGBOX, 246 // MSG_REMOVE, !(getStyle() & DS_NOIDLEMSG), NULL )) 247 { 248 if (!IsDialogMessageA( getWindowHandle(), &msg)) 249 { 250 TranslateMessage( &msg ); 251 DispatchMessageA( &msg ); 252 } 253 if (dialogFlags & DF_END) break; 254 } 255 topOwner->EnableWindow( TRUE ); 256 } 257 retval = idResult; 258 DestroyWindow(); 259 return retval; 216 260 } 217 261 /*********************************************************************** -
trunk/src/user32/new/win32dlg.h
r833 r835 1 /* $Id: win32dlg.h,v 1. 5 1999-09-05 12:03:33sandervl Exp $ */1 /* $Id: win32dlg.h,v 1.6 1999-09-05 15:53:09 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Dialog Code for OS/2 … … 79 79 static ULONG GetDialogBaseUnits() { return MAKELONG(xBaseUnit, yBaseUnit); }; 80 80 81 INT doDialogBox(); 82 81 83 protected: 82 84 BOOL DIALOG_Init(void); -
trunk/src/user32/new/win32wbase.cpp
r833 r835 1 /* $Id: win32wbase.cpp,v 1. 9 1999-09-05 12:03:33sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.10 1999-09-05 15:53:09 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 1160 1160 } 1161 1161 case WM_GETDLGCODE: 1162 1162 return 0; 1163 1163 1164 1164 case WM_NCLBUTTONDOWN: … … 1211 1211 case WM_CREATE: 1212 1212 { 1213 if(win32wndproc(getWindowHandle(), WM_NCCREATE, 0, lParam) == 0) {1214 dprintf(("WM_NCCREATE returned FALSE\n"));1215 return(-1); //don't create window1216 }1217 1213 if(win32wndproc(getWindowHandle(), WM_CREATE, 0, lParam) == -1) { 1218 1214 dprintf(("WM_CREATE returned -1\n")); … … 1254 1250 case WM_CREATE: 1255 1251 { 1256 if(win32wndproc(getWindowHandle(), WM_NCCREATE, 0, lParam) == 0) {1257 dprintf(("WM_NCCREATE returned FALSE\n"));1258 return(0); //don't create window1259 }1260 1252 if(win32wndproc(getWindowHandle(), WM_CREATE, 0, lParam) == 0) { 1261 1253 dprintf(("WM_CREATE returned FALSE\n")); … … 1299 1291 case WM_CREATE: 1300 1292 { 1301 if(win32wndproc(getWindowHandle(), WM_NCCREATE, 0, lParam) == 0) {1302 dprintf(("WM_NCCREATE returned FALSE\n"));1303 return(0); //don't create window1304 }1305 1293 if(win32wndproc(getWindowHandle(), WM_CREATE, 0, lParam) == 0) { 1306 1294 dprintf(("WM_CREATE returned FALSE\n")); … … 1341 1329 case WM_CREATE: 1342 1330 { 1343 if(win32wndproc(getWindowHandle(), WM_NCCREATE, 0, lParam) == 0) {1344 dprintf(("WM_NCCREATE returned FALSE\n"));1345 return(0); //don't create window1346 }1347 1331 if(win32wndproc(getWindowHandle(), WM_CREATE, 0, lParam) == 0) { 1348 1332 dprintf(("WM_CREATE returned FALSE\n")); … … 1404 1388 window = parentwindow; 1405 1389 } 1390 } 1391 //****************************************************************************** 1392 //****************************************************************************** 1393 Win32BaseWindow *Win32BaseWindow::getTopParent() 1394 { 1395 Win32BaseWindow *tmpWnd = this; 1396 1397 while( tmpWnd && (tmpWnd->getStyle() & WS_CHILD)) 1398 { 1399 tmpWnd = tmpWnd->getParent(); 1400 } 1401 return tmpWnd; 1406 1402 } 1407 1403 //****************************************************************************** -
trunk/src/user32/new/win32wbase.h
r833 r835 1 /* $Id: win32wbase.h,v 1. 7 1999-09-05 12:03:33sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.8 1999-09-05 15:53:10 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 166 166 Win32BaseWindow *getOwner() { return owner; }; 167 167 168 Win32BaseWindow *getTopParent(); 169 168 170 LRESULT SendMessageA(ULONG msg, WPARAM wParam, LPARAM lParam); 169 171 LRESULT SendMessageW(ULONG msg, WPARAM wParam, LPARAM lParam); -
trunk/src/user32/new/windlg.cpp
r833 r835 1 /* $Id: windlg.cpp,v 1. 3 1999-09-05 12:03:34sandervl Exp $ */1 /* $Id: windlg.cpp,v 1.4 1999-09-05 15:53:10 sandervl Exp $ */ 2 2 /* 3 3 * Win32 dialog apis for OS/2 … … 120 120 HWND hwnd = CreateDialogIndirectParamA(hInst, dlgtemplate, hwndParent, dlgproc, 121 121 lParamInit); 122 //TODO: 123 if (hwnd) return 1; //return DIALOG_DoDialogBox( hwnd, owner ); 122 if (hwnd) 123 { 124 Win32Dialog *dialog; 125 126 dialog = (Win32Dialog *)Win32BaseWindow::GetWindowFromHandle(hwnd); 127 if(!dialog || !dialog->IsDialog()) { 128 dprintf(("DialogBoxIndirectParamA, dialog %x not found", hwnd)); 129 return 0; 130 } 131 return dialog->doDialogBox(); 132 } 124 133 return -1; 125 134 } … … 132 141 HWND hwnd = CreateDialogIndirectParamW(hInst, dlgtemplate, hwndParent, dlgproc, 133 142 lParamInit); 134 //TODO: 135 if (hwnd) return 1; //return DIALOG_DoDialogBox( hwnd, owner ); 143 if (hwnd) 144 { 145 Win32Dialog *dialog; 146 147 dialog = (Win32Dialog *)Win32BaseWindow::GetWindowFromHandle(hwnd); 148 if(!dialog || !dialog->IsDialog()) { 149 dprintf(("DialogBoxIndirectParamW, dialog %x not found", hwnd)); 150 return 0; 151 } 152 return dialog->doDialogBox(); 153 } 136 154 return -1; 137 155 } … … 142 160 { 143 161 HWND hwnd = CreateDialogParamA( hInst, lpszTemplate, hwndOwner, dlgproc, lParamInit); 144 //TODO: 145 if (hwnd) return 1; //return DIALOG_DoDialogBox( hwnd, owner ); 162 163 if (hwnd) 164 { 165 Win32Dialog *dialog; 166 167 dialog = (Win32Dialog *)Win32BaseWindow::GetWindowFromHandle(hwnd); 168 if(!dialog || !dialog->IsDialog()) { 169 dprintf(("DialogBoxParamA, dialog %x not found", hwnd)); 170 return 0; 171 } 172 return dialog->doDialogBox(); 173 } 146 174 return -1; 147 175 } … … 152 180 { 153 181 HWND hwnd = CreateDialogParamW( hInst, lpszTemplate, hwndOwner, dlgproc, lParamInit); 154 //TODO: 155 if (hwnd) return 1; //return DIALOG_DoDialogBox( hwnd, owner ); 182 183 if (hwnd) 184 { 185 Win32Dialog *dialog; 186 187 dialog = (Win32Dialog *)Win32BaseWindow::GetWindowFromHandle(hwnd); 188 if(!dialog || !dialog->IsDialog()) { 189 dprintf(("DialogBoxParamW, dialog %x not found", hwnd)); 190 return 0; 191 } 192 return dialog->doDialogBox(); 193 } 156 194 return -1; 157 195 } -
trunk/src/user32/new/windlgmsg.cpp
r833 r835 1 /* $Id: windlgmsg.cpp,v 1. 2 1999-09-05 12:03:34sandervl Exp $ */1 /* $Id: windlgmsg.cpp,v 1.3 1999-09-05 15:53:10 sandervl Exp $ */ 2 2 /* 3 3 * Win32 dialog message APIs for OS/2 … … 111 111 } 112 112 else if (dlgCode & 113 113 (DLGC_DEFPUSHBUTTON | DLGC_UNDEFPUSHBUTTON)) 114 114 { 115 115 /* send command message as from the control */ … … 126 126 } 127 127 RetVal = TRUE; 128 128 WIN_ReleaseWndPtr(wndPtr); 129 129 break; 130 130 } 131 131 } 132 133 } 134 135 136 137 132 hwndNext = GetWindow( hwndControl, GW_CHILD ); 133 } 134 else 135 { 136 hwndNext = 0; 137 } 138 138 WIN_ReleaseWndPtr(wndPtr); 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 139 if (!hwndNext) 140 { 141 hwndNext = GetWindow( hwndControl, GW_HWNDNEXT ); 142 } 143 while (!hwndNext) 144 { 145 hwndControl = GetParent( hwndControl ); 146 if (hwndControl == hwndDlg) 147 { 148 if(hwnd==hwndDlg){ /* prevent endless loop */ 149 hwndNext=hwnd; 150 break; 151 } 152 hwndNext = GetWindow( hwndDlg, GW_CHILD ); 153 } 154 else 155 { 156 hwndNext = GetWindow( hwndControl, GW_HWNDNEXT ); 157 } 158 } 159 159 hwndControl = hwndNext; 160 160 } … … 184 184 if ((message != WM_KEYDOWN) && 185 185 (message != WM_SYSCHAR) && 186 186 (message != WM_CHAR)) 187 187 return FALSE; 188 188 -
trunk/src/user32/new/windowmsg.cpp
r741 r835 1 /* $Id: windowmsg.cpp,v 1. 9 1999-08-30 11:59:54sandervl Exp $ */1 /* $Id: windowmsg.cpp,v 1.10 1999-09-05 15:53:10 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window message APIs for OS/2 … … 19 19 #include <hooks.h> 20 20 #include "oslibwin.h" 21 #include "oslibmsg.h" 21 22 22 23 //****************************************************************************** … … 60 61 //****************************************************************************** 61 62 //****************************************************************************** 63 BOOL WIN32API PeekMessageA(LPMSG msg, HWND hwndOwner, UINT uMsgFilterMin, 64 UINT uMsgFilterMax, UINT fuRemoveMsg) 65 { 66 BOOL fFoundMsg; 67 68 fFoundMsg = OSLibWinPeekMsg(msg, 0, uMsgFilterMin, uMsgFilterMax, 69 (fuRemoveMsg & PM_REMOVE) ? 1 : 0, FALSE); 70 if(fFoundMsg) { 71 if (msg->message == WM_QUIT && (fuRemoveMsg & (PM_REMOVE))) { 72 //TODO: Post WM_QUERYENDSESSION message when WM_QUIT received and system is shutting down 73 } 74 } 75 return fFoundMsg; 76 } 77 //****************************************************************************** 78 //****************************************************************************** 79 BOOL WIN32API PeekMessageW(LPMSG msg, HWND hwndOwner, UINT uMsgFilterMin, 80 UINT uMsgFilterMax, UINT fuRemoveMsg) 81 { 82 BOOL fFoundMsg; 83 84 fFoundMsg = OSLibWinPeekMsg(msg, 0, uMsgFilterMin, uMsgFilterMax, 85 (fuRemoveMsg & PM_REMOVE) ? 1 : 0, FALSE); 86 if(fFoundMsg) { 87 if (msg->message == WM_QUIT && (fuRemoveMsg & (PM_REMOVE))) { 88 //TODO: Post WM_QUERYENDSESSION message when WM_QUIT received and system is shutting down 89 } 90 } 91 return fFoundMsg; 92 } 93 //****************************************************************************** 94 //****************************************************************************** 62 95 LONG WIN32API GetMessageExtraInfo(void) 63 96 { … … 88 121 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 89 122 if(!window) { 90 dprintf(("SendMessageA, window %x not found", hwnd));91 return 0;123 dprintf(("SendMessageA, window %x not found", hwnd)); 124 return 0; 92 125 } 93 126 return window->SendMessageA(msg, wParam, lParam); … … 102 135 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 103 136 if(!window) { 104 dprintf(("SendMessageW, window %x not found", hwnd));105 return 0;137 dprintf(("SendMessageW, window %x not found", hwnd)); 138 return 0; 106 139 } 107 140 return window->SendMessageW(msg, wParam, lParam); … … 115 148 116 149 if(hwnd == NULL) 117 return PostThreadMessageA(GetCurrentThreadId(), msg, wParam, lParam);150 return PostThreadMessageA(GetCurrentThreadId(), msg, wParam, lParam); 118 151 119 152 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 120 153 if(!window) { 121 dprintf(("PostMessageA, window %x not found", hwnd));122 return 0;154 dprintf(("PostMessageA, window %x not found", hwnd)); 155 return 0; 123 156 } 124 157 dprintf(("PostMessageA, %x %x %x %x", hwnd, msg, wParam, lParam)); … … 133 166 134 167 if(hwnd == NULL) 135 return PostThreadMessageW(GetCurrentThreadId(), msg, wParam, lParam);168 return PostThreadMessageW(GetCurrentThreadId(), msg, wParam, lParam); 136 169 137 170 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 138 171 if(!window) { 139 dprintf(("PostMessageW, window %x not found", hwnd));140 return 0;172 dprintf(("PostMessageW, window %x not found", hwnd)); 173 return 0; 141 174 } 142 175 dprintf(("PostMessageW, %x %x %x %x", hwnd, msg, wParam, lParam)); … … 151 184 #endif 152 185 return O32_WaitMessage(); 153 }154 //******************************************************************************155 //******************************************************************************156 BOOL WIN32API PeekMessageA(LPMSG arg1, HWND arg2, UINT arg3, UINT arg4, UINT arg5)157 {158 #ifdef DEBUG159 // WriteLog("USER32: PeekMessage\n");160 #endif161 return O32_PeekMessage(arg1, arg2, arg3, arg4, arg5);162 }163 //******************************************************************************164 //******************************************************************************165 BOOL WIN32API PeekMessageW( LPMSG arg1, HWND arg2, UINT arg3, UINT arg4, UINT arg5)166 {167 #ifdef DEBUG168 WriteLog("USER32: PeekMessageW\n");169 #endif170 // NOTE: This will not work as is (needs UNICODE support)171 return O32_PeekMessage(arg1, arg2, arg3, arg4, arg5);172 186 } 173 187 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.