- Timestamp:
- Apr 18, 2000, 1:13:01 PM (25 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/USER32.DEF
r2873 r3419 1 ; $Id: USER32.DEF,v 1. 29 2000-02-23 17:05:15 cbratschiExp $1 ; $Id: USER32.DEF,v 1.30 2000-04-18 11:12:59 sandervl Exp $ 2 2 3 3 ;Created by BLAST for IBM's compiler … … 635 635 Win32ToOS2Handle__FUl = Win32ToOS2Handle__15Win32BaseWindowFUl @2006 636 636 OS2ToWin32Handle__FUl = OS2ToWin32Handle__15Win32BaseWindowFUl @2012 637 ; IsOS2FrameWindowHandle__FUlUl = IsOS2FrameWindowHandle__15Win32BaseWindowFUlUl @2013 637 638 638 639 _MOUSE_Enable@4 @2007 -
trunk/src/user32/loadres.cpp
r3101 r3419 1 /* $Id: loadres.cpp,v 1.2 5 2000-03-13 13:10:45sandervl Exp $ */1 /* $Id: loadres.cpp,v 1.26 2000-04-18 11:12:59 sandervl Exp $ */ 2 2 3 3 /* … … 108 108 //****************************************************************************** 109 109 //****************************************************************************** 110 HICON WIN32API LoadIconA(HINSTANCE hinst, LPCSTR lpszIcon) 110 HICON LoadIconA(HINSTANCE hinst, LPCSTR lpszIcon, DWORD cxDesired, 111 DWORD cyDesired, DWORD fuLoad) 111 112 { 112 113 Win32Resource *winres; 113 114 HICON hIcon; 114 115 if (!hinst) 116 { 117 winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszIcon,RT_ICONA); 118 if (!winres) winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszIcon,RT_GROUP_ICONA); 119 if (winres) 120 { 121 hIcon = OSLibWinCreateIcon(winres->lockOS2Resource()); 122 delete winres; 123 } else hIcon = OSLibWinQuerySysIcon((ULONG)lpszIcon,GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON)); 124 } else 125 { //not a system icon 126 winres = (Win32Resource *)FindResourceA(hinst, lpszIcon, RT_ICONA); 127 if(winres == 0) { 128 winres = (Win32Resource *)FindResourceA(hinst, lpszIcon, RT_GROUP_ICONA); 129 } 130 if(winres) { 131 hIcon = OSLibWinCreateIcon(winres->lockOS2Resource()); 132 delete winres; 133 } else hIcon = 0; 115 HANDLE hMapping = 0; 116 char *ptr = NULL; 117 118 if(fuLoad & LR_LOADFROMFILE) 119 { 120 hMapping = VIRTUAL_MapFileA( lpszIcon, (LPVOID *)&ptr, TRUE); 121 if(hMapping == INVALID_HANDLE_VALUE) 122 return 0; 123 hIcon = OSLibWinCreatePointer(ptr); 124 CloseHandle(hMapping); 125 } 126 else 127 { 128 if(!hinst) 129 { 130 winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszIcon,RT_ICONA); 131 if(!winres) 132 winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszIcon,RT_GROUP_ICONA); 133 if(winres) 134 { 135 hIcon = OSLibWinCreateIcon(winres->lockOS2Resource()); 136 delete winres; 137 } 138 else hIcon = OSLibWinQuerySysIcon((ULONG)lpszIcon,GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON)); 139 } 140 else 141 { //not a system icon 142 winres = (Win32Resource *)FindResourceA(hinst, lpszIcon, RT_ICONA); 143 if(winres == 0) { 144 winres = (Win32Resource *)FindResourceA(hinst, lpszIcon, RT_GROUP_ICONA); 145 } 146 if(winres) { 147 hIcon = OSLibWinCreateIcon(winres->lockOS2Resource()); 148 delete winres; 149 } 150 else hIcon = 0; 151 } 134 152 } 135 153 dprintf(("LoadIconA (%X) returned %x\n", hinst, hIcon)); … … 139 157 //****************************************************************************** 140 158 //****************************************************************************** 141 HICON WIN32API LoadIconW(HINSTANCE hinst, LPCWSTR lpszIcon) 159 HICON LoadIconW(HINSTANCE hinst, LPCWSTR lpszIcon, DWORD cxDesired, 160 DWORD cyDesired, DWORD fuLoad) 142 161 { 143 162 Win32Resource *winres; 144 163 HICON hIcon; 145 146 if (!hinst) 147 { 148 winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszIcon,RT_ICONW); 149 if (!winres) winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszIcon,RT_GROUP_ICONW); 150 if (winres) 151 { 152 hIcon = OSLibWinCreateIcon(winres->lockOS2Resource()); 153 delete winres; 154 } else hIcon = OSLibWinQuerySysIcon((ULONG)lpszIcon,GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON)); 155 } else 156 {//not a system icon 157 winres = (Win32Resource *)FindResourceW(hinst, lpszIcon, RT_ICONW); 158 if(winres == 0) { 159 winres = (Win32Resource *)FindResourceW(hinst, lpszIcon, RT_GROUP_ICONW); 160 } 161 if(winres) { 162 hIcon = OSLibWinCreateIcon(winres->lockOS2Resource()); 163 delete winres; 164 } else hIcon = 0; 164 HANDLE hMapping = 0; 165 char *ptr = NULL; 166 167 if(fuLoad & LR_LOADFROMFILE) 168 { 169 hMapping = VIRTUAL_MapFileW( lpszIcon, (LPVOID *)&ptr, TRUE); 170 if(hMapping == INVALID_HANDLE_VALUE) 171 return 0; 172 hIcon = OSLibWinCreatePointer(ptr); 173 CloseHandle(hMapping); 174 } 175 else 176 { 177 if (!hinst) 178 { 179 winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszIcon,RT_ICONW); 180 if(!winres) 181 winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszIcon,RT_GROUP_ICONW); 182 if(winres) 183 { 184 hIcon = OSLibWinCreateIcon(winres->lockOS2Resource()); 185 delete winres; 186 } 187 else hIcon = OSLibWinQuerySysIcon((ULONG)lpszIcon,GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON)); 188 } 189 else 190 {//not a system icon 191 winres = (Win32Resource *)FindResourceW(hinst, lpszIcon, RT_ICONW); 192 if(winres == 0) { 193 winres = (Win32Resource *)FindResourceW(hinst, lpszIcon, RT_GROUP_ICONW); 194 } 195 if(winres) { 196 hIcon = OSLibWinCreateIcon(winres->lockOS2Resource()); 197 delete winres; 198 } 199 else hIcon = 0; 200 } 165 201 } 166 202 dprintf(("LoadIconW (%X) returned %x\n", hinst, hIcon)); … … 170 206 //****************************************************************************** 171 207 //****************************************************************************** 172 HCURSOR WIN32API LoadCursorA(HINSTANCE hinst, LPCSTR lpszCursor) 208 HICON WIN32API LoadIconA(HINSTANCE hinst, LPCSTR lpszIcon) 209 { 210 return LoadIconA(hinst, lpszIcon, 0, 0, 0); 211 } 212 //****************************************************************************** 213 //****************************************************************************** 214 HICON WIN32API LoadIconW(HINSTANCE hinst, LPCWSTR lpszIcon) 215 { 216 return LoadIconW(hinst, lpszIcon, 0, 0, 0); 217 } 218 //****************************************************************************** 219 //****************************************************************************** 220 HCURSOR LoadCursorA(HINSTANCE hinst, LPCSTR lpszCursor, DWORD cxDesired, 221 DWORD cyDesired, DWORD fuLoad) 173 222 { 174 223 Win32Resource *winres; 175 224 HCURSOR hCursor; 176 177 if (!hinst) 178 { 179 winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszCursor,RT_CURSORA); 180 if (!winres) winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszCursor,RT_GROUP_CURSORA); 181 if (winres) 182 { 183 hCursor = OSLibWinCreatePointer(winres->lockOS2Resource()); 184 delete winres; 185 } else hCursor = OSLibWinQuerySysPointer((ULONG)lpszCursor,GetSystemMetrics(SM_CXCURSOR),GetSystemMetrics(SM_CYCURSOR)); 186 } else 187 {//not a system pointer 188 winres = (Win32Resource *)FindResourceA(hinst, lpszCursor, RT_CURSORA); 189 if(winres == 0) { 190 winres = (Win32Resource *)FindResourceA(hinst, lpszCursor, RT_GROUP_CURSORA); 191 } 192 if(winres) { 193 hCursor = OSLibWinCreatePointer(winres->lockOS2Resource()); 194 delete winres; 195 } else hCursor = 0; 225 HANDLE hMapping = 0; 226 char *ptr = NULL; 227 228 if(fuLoad & LR_LOADFROMFILE) 229 { 230 hMapping = VIRTUAL_MapFileA( lpszCursor, (LPVOID *)&ptr, TRUE); 231 if(hMapping == INVALID_HANDLE_VALUE) 232 return 0; 233 hCursor = OSLibWinCreatePointer(ptr); 234 CloseHandle(hMapping); 235 } 236 else 237 { 238 if (!hinst) 239 { 240 winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszCursor,RT_CURSORA); 241 if(!winres) 242 winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszCursor,RT_GROUP_CURSORA); 243 if(winres) 244 { 245 hCursor = OSLibWinCreatePointer(winres->lockOS2Resource()); 246 delete winres; 247 } 248 else hCursor = OSLibWinQuerySysPointer((ULONG)lpszCursor,GetSystemMetrics(SM_CXCURSOR),GetSystemMetrics(SM_CYCURSOR)); 249 } 250 else 251 {//not a system pointer 252 winres = (Win32Resource *)FindResourceA(hinst, lpszCursor, RT_CURSORA); 253 if(winres == 0) { 254 winres = (Win32Resource *)FindResourceA(hinst, lpszCursor, RT_GROUP_CURSORA); 255 } 256 if(winres) { 257 hCursor = OSLibWinCreatePointer(winres->lockOS2Resource()); 258 delete winres; 259 } 260 else hCursor = 0; 261 } 196 262 } 197 263 if(HIWORD(lpszCursor)) { … … 204 270 //****************************************************************************** 205 271 //****************************************************************************** 206 HCURSOR WIN32API LoadCursorW(HINSTANCE hinst, LPCWSTR lpszCursor) 272 HCURSOR LoadCursorW(HINSTANCE hinst, LPCWSTR lpszCursor, DWORD cxDesired, 273 DWORD cyDesired, DWORD fuLoad) 207 274 { 208 275 Win32Resource *winres; 209 276 HCURSOR hCursor; 210 211 if (!hinst) 212 { 213 winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszCursor,RT_CURSORW); 214 if (!winres) winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszCursor,RT_GROUP_CURSORW); 215 if (winres) 216 { 217 hCursor = OSLibWinCreatePointer(winres->lockOS2Resource()); 218 delete winres; 219 } else hCursor = OSLibWinQuerySysPointer((ULONG)lpszCursor,GetSystemMetrics(SM_CXCURSOR),GetSystemMetrics(SM_CYCURSOR)); 220 } else 221 {//not a system pointer 222 winres = (Win32Resource *)FindResourceW(hinst, lpszCursor, RT_CURSORW); 223 if(winres == 0) { 224 winres = (Win32Resource *)FindResourceW(hinst, lpszCursor, RT_GROUP_CURSORW); 225 } 226 if(winres) { 227 hCursor = OSLibWinCreatePointer(winres->lockOS2Resource()); 228 delete winres; 229 } else hCursor = 0; 277 HANDLE hMapping = 0; 278 char *ptr = NULL; 279 280 if(fuLoad & LR_LOADFROMFILE) 281 { 282 hMapping = VIRTUAL_MapFileW( lpszCursor, (LPVOID *)&ptr, TRUE); 283 if(hMapping == INVALID_HANDLE_VALUE) 284 return 0; 285 hCursor = OSLibWinCreatePointer(ptr); 286 CloseHandle(hMapping); 287 } 288 else 289 { 290 if(!hinst) 291 { 292 winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszCursor,RT_CURSORW); 293 if(!winres) 294 winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszCursor,RT_GROUP_CURSORW); 295 if(winres) 296 { 297 hCursor = OSLibWinCreatePointer(winres->lockOS2Resource()); 298 delete winres; 299 } 300 else hCursor = OSLibWinQuerySysPointer((ULONG)lpszCursor,GetSystemMetrics(SM_CXCURSOR),GetSystemMetrics(SM_CYCURSOR)); 301 } 302 else 303 {//not a system pointer 304 winres = (Win32Resource *)FindResourceW(hinst, lpszCursor, RT_CURSORW); 305 if(winres == 0) { 306 winres = (Win32Resource *)FindResourceW(hinst, lpszCursor, RT_GROUP_CURSORW); 307 } 308 if(winres) { 309 hCursor = OSLibWinCreatePointer(winres->lockOS2Resource()); 310 delete winres; 311 } 312 else hCursor = 0; 313 } 230 314 } 231 315 dprintf(("LoadCursorW (%X) returned %x\n", hinst, hCursor)); 232 316 233 317 return(hCursor); 318 } 319 //****************************************************************************** 320 //****************************************************************************** 321 HCURSOR WIN32API LoadCursorA(HINSTANCE hinst, LPCSTR lpszCursor) 322 { 323 return LoadCursorA(hinst, lpszCursor, 0, 0, 0); 324 } 325 //****************************************************************************** 326 //****************************************************************************** 327 HCURSOR WIN32API LoadCursorW(HINSTANCE hinst, LPCWSTR lpszCursor) 328 { 329 return LoadCursorW(hinst, lpszCursor, 0, 0, 0); 234 330 } 235 331 //****************************************************************************** … … 436 532 else dprintf(("LoadImageA NOT COMPLETE %x %x %d (%d,%d)\n", hinst, lpszName, uType, cxDesired, cyDesired)); 437 533 438 if 534 if(fuLoad & LR_DEFAULTSIZE) { 439 535 if (uType == IMAGE_ICON) { 440 536 if (!cxDesired) cxDesired = GetSystemMetrics(SM_CXICON); … … 453 549 break; 454 550 case IMAGE_CURSOR: 455 hRet = (HANDLE)LoadCursorA(hinst, lpszName );551 hRet = (HANDLE)LoadCursorA(hinst, lpszName, cxDesired, cyDesired, fuLoad); 456 552 break; 457 553 case IMAGE_ICON: 458 hRet = (HANDLE)LoadIconA(hinst, lpszName );554 hRet = (HANDLE)LoadIconA(hinst, lpszName, cxDesired, cyDesired, fuLoad); 459 555 break; 460 556 default: … … 492 588 break; 493 589 case IMAGE_CURSOR: 494 hRet = (HANDLE)LoadCursorW(hinst, lpszName );590 hRet = (HANDLE)LoadCursorW(hinst, lpszName, cxDesired, cyDesired, fuLoad); 495 591 break; 496 592 case IMAGE_ICON: 497 hRet = (HANDLE)LoadIconW(hinst, lpszName );593 hRet = (HANDLE)LoadIconW(hinst, lpszName, cxDesired, cyDesired, fuLoad); 498 594 break; 499 595 default: -
trunk/src/user32/win32wbase.cpp
r3388 r3419 1 /* $Id: win32wbase.cpp,v 1.1 79 2000-04-15 15:11:14sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.180 2000-04-18 11:13:00 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 2903 2903 } 2904 2904 //****************************************************************************** 2905 //Note: Should return NULL if window is frame window! (IsOS2FrameWindowHandle depends on this 2906 // behaviour) 2905 2907 //****************************************************************************** 2906 2908 Win32BaseWindow *Win32BaseWindow::GetWindowFromOS2Handle(HWND hwnd) … … 2969 2971 return 0; 2970 2972 // else return hwnd; //OS/2 window handle 2973 } 2974 //****************************************************************************** 2975 //****************************************************************************** 2976 BOOL Win32BaseWindow::IsOS2FrameWindowHandle(HWND hwndWin32, HWND hwndOS2) 2977 { 2978 Win32BaseWindow *window = GetWindowFromHandle(hwndWin32); 2979 2980 if(window->getOS2FrameWindowHandle() == hwndOS2) { 2981 return TRUE; 2982 } 2983 return FALSE; 2971 2984 } 2972 2985 //****************************************************************************** -
trunk/src/user32/win32wbase.h
r3365 r3419 1 /* $Id: win32wbase.h,v 1.9 2 2000-04-10 19:40:46sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.93 2000-04-18 11:13:01 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 284 284 static HWND Win32ToOS2FrameHandle(HWND hwnd); 285 285 static HWND OS2ToWin32Handle(HWND hwnd); 286 static BOOL IsOS2FrameWindowHandle(HWND hwndWin32, HWND hwndOS2); 286 287 287 288 static Win32BaseWindow *GetWindowFromHandle(HWND hwnd); -
trunk/src/user32/window.cpp
r3373 r3419 1 /* $Id: window.cpp,v 1.6 0 2000-04-13 18:50:44sandervl Exp $ */1 /* $Id: window.cpp,v 1.61 2000-04-18 11:13:01 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 658 658 window = windowDesktop; 659 659 660 661 660 if(!window) { 662 661 dprintf(("GetWindowRect, window %x not found", hwnd)); … … 670 669 *pRect = *window->getWindowRect(); //always in screen coordinates 671 670 672 if(hwnd == 0x68000034) {673 window = 0;674 }675 671 dprintf(("GetWindowRect %x (%d,%d) (%d,%d)", hwnd, pRect->left, pRect->top, pRect->right, pRect->bottom)); 676 672 return TRUE;
Note:
See TracChangeset
for help on using the changeset viewer.