Changeset 5385 for trunk/src/user32/loadres.cpp
- Timestamp:
- Mar 27, 2001, 6:17:52 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/loadres.cpp
r4586 r5385 1 /* $Id: loadres.cpp,v 1.3 4 2000-11-12 10:58:12sandervl Exp $ */1 /* $Id: loadres.cpp,v 1.35 2001-03-27 16:17:51 sandervl Exp $ */ 2 2 3 3 /* … … 25 25 #include "dib.h" 26 26 #include "initterm.h" 27 #include <win\cursoricon.h>28 27 #include <winres.h> 28 #include "pmwindow.h" 29 29 30 30 #define DBG_LOCALLOG DBG_loadres … … 121 121 dprintf(("LoadIconA %x %x", hinst, lpszIcon)); 122 122 return LoadImageW(hinst, lpszIcon, IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE); 123 }124 //******************************************************************************125 //******************************************************************************126 HCURSOR LoadCursorW(HINSTANCE hinst, LPCWSTR lpszCursor, DWORD cxDesired,127 DWORD cyDesired, DWORD fuLoad)128 {129 HCURSOR hCursor;130 HANDLE hMapping = 0;131 char *ptr = NULL;132 HRSRC hRes;133 LPSTR restype = RT_CURSORA;134 LPVOID lpOS2Resdata = NULL;135 136 if(fuLoad & LR_LOADFROMFILE)137 {138 hMapping = VIRTUAL_MapFileW( lpszCursor, (LPVOID *)&ptr, TRUE);139 if(hMapping == INVALID_HANDLE_VALUE)140 return 0;141 142 lpOS2Resdata = ConvertCursorToOS2(ptr);143 hCursor = OSLibWinCreatePointer(lpOS2Resdata, cxDesired, cyDesired);144 FreeOS2Resource(lpOS2Resdata);145 146 UnmapViewOfFile(ptr);147 CloseHandle(hMapping);148 }149 else150 {151 if(!hinst)152 {153 hRes = FindResourceW(hInstanceUser32,lpszCursor,RT_CURSORW);154 if(!hRes) {155 hRes = FindResourceW(hInstanceUser32,lpszCursor,RT_GROUP_CURSORW);156 restype = RT_GROUP_CURSORA;157 }158 if(hRes)159 {160 lpOS2Resdata = ConvertResourceToOS2(hInstanceUser32, restype, hRes);161 hCursor = OSLibWinCreatePointer(lpOS2Resdata, cxDesired, cyDesired);162 FreeOS2Resource(lpOS2Resdata);163 }164 else hCursor = OSLibWinQuerySysPointer((ULONG)lpszCursor, cxDesired, cyDesired);165 }166 else167 { //not a system icon168 hRes = FindResourceW(hinst,lpszCursor,RT_CURSORW);169 if(!hRes) {170 hRes = FindResourceW(hinst,lpszCursor,RT_GROUP_CURSORW);171 restype = RT_GROUP_CURSORA;172 }173 if(hRes) {174 lpOS2Resdata = ConvertResourceToOS2(hinst, restype, hRes);175 hCursor = OSLibWinCreatePointer(lpOS2Resdata, cxDesired, cyDesired);176 FreeOS2Resource(lpOS2Resdata);177 }178 else hCursor = 0;179 }180 }181 dprintf(("LoadCursorA %x from %x returned %x\n", lpszCursor, hinst, hCursor));182 183 return(hCursor);184 123 } 185 124 //****************************************************************************** … … 466 405 case IMAGE_ICON: 467 406 { 407 #ifdef __WIN32OS2__ 408 ULONG palEnts = (1 << ScreenBitsPerPel); 409 #else 468 410 HDC hdc = GetDC(0); 469 411 UINT palEnts = GetSystemPaletteEntries(hdc, 0, 0, NULL); … … 471 413 palEnts = 256; 472 414 ReleaseDC(0, hdc); 415 #endif 473 416 474 417 hRet = CURSORICON_Load(hinst, lpszName, cxDesired, cyDesired, palEnts, FALSE, fuLoad); … … 477 420 478 421 case IMAGE_CURSOR: 479 hRet = (HANDLE)LoadCursorW(hinst, lpszName, cxDesired, cyDesired, fuLoad); 480 break; 481 // return CURSORICON_Load(hinst, name, desiredx, desiredy, 1, TRUE, loadflags); 422 return CURSORICON_Load(hinst, lpszName, cxDesired, cyDesired, 1, TRUE, fuLoad); 482 423 483 424 default: 484 485 425 dprintf(("LoadImageW: unsupported type %d!!", uType)); 426 return 0; 486 427 } 487 428 dprintf(("LoadImageW returned %x\n", (int)hRet)); … … 518 459 return (HANDLE)CURSORICON_ExtCopy(hnd, type, desiredx, desiredy, flags); 519 460 case IMAGE_CURSOR: 520 /* Should call CURSORICON_ExtCopy but more testing 521 * needs to be done before we change this 522 */ 523 return O32_CopyCursor(hnd); 524 // return CopyCursorIcon(hnd,type, desiredx, desiredy, flags); 461 /* Should call CURSORICON_ExtCopy but more testing 462 * needs to be done before we change this 463 */ 464 return CURSORICON_ExtCopy(hnd,type, desiredx, desiredy, flags); 525 465 default: 526 466 dprintf(("CopyImage: Unsupported type"));
Note:
See TracChangeset
for help on using the changeset viewer.