Changeset 321 for trunk/src/user32/new/win32wnd.cpp
- Timestamp:
- Jul 17, 1999, 1:56:51 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.