Changeset 10031 for trunk/src/user32/oslibwin.cpp
- Timestamp:
- Apr 23, 2003, 8:01:01 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/src/user32/oslibwin.cpp (modified) (22 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/oslibwin.cpp
r10013 r10031 1 /* $Id: oslibwin.cpp,v 1.14 2 2003-04-11 15:22:33sandervl Exp $ */1 /* $Id: oslibwin.cpp,v 1.143 2003-04-23 18:00:58 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 127 127 //Note: Also check OSLibSetWindowStyle when changing this!! 128 128 //****************************************************************************** 129 BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle, 129 BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle, 130 130 ULONG *OSFrameStyle) 131 131 { … … 144 144 145 145 //WS_EX_TOOLWINDOW is incompatible with the OS2Look (titlebar thinner + smaller font) 146 if(fOS2Look && !(dwExStyle & WS_EX_TOOLWINDOW_W)) 146 if(fOS2Look && !(dwExStyle & WS_EX_TOOLWINDOW_W)) 147 147 { 148 148 if((dwStyle & WS_CAPTION_W) == WS_CAPTION_W) { … … 168 168 //****************************************************************************** 169 169 //****************************************************************************** 170 BOOL OSLibWinPositionFrameControls(HWND hwndFrame, RECTLOS2 *pRect, DWORD dwStyle, 171 DWORD dwExStyle, HICON hSysMenuIcon, 170 BOOL OSLibWinPositionFrameControls(HWND hwndFrame, RECTLOS2 *pRect, DWORD dwStyle, 171 DWORD dwExStyle, HICON hSysMenuIcon, 172 172 BOOL drawCloseButton, BOOL fClassIcon) 173 173 { … … 190 190 minmaxheight = WinQuerySysValue(HWND_DESKTOP, SV_CYMINMAXBUTTON); 191 191 } 192 192 193 193 if(fOS2Look == OS2_APPEARANCE_SYSMENU) { 194 194 //Note: If no class icon *and* WS_EX_DLGMODALFRAME -> no system menu!! … … 236 236 swp[i].cx -= minmaxwidth/2; 237 237 } 238 //there is no close button in warp 3 and sometimes we do not 238 //there is no close button in warp 3 and sometimes we do not 239 239 //have close button as well 240 240 if((dwStyle & WS_SYSMENU_W) && !fVersionWarp3 && drawCloseButton) { … … 578 578 579 579 //****************************************************************************** 580 //@PF This is exactly that weird message PM sends when we maximize window from 580 //@PF This is exactly that weird message PM sends when we maximize window from 581 581 //icon - this coordinates NEVER surface later and this combination of SWP 582 582 //commands is useless, yet it starts the correct reaction of maximiztion from … … 595 595 /* @@PF The reason for this weird minimize algorithm is that we are not fully 596 596 using PM for minimization. I.e. we respect all PM messages yet we do mess 597 so much with some messages that minimization is based partly on vodoo. 597 so much with some messages that minimization is based partly on vodoo. 598 598 That is if you try minimize and deactivate in one call it will fail. 599 599 Here we deactivate yourselves and give focus to next window that is … … 635 635 { 636 636 ULONG hIconOS2 = GetOS2Icon(hIcon); 637 if(hIconOS2) 637 if(hIconOS2) 638 638 return (BOOL) WinSendMsg(hwnd, WM_SETICON, (MPARAM)hIconOS2, 0); 639 639 return FALSE; … … 996 996 //PF: PM Logic approved by numerous testcases shows this: 997 997 //There is no other way to tweak FID_MINMAX without deleting it 998 //Controls are created with size 0,0, invisible and should be immediately 998 //Controls are created with size 0,0, invisible and should be immediately 999 999 //positioned. MINMAX control can't function properly without FID_SYSMENU 1000 1000 //control if it is present, so we need to recreate BOTH controls. … … 1006 1006 //leave old, WinCreateFrameControls can't tweak anything. 1007 1007 1008 void OSLibSetWindowStyle(HWND hwndFrame, HWND hwndClient, ULONG dwStyle, 1008 void OSLibSetWindowStyle(HWND hwndFrame, HWND hwndClient, ULONG dwStyle, 1009 1009 ULONG dwExStyle, ULONG dwOldWindowsStyle) 1010 1010 { … … 1012 1012 ULONG dwOldWinStyle; 1013 1013 1014 int checksum, checksum2; 1014 int checksum, checksum2; 1015 1015 DWORD dest_tid, dest_pid; 1016 1016 … … 1024 1024 dest_tid = GetWindowThreadProcessId(OS2ToWin32Handle(hwndClient) , &dest_pid ); 1025 1025 1026 if (dest_tid != GetCurrentThreadId()) 1026 if (dest_tid != GetCurrentThreadId()) 1027 1027 { 1028 1028 dprintf(("OSLibSetWindowStyle: Redirecting Change Frame controls to another thread")); … … 1034 1034 minmaxheight = WinQuerySysValue(HWND_DESKTOP, SV_CYMINMAXBUTTON); 1035 1035 } 1036 1036 1037 1037 if (hwndClient) 1038 1038 { … … 1081 1081 dwWinStyle |= WS_MAXIMIZED; 1082 1082 } 1083 else 1083 else 1084 1084 dwWinStyle &= ~WS_MAXIMIZED; 1085 1085 … … 1096 1096 } 1097 1097 else 1098 WinQueryWindowPos(WinWindowFromID(hwndFrame, FID_TITLEBAR), &rc1); 1098 WinQueryWindowPos(WinWindowFromID(hwndFrame, FID_TITLEBAR), &rc1); 1099 1099 1100 1100 if((dwStyle & WS_SYSMENU_W) && !(dwExStyle & WS_EX_TOOLWINDOW_W)) … … 1126 1126 { 1127 1127 OSFrameStyle |= FCF_CLOSEBUTTON; 1128 OSFrameStyle |= FCF_SYSMENU; 1128 OSFrameStyle |= FCF_SYSMENU; 1129 1129 totalwidth += minmaxwidth/2; 1130 1130 dprintf(("close button")); … … 1132 1132 } 1133 1133 } 1134 else 1134 else 1135 1135 { 1136 if (WinWindowFromID(hwndFrame, FID_TITLEBAR)) 1136 if (WinWindowFromID(hwndFrame, FID_TITLEBAR)) 1137 1137 WinDestroyWindow(WinWindowFromID(hwndFrame, FID_TITLEBAR)); 1138 1138 } … … 1140 1140 if (checksum != checksum2) 1141 1141 { 1142 if (WinWindowFromID(hwndFrame, FID_SYSMENU)) 1142 if (WinWindowFromID(hwndFrame, FID_SYSMENU)) 1143 1143 WinDestroyWindow(WinWindowFromID(hwndFrame, FID_SYSMENU)); 1144 if (WinWindowFromID(hwndFrame, FID_MINMAX)) 1144 if (WinWindowFromID(hwndFrame, FID_MINMAX)) 1145 1145 WinDestroyWindow(WinWindowFromID(hwndFrame, FID_MINMAX)); 1146 1146 } … … 1154 1154 GetWindowTextA(OS2ToWin32Handle(hwndClient), buffer, sizeof(buffer)); 1155 1155 WinCreateFrameControls(hwndFrame, &FCData, buffer ); 1156 1156 1157 1157 if (totalwidth != rc3.cx) 1158 1158 { … … 1162 1162 rc3.x = rc3.x + totalwidth; 1163 1163 } 1164 1165 WinSetWindowPos(WinWindowFromID(hwndFrame, FID_MINMAX),0,rc3.x,rc3.y,rc3.cx,rc3.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW); 1166 WinSetWindowPos(WinWindowFromID(hwndFrame, FID_SYSMENU),0,rc2.x,rc2.y,rc2.cx,rc2.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW); 1167 WinSetWindowPos(WinWindowFromID(hwndFrame, FID_TITLEBAR),0,rc1.x,rc1.y,rc1.cx,rc1.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW); 1164 1165 WinSetWindowPos(WinWindowFromID(hwndFrame, FID_MINMAX),0,rc3.x,rc3.y,rc3.cx,rc3.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW); 1166 WinSetWindowPos(WinWindowFromID(hwndFrame, FID_SYSMENU),0,rc2.x,rc2.y,rc2.cx,rc2.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW); 1167 WinSetWindowPos(WinWindowFromID(hwndFrame, FID_TITLEBAR),0,rc1.x,rc1.y,rc1.cx,rc1.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW); 1168 1168 1169 1169 if (WinQueryActiveWindow(HWND_DESKTOP) == hwndFrame) … … 1345 1345 //****************************************************************************** 1346 1346 //****************************************************************************** 1347 1348 /* 'Private' PM property stuff. */ 1349 PVOID APIENTRY WinQueryProperty(HWND hwnd, PCSZ pszNameOrAtom); 1350 PVOID APIENTRY WinRemoveProperty(HWND hwnd, PCSZ pszNameOrAtom); 1351 BOOL APIENTRY WinSetProperty(HWND hwnd, PCSZ pszNameOrAtom, PVOID pvData, ULONG ulFlags); 1352 1353 /** 1354 * Set Property. 1355 * @returns Success indicator. 1356 * @param hwnd Window the property is associated with. 1357 * @param psz The property atom or name. 1358 * @param pv Property value. 1359 * @param fFlags Flags. Use 0. 1360 */ 1361 BOOL OSLibSetProperty(HWND hwnd, const char *psz, void *pv, unsigned fFlags) 1362 { 1363 USHORT selFS = RestoreOS2FS(); 1364 BOOL fRet = WinSetProperty(hwnd, psz, pv, fFlags); 1365 SetFS(selFS); 1366 return fRet; 1367 } 1368 1369 /** 1370 * Get Property. 1371 * @returns Property value. 1372 * @param hwnd Window the property is associated with. 1373 * @param psz The property atom or name. 1374 */ 1375 void * OSLibQueryProperty(HWND hwnd, const char *psz) 1376 { 1377 USHORT selFS = RestoreOS2FS(); 1378 void *pvRet = WinQueryProperty(hwnd, psz); 1379 SetFS(selFS); 1380 return pvRet; 1381 } 1382 1383 /** 1384 * Remove Property. 1385 * @returns Property value. 1386 * @param hwnd Window the property is associated with. 1387 * @param psz The property atom or name. 1388 */ 1389 void * OSLibRemoveProperty(HWND hwnd, const char *psz) 1390 { 1391 USHORT selFS = RestoreOS2FS(); 1392 void *pvRet = WinRemoveProperty(hwnd, psz); 1393 SetFS(selFS); 1394 return pvRet; 1395 } 1396
Note:
See TracChangeset
for help on using the changeset viewer.
