- Timestamp:
- Jul 17, 1999, 1:56:51 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/makefile
r319 r321 1 # $Id: makefile,v 1. 6 1999-07-17 09:17:57sandervl Exp $1 # $Id: makefile,v 1.7 1999-07-17 11:52:22 sandervl Exp $ 2 2 3 3 # … … 29 29 msgbox.obj window.obj windowmsg.obj windowclass.obj windlgmsg.obj \ 30 30 windowword.obj gen_object.obj oslibwin.obj win32wndchild.obj \ 31 controls.obj button.obj oslibutil.obj 31 controls.obj button.obj oslibutil.obj oslibmsg.obj 32 32 33 33 … … 84 84 gen_object.obj: gen_object.cpp gen_object.h 85 85 oslibwin.obj: oslibwin.cpp oslibwin.h oslibutil.h 86 oslibutil.obj: oslibutil.cpp oslibutil.h $(PDWIN32_INCLUDE)\wprocess.h 86 oslibutil.obj: oslibutil.cpp oslibutil.h $(PDWIN32_INCLUDE)\wprocess.h oslibmsg.h 87 oslibmsg.obj: oslibmsg.cpp oslibmsg.h 88 87 89 88 90 clean: -
trunk/src/user32/new/oslibwin.cpp
r319 r321 1 /* $Id: oslibwin.cpp,v 1. 5 1999-07-17 09:17:58sandervl Exp $ */1 /* $Id: oslibwin.cpp,v 1.6 1999-07-17 11:52:22 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 14 14 #include <os2.h> 15 15 #include <os2wrap.h> 16 #include <stdlib.h> 17 #include <string.h> 18 16 19 #include <misc.h> 17 20 #include <oslibwin.h> 18 21 #include "oslibstyle.h" 19 22 #include "oslibutil.h" 23 #include "oslibmsg.h" 20 24 #include "pmwindow.h" 21 25 … … 141 145 //****************************************************************************** 142 146 //****************************************************************************** 143 HWND OSLibWinQuery TopMostChildWindow(HWND hwndParent)144 { 145 return WinQueryWindow(hwnd Parent, QW_TOP);147 HWND OSLibWinQueryWindow(HWND hwnd, ULONG lCode) 148 { 149 return WinQueryWindow(hwnd, lCode); 146 150 } 147 151 //****************************************************************************** … … 189 193 //****************************************************************************** 190 194 //****************************************************************************** 195 BOOL OSLibWinSetActiveWindow(HWND hwnd) 196 { 197 return WinSetActiveWindow(HWND_DESKTOP, hwnd); 198 } 199 //****************************************************************************** 200 //****************************************************************************** 201 BOOL OSLibWinSetFocus(HWND hwnd) 202 { 203 return WinSetFocus(HWND_DESKTOP, hwnd); 204 } 205 //****************************************************************************** 206 //****************************************************************************** 207 BOOL OSLibWinEnableWindow(HWND hwnd, BOOL fEnable) 208 { 209 return WinEnableWindow(hwnd, fEnable); 210 } 211 //****************************************************************************** 212 //****************************************************************************** 213 BOOL OSLibWinIsWindowEnabled(HWND hwnd) 214 { 215 return WinIsWindowEnabled(hwnd); 216 } 217 //****************************************************************************** 218 //****************************************************************************** 219 BOOL OSLibWinIsWindowVisible(HWND hwnd) 220 { 221 return WinIsWindowVisible(hwnd); 222 } 223 //****************************************************************************** 224 //****************************************************************************** 225 BOOL OSLibWinQueryActiveWindow() 226 { 227 return WinQueryActiveWindow(HWND_DESKTOP); 228 } 229 //****************************************************************************** 230 //****************************************************************************** 231 void OSLibWinPostQuitMessage(ULONG nExitCode) 232 { 233 WinPostQueueMsg(GetThreadMessageQueue(), WM_QUIT, (MPARAM)nExitCode, 0); 234 } 235 //****************************************************************************** 236 //****************************************************************************** 237 LONG OSLibWinDispatchMsg(MSG *msg, BOOL isUnicode) 238 { 239 QMSG qmsg; 240 241 WinToOS2MsgTranslate(msg, &qmsg, isUnicode); 242 return (LONG)WinDispatchMsg(GetThreadHAB(), &qmsg); 243 } 244 //****************************************************************************** 245 //****************************************************************************** 246 BOOL OSLibWinGetMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, BOOL isUnicode) 247 { 248 QMSG qmsg; 249 BOOL rc; 250 251 rc = WinGetMsg(GetThreadHAB(), &qmsg, TranslateWinMsg(uMsgFilterMin), TranslateWinMsg(uMsgFilterMax), 0); 252 OS2ToWinMsgTranslate(&qmsg, pMsg, isUnicode); 253 return rc; 254 } 255 //****************************************************************************** 256 //****************************************************************************** -
trunk/src/user32/new/oslibwin.h
r319 r321 1 /* $Id: oslibwin.h,v 1. 4 1999-07-17 09:17:58sandervl Exp $ */1 /* $Id: oslibwin.h,v 1.5 1999-07-17 11:52:22 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 32 32 HWND OSLibWinCreateMenu(HWND hwndParent, PVOID menutemplate); 33 33 34 HWND OSLibWinQueryTopMostChildWindow(HWND hwndParent);35 36 34 37 35 #define SWPOS_SIZE 0x0001 … … 52 50 #define SWPOS_NOAUTOCLOSE 0x8000 /* Valid in PROGDETAILS struct only */ 53 51 52 #define HWNDOS_TOP (HWND)3 53 #define HWNDOS_BOTTOM (HWND)4 54 54 55 BOOL OSLibWinSetWindowPos(HWND hwnd, HWND hwndInsertBehind, LONG x, LONG y, LONG cx, LONG cy, ULONG fl); 55 56 BOOL OSLibWinShowWindow(HWND hwnd, ULONG fl); … … 58 59 BOOL OSLibWinQueryUpdateRect(HWND hwnd, PVOID pRect); //must be RECTL pointer! 59 60 BOOL OSLibWinIsIconic(HWND hwnd); 61 BOOL OSLibWinSetActiveWindow(HWND hwnd); 62 BOOL OSLibWinSetFocus(HWND hwnd); 63 BOOL OSLibWinEnableWindow(HWND hwnd, BOOL fEnable); 64 BOOL OSLibWinIsWindowEnabled(HWND hwnd); 65 BOOL OSLibWinIsWindowVisible(HWND hwnd); 66 BOOL OSLibWinQueryActiveWindow(); 67 68 #define QWOS_NEXT 0 69 #define QWOS_PREV 1 70 #define QWOS_TOP 2 71 #define QWOS_BOTTOM 3 72 #define QWOS_OWNER 4 73 #define QWOS_PARENT 5 74 #define QWOS_NEXTTOP 6 75 #define QWOS_PREVTOP 7 76 #define QWOS_FRAMEOWNER 8 77 78 HWND OSLibWinQueryWindow(HWND hwnd, ULONG lCode); 79 80 81 void OSLibWinPostQuitMessage(ULONG nExitCode); 82 LONG OSLibWinDispatchMsg(MSG *msg, BOOL isUnicode = FALSE); 83 84 BOOL OSLibWinGetMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax, BOOL isUnicode = FALSE); 60 85 61 86 #endif //__OSLIBWIN_H__ -
trunk/src/user32/new/user32.cpp
r317 r321 1 /* $Id: user32.cpp,v 1. 2 1999-07-16 17:50:10 cbratschiExp $ */1 /* $Id: user32.cpp,v 1.3 1999-07-17 11:52:22 sandervl Exp $ */ 2 2 3 3 /* … … 263 263 //****************************************************************************** 264 264 //****************************************************************************** 265 BOOL WIN32API GetMessageA( LPMSG arg1, HWND arg2, UINT arg3, UINT arg4)266 {267 //// dprintf(("USER32: GetMessage\n"));268 return O32_GetMessage(arg1, arg2, arg3, arg4);269 }270 265 //****************************************************************************** 271 266 //****************************************************************************** … … 1429 1424 //****************************************************************************** 1430 1425 //****************************************************************************** 1431 LONG WIN32API GetMessageExtraInfo(void)1432 {1433 dprintf(("USER32: GetMessageExtraInfo\n"));1434 return O32_GetMessageExtraInfo();1435 }1436 //******************************************************************************1437 //******************************************************************************1438 DWORD WIN32API GetMessagePos(void)1439 {1440 dprintf(("USER32: GetMessagePos\n"));1441 return O32_GetMessagePos();1442 }1443 //******************************************************************************1444 //******************************************************************************1445 LONG WIN32API GetMessageTime(void)1446 {1447 dprintf(("USER32: GetMessageTime\n"));1448 return O32_GetMessageTime();1449 }1450 //******************************************************************************1451 //******************************************************************************1452 BOOL WIN32API GetMessageW(LPMSG arg1, HWND arg2, UINT arg3, UINT arg4)1453 {1454 BOOL rc;1455 1456 // NOTE: This will not work as is (needs UNICODE support)1457 rc = O32_GetMessage(arg1, arg2, arg3, arg4);1458 dprintf(("USER32: GetMessageW %X returned %d\n", arg2, rc));1459 return(rc);1460 }1461 1426 //****************************************************************************** 1462 1427 //****************************************************************************** -
trunk/src/user32/new/win32type.h
r309 r321 238 238 } POINT, *PPOINT, *LPPOINT; 239 239 240 #endif 240 typedef struct tagRECT 241 { 242 INT left; 243 INT top; 244 INT right; 245 INT bottom; 246 } RECT, *PRECT, *LPRECT; 247 typedef const RECT *LPCRECT; 248 249 typedef struct 250 { 251 HWND hwnd; 252 UINT message; 253 WPARAM wParam; 254 LPARAM lParam; 255 DWORD time; 256 POINT pt; 257 } MSG, *LPMSG; 258 259 #endif -
trunk/src/user32/new/win32wnd.cpp
r319 r321 1 /* $Id: win32wnd.cpp,v 1. 5 1999-07-17 09:17:58sandervl Exp $ */1 /* $Id: win32wnd.cpp,v 1.6 1999-07-17 11:52:23 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 123 123 if (cs->hwndParent) 124 124 { 125 Win32Window *window = GetWindowFromHandle(cs->hwndParent); 126 if(!window) { 127 dprintf(("Bad parent %04x\n", cs->hwndParent )); 128 SetLastError(ERROR_INVALID_PARAMETER); 129 return FALSE; 130 } 125 131 /* Make sure parent is valid */ 126 if (! IsWindow( cs->hwndParent ))132 if (!window->IsWindow() ) 127 133 { 128 134 dprintf(("Bad parent %04x\n", cs->hwndParent )); … … 345 351 return FALSE; 346 352 } 347 353 if(OS2Hwnd != OS2HwndFrame) { 354 if(OSLibWinSetWindowULong(OS2HwndFrame, OFFSET_WIN32WNDPTR, (ULONG)this) == FALSE) { 355 dprintf(("WM_CREATE: WinSetWindowULong %X failed!!", OS2HwndFrame)); 356 return FALSE; 357 } 358 if(OSLibWinSetWindowULong(OS2HwndFrame, OFFSET_WIN32PM_MAGIC, WIN32PM_MAGIC) == FALSE) { 359 dprintf(("WM_CREATE: WinSetWindowULong2 %X failed!!", OS2HwndFrame)); 360 return FALSE; 361 } 362 } 348 363 /* Set the window menu */ 349 364 if ((dwStyle & (WS_CAPTION | WS_CHILD)) == WS_CAPTION ) … … 415 430 416 431 NotifyParent(WM_CREATE, 0, 0); 417 if( !IsWindow( Win32Hwnd) )432 if( !IsWindow() ) 418 433 { 419 434 return FALSE; … … 975 990 switch(hwndInsertAfter) { 976 991 case HWND_BOTTOM: 992 hwndInsertAfter = HWNDOS_BOTTOM; 993 break; 994 case HWND_TOPMOST: //TODO: 995 case HWND_NOTOPMOST: //TODO: 977 996 case HWND_TOP: 978 case HWND_TOPMOST: 979 case HWND_NOTOPMOST: 997 hwndInsertAfter = HWNDOS_TOP; 980 998 break; 981 999 default: … … 1023 1041 } 1024 1042 //****************************************************************************** 1025 //TODO:1026 //******************************************************************************1027 HWND Win32Window::SetActiveWindow()1028 {1029 return O32_SetActiveWindow(OS2Hwnd);1030 }1031 //******************************************************************************1032 1043 //****************************************************************************** 1033 1044 HWND Win32Window::GetParent() … … 1078 1089 HWND Win32Window::GetTopWindow() 1079 1090 { 1080 HWND topchild; 1081 1082 topchild = OSLibWinQueryTopMostChildWindow(OS2HwndFrame); 1083 if(topchild) 1084 { 1085 return topchild; 1086 } 1087 else return 0; 1091 return GetWindow(GW_CHILD); 1088 1092 } 1089 1093 //****************************************************************************** … … 1107 1111 { 1108 1112 return OSLibWinIsIconic(OS2HwndFrame); 1113 } 1114 //****************************************************************************** 1115 //TODO: not complete nor correct (distinction between top-level, top-most & child windows) 1116 //****************************************************************************** 1117 HWND Win32Window::GetWindow(UINT uCmd) 1118 { 1119 Win32Window *win32wnd; 1120 ULONG magic; 1121 ULONG getcmd = 0; 1122 HWND hwndRelated; 1123 1124 dprintf(("GetWindow %x %d NOT COMPLETE", getWindowHandle(), uCmd)); 1125 switch(uCmd) 1126 { 1127 case GW_CHILD: 1128 getcmd = QWOS_TOP; 1129 break; 1130 case GW_HWNDFIRST: 1131 if(getParent()) { 1132 getcmd = QWOS_TOP; //top of child windows 1133 } 1134 else getcmd = QWOS_TOP; //TODO 1135 break; 1136 case GW_HWNDLAST: 1137 if(getParent()) { 1138 getcmd = QWOS_BOTTOM; //bottom of child windows 1139 } 1140 else getcmd = QWOS_BOTTOM; //TODO 1141 break; 1142 case GW_HWNDNEXT: 1143 getcmd = QWOS_NEXT; 1144 break; 1145 case GW_HWNDPREV: 1146 getcmd = QWOS_PREV; 1147 break; 1148 case GW_OWNER: 1149 if(owner) { 1150 return owner->getWindowHandle(); 1151 } 1152 else return 0; 1153 } 1154 hwndRelated = OSLibWinQueryWindow(OS2HwndFrame, getcmd); 1155 if(hwndRelated) 1156 { 1157 win32wnd = (Win32Window *)OSLibWinGetWindowULong(hwndRelated, OFFSET_WIN32WNDPTR); 1158 magic = OSLibWinGetWindowULong(hwndRelated, OFFSET_WIN32PM_MAGIC); 1159 if(CheckMagicDword(magic) && win32wnd) 1160 { 1161 return win32wnd->getWindowHandle(); 1162 } 1163 } 1164 return 0; 1165 } 1166 //****************************************************************************** 1167 //****************************************************************************** 1168 HWND Win32Window::SetActiveWindow() 1169 { 1170 return OSLibWinSetActiveWindow(OS2HwndFrame); 1171 } 1172 //****************************************************************************** 1173 //WM_ENABLE is sent to hwnd, but not to it's children (as it should be) 1174 //****************************************************************************** 1175 BOOL Win32Window::EnableWindow(BOOL fEnable) 1176 { 1177 return OSLibWinEnableWindow(OS2HwndFrame, fEnable); 1178 } 1179 //****************************************************************************** 1180 //****************************************************************************** 1181 BOOL Win32Window::BringWindowToTop() 1182 { 1183 return SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE ); 1184 } 1185 //****************************************************************************** 1186 //****************************************************************************** 1187 HWND Win32Window::GetActiveWindow() 1188 { 1189 HWND hwndActive; 1190 Win32Window *win32wnd; 1191 ULONG magic; 1192 1193 hwndActive = OSLibWinQueryActiveWindow(); 1194 1195 win32wnd = (Win32Window *)OSLibWinGetWindowULong(hwndActive, OFFSET_WIN32WNDPTR); 1196 magic = OSLibWinGetWindowULong(hwndActive, OFFSET_WIN32PM_MAGIC); 1197 if(CheckMagicDword(magic) && win32wnd) 1198 { 1199 return win32wnd->getWindowHandle(); 1200 } 1201 return hwndActive; 1202 } 1203 //****************************************************************************** 1204 //****************************************************************************** 1205 BOOL Win32Window::IsWindow() 1206 { 1207 return TRUE; 1208 } 1209 //****************************************************************************** 1210 //****************************************************************************** 1211 BOOL Win32Window::IsWindowEnabled() 1212 { 1213 return OSLibWinIsWindowEnabled(OS2Hwnd); 1214 } 1215 //****************************************************************************** 1216 //****************************************************************************** 1217 BOOL Win32Window::IsWindowVisible() 1218 { 1219 return OSLibWinIsWindowVisible(OS2Hwnd); 1109 1220 } 1110 1221 //****************************************************************************** -
trunk/src/user32/new/win32wnd.h
r319 r321 1 /* $Id: win32wnd.h,v 1. 5 1999-07-17 09:17:58sandervl Exp $ */1 /* $Id: win32wnd.h,v 1.6 1999-07-17 11:52:23 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 24 24 #define OFFSET_WIN32PM_MAGIC 4 25 25 26 #define WIN32PM_MAGIC 0x12345678 26 #define WIN32PM_MAGIC 0x12345678 27 #define CheckMagicDword(a) (a==WIN32PM_MAGIC) 27 28 28 29 typedef struct { … … 96 97 BOOL UpdateWindow(); 97 98 BOOL IsIconic(); 99 HWND GetWindow(UINT uCmd); 100 BOOL EnableWindow(BOOL fEnable); 101 BOOL BringWindowToTop(); 102 static HWND GetActiveWindow(); 103 BOOL IsWindow(); 104 BOOL IsWindowEnabled(); 105 BOOL IsWindowVisible(); 98 106 99 107 LRESULT SendMessageA(ULONG msg, WPARAM wParam, LPARAM lParam); -
trunk/src/user32/new/window.cpp
r314 r321 1 /* $Id: window.cpp,v 1. 3 1999-07-16 11:32:09sandervl Exp $ */1 /* $Id: window.cpp,v 1.4 1999-07-17 11:52:23 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 10 10 * 11 11 * Project Odin Software License can be found in LICENSE.TXT 12 * 13 * 14 * TODO: Decide what to do about commands for OS/2 windows (non-Win32 apps) 12 15 * 13 16 */ … … 184 187 window = Win32Window::GetWindowFromHandle(hwnd); 185 188 if(!window) { 186 dprintf(("SendMessageA, window %x not found", hwnd)); 187 return 0; 188 } 189 dprintf(("DestroyWindow, window %x not found", hwnd)); 190 return 0; 191 } 192 dprintf(("DestroyWindow %x", hwnd)); 189 193 return window->DestroyWindow(); 190 194 } … … 197 201 window = Win32Window::GetWindowFromHandle(hwnd); 198 202 if(!window) { 199 dprintf(("SendMessageA, window %x not found", hwnd)); 200 return 0; 201 } 203 dprintf(("SetActiveWindow, window %x not found", hwnd)); 204 return 0; 205 } 206 dprintf(("SetActiveWindow %x", hwnd)); 202 207 return window->SetActiveWindow(); 203 208 } … … 210 215 window = Win32Window::GetWindowFromHandle(hwnd); 211 216 if(!window) { 212 dprintf(("SendMessageA, window %x not found", hwnd)); 213 return 0; 214 } 217 dprintf(("GetParent, window %x not found", hwnd)); 218 return 0; 219 } 220 dprintf(("GetParent %x", hwnd)); 215 221 return window->GetParent(); 216 222 } … … 223 229 window = Win32Window::GetWindowFromHandle(hwndChild); 224 230 if(!window) { 225 dprintf(("SendMessageA, window %x not found", hwndChild)); 226 return 0; 227 } 231 dprintf(("SetParent, window %x not found", hwndChild)); 232 return 0; 233 } 234 dprintf(("SetParent %x %x", hwndChild, hwndNewParent)); 228 235 return window->SetParent(hwndNewParent); 229 236 } … … 236 243 window = Win32Window::GetWindowFromHandle(hwnd); 237 244 if(!window) { 238 dprintf(("SendMessageA, window %x not found", hwnd)); 239 return 0; 240 } 245 dprintf(("IsChild, window %x not found", hwnd)); 246 return 0; 247 } 248 dprintf(("IsChild %x %x", hwndParent, hwnd)); 241 249 return window->IsChild(hwndParent); 242 250 } … … 249 257 window = Win32Window::GetWindowFromHandle(hwnd); 250 258 if(!window) { 251 dprintf(("SendMessageA, window %x not found", hwnd)); 252 return 0; 253 } 259 dprintf(("GetTopWindow, window %x not found", hwnd)); 260 return 0; 261 } 262 dprintf(("GetTopWindow %x", hwnd)); 254 263 return window->GetTopWindow(); 255 264 } … … 262 271 window = Win32Window::GetWindowFromHandle(hwnd); 263 272 if(!window) { 264 dprintf(("SendMessageA, window %x not found", hwnd)); 265 return 0; 266 } 273 dprintf(("UpdateWindow, window %x not found", hwnd)); 274 return 0; 275 } 276 dprintf(("UpdateWindow %x", hwnd)); 267 277 return window->UpdateWindow(); 268 278 } … … 275 285 window = Win32Window::GetWindowFromHandle(hwnd); 276 286 if(!window) { 277 dprintf(("SendMessageA, window %x not found", hwnd)); 278 return 0; 279 } 287 dprintf(("IsIconic, window %x not found", hwnd)); 288 return 0; 289 } 290 dprintf(("IsIconic %x", hwnd)); 280 291 return window->IsIconic(); 281 292 } 282 293 //****************************************************************************** 283 294 //****************************************************************************** 284 HWND WIN32API GetWindow(HWND arg1, UINT arg2) 285 { 286 HWND rc; 287 288 rc = O32_GetWindow(arg1, arg2); 289 #ifdef DEBUG 290 WriteLog("USER32: GetWindow %X %d returned %d\n", arg1, arg2, rc); 291 #endif 292 return(rc); 295 HWND WIN32API GetWindow(HWND hwnd, UINT uCmd) 296 { 297 Win32Window *window; 298 299 window = Win32Window::GetWindowFromHandle(hwnd); 300 if(!window) { 301 dprintf(("GetWindow, window %x not found", hwnd)); 302 return 0; 303 } 304 dprintf(("GetWindow %x %d", hwnd, uCmd)); 305 return window->GetWindow(uCmd); 293 306 } 294 307 //****************************************************************************** … … 303 316 //****************************************************************************** 304 317 //****************************************************************************** 305 BOOL WIN32API EnableWindow( HWND arg1, BOOL arg2) 306 { 307 #ifdef DEBUG 308 WriteLog("USER32: EnableWindow\n"); 309 #endif 310 return O32_EnableWindow(arg1, arg2); 311 } 312 //****************************************************************************** 313 //****************************************************************************** 314 BOOL WIN32API BringWindowToTop( HWND arg1) 315 { 316 #ifdef DEBUG 317 WriteLog("USER32: BringWindowToTop\n"); 318 #endif 319 return O32_BringWindowToTop(arg1); 318 BOOL WIN32API EnableWindow( HWND hwnd, BOOL fEnable) 319 { 320 Win32Window *window; 321 322 window = Win32Window::GetWindowFromHandle(hwnd); 323 if(!window) { 324 dprintf(("EnableWindow, window %x not found", hwnd)); 325 return 0; 326 } 327 dprintf(("EnableWindow %x %d", hwnd, fEnable)); 328 return window->EnableWindow(fEnable); 329 } 330 //****************************************************************************** 331 //****************************************************************************** 332 BOOL WIN32API BringWindowToTop(HWND hwnd) 333 { 334 Win32Window *window; 335 336 window = Win32Window::GetWindowFromHandle(hwnd); 337 if(!window) { 338 dprintf(("BringWindowToTop, window %x not found", hwnd)); 339 return 0; 340 } 341 dprintf(("BringWindowToTop %x", hwnd)); 342 return window->BringWindowToTop(); 320 343 } 321 344 //****************************************************************************** … … 323 346 HWND WIN32API GetActiveWindow() 324 347 { 325 return(O32_GetActiveWindow()); 326 } 327 //****************************************************************************** 328 //****************************************************************************** 329 BOOL WIN32API ShowWindow(HWND arg1, int arg2) 330 { 331 #ifdef DEBUG 332 WriteLog("USER32: ShowWindow %X %d\n", arg1, arg2); 333 #endif 334 return O32_ShowWindow(arg1, arg2); 335 } 336 //****************************************************************************** 337 //****************************************************************************** 338 BOOL WIN32API SetWindowPos( HWND arg1, HWND arg2, int arg3, int arg4, int arg5, int arg6, UINT arg7) 339 { 340 #ifdef DEBUG 341 WriteLog("USER32: SetWindowPos\n"); 342 #endif 343 return O32_SetWindowPos(arg1, arg2, arg3, arg4, arg5, arg6, arg7); 348 return Win32Window::GetActiveWindow(); 349 } 350 //****************************************************************************** 351 //****************************************************************************** 352 BOOL WIN32API ShowWindow(HWND hwnd, int nCmdShow) 353 { 354 Win32Window *window; 355 356 window = Win32Window::GetWindowFromHandle(hwnd); 357 if(!window) { 358 dprintf(("ShowWindow, window %x not found", hwnd)); 359 return 0; 360 } 361 dprintf(("ShowWindow %x", hwnd)); 362 return window->ShowWindow(nCmdShow); 363 } 364 //****************************************************************************** 365 //****************************************************************************** 366 BOOL WIN32API SetWindowPos(HWND hwnd, HWND hwndInsertAfter, int x, int y, int cx, int cy, UINT fuFlags) 367 { 368 Win32Window *window; 369 370 window = Win32Window::GetWindowFromHandle(hwnd); 371 if(!window) { 372 dprintf(("SetWindowPos, window %x not found", hwnd)); 373 return 0; 374 } 375 dprintf(("SetWindowPos %x %x x=%d y=%d cx=%d cy=%d %x", hwnd, hwndInsertAfter, x, y, cx, cy, fuFlags)); 376 return window->SetWindowPos(hwndInsertAfter, x, y, cx, cy, fuFlags); 377 } 378 //****************************************************************************** 379 //****************************************************************************** 380 BOOL WIN32API IsWindow( HWND hwnd) 381 { 382 Win32Window *window; 383 384 window = Win32Window::GetWindowFromHandle(hwnd); 385 if(!window) { 386 dprintf(("IsWindow, window %x not found", hwnd)); 387 return FALSE; 388 } 389 dprintf(("IsWindow %x", hwnd)); 390 return window->IsWindow(); 391 } 392 //****************************************************************************** 393 //****************************************************************************** 394 BOOL WIN32API IsWindowEnabled( HWND hwnd) 395 { 396 Win32Window *window; 397 398 window = Win32Window::GetWindowFromHandle(hwnd); 399 if(!window) { 400 dprintf(("IsWindowEnabled, window %x not found", hwnd)); 401 return 0; 402 } 403 dprintf(("IsWindowEnabled %x", hwnd)); 404 return window->IsWindowEnabled(); 405 } 406 //****************************************************************************** 407 //****************************************************************************** 408 BOOL WIN32API IsWindowVisible( HWND hwnd) 409 { 410 Win32Window *window; 411 412 window = Win32Window::GetWindowFromHandle(hwnd); 413 if(!window) { 414 dprintf(("IsWindowVisible, window %x not found", hwnd)); 415 return 0; 416 } 417 dprintf(("IsWindowVisible %x", hwnd)); 418 return window->IsWindowVisible(); 344 419 } 345 420 /*********************************************************************** … … 364 439 } 365 440 return 0; 366 }367 //******************************************************************************368 //******************************************************************************369 BOOL WIN32API IsWindow( HWND arg1)370 {371 #ifdef DEBUG372 WriteLog("USER32: IsWindow\n");373 #endif374 return O32_IsWindow(arg1);375 }376 //******************************************************************************377 //******************************************************************************378 BOOL WIN32API IsWindowEnabled( HWND arg1)379 {380 #ifdef DEBUG381 WriteLog("USER32: IsWindowEnabled\n");382 #endif383 return O32_IsWindowEnabled(arg1);384 }385 //******************************************************************************386 //******************************************************************************387 BOOL WIN32API IsWindowVisible( HWND arg1)388 {389 #ifdef DEBUG390 WriteLog("USER32: IsWindowVisible\n");391 #endif392 return O32_IsWindowVisible(arg1);393 441 } 394 442 //****************************************************************************** -
trunk/src/user32/new/windowmsg.cpp
r314 r321 1 /* $Id: windowmsg.cpp,v 1. 5 1999-07-16 11:32:10sandervl Exp $ */1 /* $Id: windowmsg.cpp,v 1.6 1999-07-17 11:52:24 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window message APIs for OS/2 … … 18 18 #include <win.h> 19 19 #include <hooks.h> 20 #include "oslibwin.h" 20 21 21 22 //****************************************************************************** … … 24 25 { 25 26 dprintf(("USER32: PostQuitMessage\n")); 26 27 O32_PostQuitMessage(nExitCode); 28 } 29 //****************************************************************************** 30 //****************************************************************************** 31 LONG WIN32API DispatchMessageA( const MSG * msg) 32 { 33 LONG retval; 34 int painting; 35 Win32Window *window; 36 37 /* Process timer messages */ 38 if ((msg->message == WM_TIMER) || (msg->message == WM_SYSTIMER)) 39 { 40 if (msg->lParam) 41 { 42 return SendMessageA(msg->hwnd, msg->message, msg->wParam, GetTickCount()); 43 } 44 } 45 46 if (!msg->hwnd) return 0; 47 48 window = Win32Window::GetWindowFromHandle(msg->hwnd); 49 if(!window) { 50 dprintf(("DispatchMessageA, window %x not found", msg->hwnd)); 51 return 0; 52 } 53 54 painting = (msg->message == WM_PAINT); 55 if (painting) window->setFlags(window->getFlags() | WIN_NEEDS_BEGINPAINT); 56 57 retval = window->SendMessageA(msg->message, msg->wParam, msg->lParam ); 58 59 #if 0 60 window = Win32Window::GetWindowFromHandle(msg->hwnd); 61 if(!window) { 62 dprintf(("DispatchMessageA, window %x not found", msg->hwnd)); 63 return 0; 64 } 65 66 if (painting && (wndPtr->getFlags() & WIN_NEEDS_BEGINPAINT) && wndPtr->hrgnUpdate) 67 { 68 ERR_(msg)("BeginPaint not called on WM_PAINT for hwnd %04x!\n", 69 msg->hwnd); 70 wndPtr->flags &= ~WIN_NEEDS_BEGINPAINT; 71 /* Validate the update region to avoid infinite WM_PAINT loop */ 72 ValidateRect( msg->hwnd, NULL ); 73 } 74 #endif 75 return retval; 27 OSLibWinPostQuitMessage(nExitCode); 28 } 29 //****************************************************************************** 30 //****************************************************************************** 31 LONG WIN32API DispatchMessageA(const MSG * msg) 32 { 33 return OSLibWinDispatchMsg((MSG *)msg); 76 34 } 77 35 //****************************************************************************** … … 79 37 LONG WIN32API DispatchMessageW( const MSG * msg) 80 38 { 81 LONG retval; 82 int painting; 83 Win32Window *window; 84 85 /* Process timer messages */ 86 if ((msg->message == WM_TIMER) || (msg->message == WM_SYSTIMER)) 87 { 88 if (msg->lParam) 89 { 90 return SendMessageW(msg->hwnd, msg->message, msg->wParam, GetTickCount()); 91 } 92 } 93 94 if (!msg->hwnd) return 0; 95 96 window = Win32Window::GetWindowFromHandle(msg->hwnd); 97 if(!window) { 98 dprintf(("DispatchMessageW, window %x not found", msg->hwnd)); 99 return 0; 100 } 101 102 painting = (msg->message == WM_PAINT); 103 if (painting) window->setFlags(window->getFlags() | WIN_NEEDS_BEGINPAINT); 104 105 retval = window->SendMessageW(msg->message, msg->wParam, msg->lParam ); 106 107 #if 0 108 window = Win32Window::GetWindowFromHandle(msg->hwnd); 109 if(!window) { 110 dprintf(("DispatchMessageW, window %x not found", msg->hwnd)); 111 return 0; 112 } 113 114 if (painting && (wndPtr->getFlags() & WIN_NEEDS_BEGINPAINT) && wndPtr->hrgnUpdate) 115 { 116 ERR_(msg)("BeginPaint not called on WM_PAINT for hwnd %04x!\n", 117 msg->hwnd); 118 wndPtr->flags &= ~WIN_NEEDS_BEGINPAINT; 119 /* Validate the update region to avoid infinite WM_PAINT loop */ 120 ValidateRect( msg->hwnd, NULL ); 121 } 122 #endif 123 return retval; 39 return OSLibWinDispatchMsg((MSG *)msg, TRUE); 124 40 } 125 41 //****************************************************************************** … … 127 43 BOOL WIN32API TranslateMessage( const MSG * arg1) 128 44 { 129 #ifdef DEBUG 130 //// WriteLog("USER32: TranslateMessage\n"); 131 #endif 132 return O32_TranslateMessage(arg1); 45 // return O32_TranslateMessage(arg1); 46 return TRUE; 47 } 48 //****************************************************************************** 49 //****************************************************************************** 50 BOOL WIN32API GetMessageA( LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax) 51 { 52 return OSLibWinGetMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax); 53 } 54 //****************************************************************************** 55 //****************************************************************************** 56 BOOL WIN32API GetMessageW( LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax) 57 { 58 return OSLibWinGetMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax, TRUE); 59 } 60 //****************************************************************************** 61 //****************************************************************************** 62 LONG WIN32API GetMessageExtraInfo(void) 63 { 64 dprintf(("USER32: GetMessageExtraInfo\n")); 65 return O32_GetMessageExtraInfo(); 66 } 67 //****************************************************************************** 68 //****************************************************************************** 69 DWORD WIN32API GetMessagePos(void) 70 { 71 dprintf(("USER32: GetMessagePos\n")); 72 return O32_GetMessagePos(); 73 } 74 //****************************************************************************** 75 //****************************************************************************** 76 LONG WIN32API GetMessageTime(void) 77 { 78 dprintf(("USER32: GetMessageTime\n")); 79 return O32_GetMessageTime(); 133 80 } 134 81 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.