Changeset 397 for trunk/src/user32/new/oslibres.cpp
- Timestamp:
- Jul 26, 1999, 11:01:34 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/oslibres.cpp
r396 r397 1 /* $Id: oslibres.cpp,v 1. 3 1999-07-25 20:00:52 cbratschiExp $ */1 /* $Id: oslibres.cpp,v 1.4 1999-07-26 09:01:33 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 61 61 HPS hps; 62 62 63 if(iconbitmap == NULL) { 64 dprintf(("OSLibWinSetIcon %x %x: iconbitmap == NULL!!", hwnd, hIcon)); 65 return 0; 66 } 63 67 if(hIcon == 0) { 64 if (!iconbitmap) return 0; //CB: or load a default icon 65 66 //skip xor/and mask 67 bfh = (BITMAPFILEHEADER2 *)((char *)&bafh->bfh2 + sizeof(RGB2)*2 + sizeof(BITMAPFILEHEADER2)); 68 hps = WinGetPS(hwnd); 69 hbmColor = GpiCreateBitmap(hps, &bfh->bmp2, CBM_INIT, 70 (char *)bafh + bfh->offBits, 71 (BITMAPINFO2 *)&bfh->bmp2); 72 if(hbmColor == GPI_ERROR) { 73 dprintf(("OSLibWinSetIcon: GpiCreateBitmap failed!")); 74 WinReleasePS(hps); 75 return 0; 76 } 77 hbmMask = GpiCreateBitmap(hps, &bafh->bfh2.bmp2, CBM_INIT, 78 (char *)bafh + bafh->bfh2.offBits, 79 (BITMAPINFO2 *)&bafh->bfh2.bmp2); 80 if(hbmMask == GPI_ERROR) { 81 dprintf(("OSLibWinSetIcon: GpiCreateBitmap hbmMask failed!")); 82 WinReleasePS(hps); 83 return 0; 84 } 85 86 pointerInfo.fPointer = FALSE; //icon 87 pointerInfo.xHotspot = bfh->xHotspot; 88 pointerInfo.yHotspot = bfh->yHotspot; 89 pointerInfo.hbmColor = hbmColor; 90 pointerInfo.hbmPointer = hbmMask; 91 hIcon = WinCreatePointerIndirect(HWND_DESKTOP, &pointerInfo); 92 if(hIcon == NULL) { 93 dprintf(("WinSetIcon: WinCreatePointerIndirect failed!")); 94 GpiDeleteBitmap(hbmMask); 95 GpiDeleteBitmap(hbmColor); 96 WinReleasePS(hps); 97 } 68 //skip xor/and mask 69 bfh = (BITMAPFILEHEADER2 *)((char *)&bafh->bfh2 + sizeof(RGB2)*2 + sizeof(BITMAPFILEHEADER2)); 70 hps = WinGetPS(hwnd); 71 hbmColor = GpiCreateBitmap(hps, &bfh->bmp2, CBM_INIT, 72 (char *)bafh + bfh->offBits, 73 (BITMAPINFO2 *)&bfh->bmp2); 74 if(hbmColor == GPI_ERROR) { 75 dprintf(("OSLibWinSetIcon: GpiCreateBitmap failed!")); 76 WinReleasePS(hps); 77 return 0; 78 } 79 hbmMask = GpiCreateBitmap(hps, &bafh->bfh2.bmp2, CBM_INIT, 80 (char *)bafh + bafh->bfh2.offBits, 81 (BITMAPINFO2 *)&bafh->bfh2.bmp2); 82 if(hbmMask == GPI_ERROR) { 83 dprintf(("OSLibWinSetIcon: GpiCreateBitmap hbmMask failed!")); 84 WinReleasePS(hps); 85 return 0; 86 } 87 88 pointerInfo.fPointer = FALSE; //icon 89 pointerInfo.xHotspot = bfh->xHotspot; 90 pointerInfo.yHotspot = bfh->yHotspot; 91 pointerInfo.hbmColor = hbmColor; 92 pointerInfo.hbmPointer = hbmMask; 93 hIcon = WinCreatePointerIndirect(HWND_DESKTOP, &pointerInfo); 94 if(hIcon == NULL) { 95 dprintf(("WinSetIcon: WinCreatePointerIndirect failed!")); 96 GpiDeleteBitmap(hbmMask); 97 GpiDeleteBitmap(hbmColor); 98 WinReleasePS(hps); 99 } 98 100 } 99 101 WinSendMsg(hwnd, WM_SETICON, (MPARAM)hIcon, 0); 102 WinReleasePS(hps); 100 103 return hIcon; 101 104 }
Note:
See TracChangeset
for help on using the changeset viewer.