Changeset 3625 for trunk/src/user32
- Timestamp:
- May 28, 2000, 6:45:14 PM (25 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/loadres.cpp
r3482 r3625 1 /* $Id: loadres.cpp,v 1.2 8 2000-05-02 20:50:48sandervl Exp $ */1 /* $Id: loadres.cpp,v 1.29 2000-05-28 16:43:45 sandervl Exp $ */ 2 2 3 3 /* … … 20 20 #include <os2win.h> 21 21 #include <user32.h> 22 #include <winres.h>23 22 #include <heapstring.h> 24 23 #include <oslibres.h> … … 27 26 #include "initterm.h" 28 27 #include <win\cursoricon.h> 28 #include <winres.h> 29 29 30 30 #define DBG_LOCALLOG DBG_loadres … … 60 60 int WIN32API LoadStringW(HINSTANCE hinst, UINT wID, LPWSTR lpBuffer, int cchBuffer) 61 61 { 62 Win32Resource *winres;63 62 WCHAR *p; 64 63 int string_num; 65 64 int i = 0; 65 HRSRC hRes; 66 66 67 67 /* Use bits 4 - 19 (incremented by 1) as resourceid, mask out 68 68 * 20 - 31. */ 69 winres = (Win32Resource *)FindResourceW(hinst, (LPWSTR)(((wID>>4)&0xffff)+1), RT_STRINGW);70 if( winres == NULL) {69 hRes = FindResourceW(hinst, (LPWSTR)(((wID>>4)&0xffff)+1), RT_STRINGW); 70 if(hRes == NULL) { 71 71 dprintf(("LoadStringW NOT FOUND from %X, id %d buffersize %d\n", hinst, wID, cchBuffer)); 72 72 *lpBuffer = 0; … … 74 74 } 75 75 76 p = (LPWSTR) winres->lockResource();76 p = (LPWSTR)LockResource(LoadResource(hinst, hRes)); 77 77 if(p) { 78 78 string_num = wID & 0x000f; … … 93 93 } 94 94 } 95 delete winres;96 95 97 96 #ifdef DEBUG_ENABLELOG_LEVEL2 … … 111 110 DWORD cyDesired, DWORD fuLoad) 112 111 { 113 Win32Resource *winres;114 112 HICON hIcon; 115 113 HANDLE hMapping = 0; 116 114 char *ptr = NULL; 115 HRSRC hRes; 116 LPSTR restype = RT_ICONA; 117 117 118 118 if(fuLoad & LR_LOADFROMFILE) … … 128 128 if(!hinst) 129 129 { 130 winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszIcon,RT_ICONA); 131 if(!winres) 132 winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszIcon,RT_GROUP_ICONA); 133 if(winres) 130 hRes = FindResourceA(hInstanceUser32,lpszIcon,RT_ICONA); 131 if(!hRes) { 132 hRes = FindResourceA(hInstanceUser32,lpszIcon,RT_GROUP_ICONA); 133 restype = RT_GROUP_ICONA; 134 } 135 if(hRes) 134 136 { 135 hIcon = OSLibWinCreateIcon(winres->lockOS2Resource()); 136 delete winres; 137 hIcon = OSLibWinCreateIcon(ConvertResourceToOS2(hInstanceUser32, restype, hRes)); 137 138 } 138 else hIcon = OSLibWinQuerySysIcon((ULONG)lpszIcon,GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON));139 else hIcon = OSLibWinQuerySysIcon((ULONG)lpszIcon,GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON)); 139 140 } 140 141 else 141 142 { //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;143 hRes = FindResourceA(hinst,lpszIcon,RT_ICONA); 144 if(!hRes) { 145 hRes = FindResourceA(hinst,lpszIcon,RT_GROUP_ICONA); 146 restype = RT_GROUP_ICONA; 147 } 148 if(hRes) { 149 hIcon = OSLibWinCreateIcon(ConvertResourceToOS2(hinst, restype, hRes)); 149 150 } 150 151 else hIcon = 0; … … 160 161 DWORD cyDesired, DWORD fuLoad) 161 162 { 162 Win32Resource *winres;163 163 HICON hIcon; 164 164 HANDLE hMapping = 0; 165 165 char *ptr = NULL; 166 HRSRC hRes; 167 LPSTR restype = RT_ICONA; 166 168 167 169 if(fuLoad & LR_LOADFROMFILE) … … 177 179 if (!hinst) 178 180 { 179 winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszIcon,RT_ICONW); 180 if(!winres) 181 winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszIcon,RT_GROUP_ICONW); 182 if(winres) 181 hRes = FindResourceW(hInstanceUser32,lpszIcon,RT_ICONW); 182 if(!hRes) { 183 hRes = FindResourceW(hInstanceUser32,lpszIcon,RT_GROUP_ICONW); 184 restype = RT_GROUP_ICONA; 185 } 186 if(hRes) 183 187 { 184 hIcon = OSLibWinCreateIcon(winres->lockOS2Resource()); 185 delete winres; 188 hIcon = OSLibWinCreateIcon(ConvertResourceToOS2(hInstanceUser32, restype, hRes)); 186 189 } 187 190 else hIcon = OSLibWinQuerySysIcon((ULONG)lpszIcon,GetSystemMetrics(SM_CXICON),GetSystemMetrics(SM_CYICON)); 188 191 } 189 192 else 190 193 {//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;194 hRes = FindResourceW(hinst,lpszIcon,RT_ICONW); 195 if(!hRes) { 196 hRes = FindResourceW(hinst,lpszIcon,RT_GROUP_ICONW); 197 restype = RT_GROUP_ICONA; 198 } 199 if(hRes) { 200 hIcon = OSLibWinCreateIcon(ConvertResourceToOS2(hinst, restype, hRes)); 198 201 } 199 202 else hIcon = 0; 200 203 } 201 204 } … … 221 224 DWORD cyDesired, DWORD fuLoad) 222 225 { 223 Win32Resource *winres;224 226 HCURSOR hCursor; 225 227 HANDLE hMapping = 0; 226 228 char *ptr = NULL; 229 HRSRC hRes; 230 LPSTR restype = RT_CURSORA; 227 231 228 232 if(fuLoad & LR_LOADFROMFILE) … … 236 240 else 237 241 { 238 if 242 if(!hinst) 239 243 { 240 winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszCursor,RT_CURSORA); 241 if(!winres) 242 winres = (Win32Resource*)FindResourceA(hInstanceUser32,lpszCursor,RT_GROUP_CURSORA); 243 if(winres) 244 hRes = FindResourceA(hInstanceUser32,lpszCursor,RT_CURSORA); 245 if(!hRes) { 246 hRes = FindResourceA(hInstanceUser32,lpszCursor,RT_GROUP_CURSORA); 247 restype = RT_GROUP_CURSORA; 248 } 249 if(hRes) 244 250 { 245 hCursor = OSLibWinCreatePointer(winres->lockOS2Resource()); 246 delete winres; 251 hCursor = OSLibWinCreatePointer(ConvertResourceToOS2(hInstanceUser32, restype, hRes)); 247 252 } 248 253 else hCursor = OSLibWinQuerySysPointer((ULONG)lpszCursor,GetSystemMetrics(SM_CXCURSOR),GetSystemMetrics(SM_CYCURSOR)); 249 }250 else251 {//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;254 } 255 else 256 { //not a system icon 257 hRes = FindResourceA(hinst,lpszCursor,RT_CURSORA); 258 if(!hRes) { 259 hRes = FindResourceA(hinst,lpszCursor,RT_GROUP_CURSORA); 260 restype = RT_GROUP_CURSORA; 261 } 262 if(hRes) { 263 hCursor = OSLibWinCreatePointer(ConvertResourceToOS2(hinst, restype, hRes)); 259 264 } 260 265 else hCursor = 0; 261 266 } 262 267 } 263 268 if(HIWORD(lpszCursor)) { … … 273 278 DWORD cyDesired, DWORD fuLoad) 274 279 { 275 Win32Resource *winres;276 280 HCURSOR hCursor; 277 281 HANDLE hMapping = 0; 278 282 char *ptr = NULL; 283 HRSRC hRes; 284 LPSTR restype = RT_CURSORA; 279 285 280 286 if(fuLoad & LR_LOADFROMFILE) … … 290 296 if(!hinst) 291 297 { 292 winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszCursor,RT_CURSORW); 293 if(!winres) 294 winres = (Win32Resource*)FindResourceW(hInstanceUser32,lpszCursor,RT_GROUP_CURSORW); 295 if(winres) 298 hRes = FindResourceW(hInstanceUser32,lpszCursor,RT_CURSORW); 299 if(!hRes) { 300 hRes = FindResourceW(hInstanceUser32,lpszCursor,RT_GROUP_CURSORW); 301 restype = RT_GROUP_CURSORA; 302 } 303 if(hRes) 296 304 { 297 hCursor = OSLibWinCreatePointer(winres->lockOS2Resource()); 298 delete winres; 305 hCursor = OSLibWinCreatePointer(ConvertResourceToOS2(hInstanceUser32, restype, hRes)); 299 306 } 300 307 else hCursor = OSLibWinQuerySysPointer((ULONG)lpszCursor,GetSystemMetrics(SM_CXCURSOR),GetSystemMetrics(SM_CYCURSOR)); 301 302 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;308 } 309 else 310 { //not a system icon 311 hRes = FindResourceW(hinst,lpszCursor,RT_CURSORW); 312 if(!hRes) { 313 hRes = FindResourceW(hinst,lpszCursor,RT_GROUP_CURSORW); 314 restype = RT_GROUP_CURSORA; 315 } 316 if(hRes) { 317 hCursor = OSLibWinCreatePointer(ConvertResourceToOS2(hinst, restype, hRes)); 311 318 } 312 319 else hCursor = 0; 313 320 } 314 321 } 315 322 dprintf(("LoadCursorW (%X) returned %x\n", hinst, hCursor)); … … 498 505 hBitmap = LoadBitmapA(hinst, lpszBitmap, 0, 0, 0); 499 506 500 dprintf(("LoadBitmapA returned %08xh\n", hBitmap)); 507 if(HIWORD(lpszBitmap)) { 508 dprintf(("LoadBitmapA %x %s returned %08xh\n", hinst, lpszBitmap, hBitmap)); 509 } 510 else dprintf(("LoadBitmapA %x %x returned %08xh\n", hinst, lpszBitmap, hBitmap)); 501 511 502 512 return(hBitmap); … … 517 527 FreeAsciiString((LPSTR)lpszBitmap); 518 528 519 dprintf(("LoadBitmapW returned %08xh\n", hBitmap)); 529 if(HIWORD(lpszBitmap)) { 530 dprintf(("LoadBitmapW %x %s returned %08xh\n", hinst, lpszBitmap, hBitmap)); 531 } 532 else dprintf(("LoadBitmapW %x %x returned %08xh\n", hinst, lpszBitmap, hBitmap)); 520 533 521 534 return(hBitmap); -
trunk/src/user32/syscolor.cpp
r3525 r3625 1 /* $Id: syscolor.cpp,v 1.2 1 2000-05-12 18:09:41sandervl Exp $ */1 /* $Id: syscolor.cpp,v 1.22 2000-05-28 16:43:46 sandervl Exp $ */ 2 2 3 3 /* … … 246 246 HBRUSH WIN32API GetSysColorBrush(int nIndex) 247 247 { 248 dprintf(("GetSysColorBrush %d returned", nIndex));249 248 if (!fColorInit) 250 249 { … … 252 251 fColorInit = TRUE; 253 252 } 254 253 dprintf(("GetSysColorBrush %d returned %x ", nIndex, ((nIndex >= 0) && (nIndex < NUM_SYS_COLORS)) ? SysColorBrushes[nIndex]:0)); 255 254 return ((nIndex >= 0) && (nIndex < NUM_SYS_COLORS)) ? SysColorBrushes[nIndex]:0; 256 255 } -
trunk/src/user32/win32wbase.cpp
r3610 r3625 1 /* $Id: win32wbase.cpp,v 1.19 5 2000-05-26 18:43:34sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.196 2000-05-28 16:43:46 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 29 29 #include <heapstring.h> 30 30 #include <win32wbase.h> 31 #include <winres.h>32 31 #include "wndmsg.h" 33 32 #include "oslibwin.h" -
trunk/src/user32/win32wbasenonclient.cpp
r3350 r3625 1 /* $Id: win32wbasenonclient.cpp,v 1.2 2 2000-04-08 18:31:07 cbratschiExp $ */1 /* $Id: win32wbasenonclient.cpp,v 1.23 2000-05-28 16:43:47 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (non-client methods) … … 24 24 #include <heapstring.h> 25 25 #include <win32wbase.h> 26 #include <winres.h>27 26 #include "wndmsg.h" 28 27 #include "pmframe.h" -
trunk/src/user32/win32wbasepos.cpp
r2803 r3625 1 /* $Id: win32wbasepos.cpp,v 1.1 3 2000-02-16 14:28:24sandervl Exp $ */1 /* $Id: win32wbasepos.cpp,v 1.14 2000-05-28 16:43:47 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (nonclient/position methods) … … 25 25 #include <misc.h> 26 26 #include <win32wbase.h> 27 #include <winres.h>28 27 #include <spy.h> 29 28 #include "wndmsg.h" -
trunk/src/user32/win32wmdichild.cpp
r3603 r3625 1 /* $Id: win32wmdichild.cpp,v 1.2 3 2000-05-24 19:30:08sandervl Exp $ */1 /* $Id: win32wmdichild.cpp,v 1.24 2000-05-28 16:43:47 sandervl Exp $ */ 2 2 /* 3 3 * Win32 MDI Child Window Class for OS/2 … … 37 37 #include <oslibres.h> 38 38 #include "oslibdos.h" 39 #include <winres.h>40 39 #include "syscolor.h" 41 40 #include "win32wndhandle.h" -
trunk/src/user32/win32wmdiclient.cpp
r3603 r3625 1 /* $Id: win32wmdiclient.cpp,v 1.2 7 2000-05-24 19:30:08sandervl Exp $ */1 /* $Id: win32wmdiclient.cpp,v 1.28 2000-05-28 16:43:47 sandervl Exp $ */ 2 2 /* 3 3 * Win32 MDI Client Window Class for OS/2 … … 33 33 #include <oslibres.h> 34 34 #include "oslibdos.h" 35 #include <winres.h>36 35 #include "syscolor.h" 37 36 #include "win32wndhandle.h" -
trunk/src/user32/win32wnd.cpp
r2803 r3625 1 /* $Id: win32wnd.cpp,v 1. 8 2000-02-16 14:28:24sandervl Exp $ */1 /* $Id: win32wnd.cpp,v 1.9 2000-05-28 16:43:48 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Class for OS/2 … … 30 30 #include <oslibres.h> 31 31 #include "oslibdos.h" 32 #include <winres.h>33 32 #include "syscolor.h" 34 33 #include "win32wndhandle.h" -
trunk/src/user32/windowclass.cpp
r2803 r3625 1 /* $Id: windowclass.cpp,v 1. 9 2000-02-16 14:28:26sandervl Exp $ */1 /* $Id: windowclass.cpp,v 1.10 2000-05-28 16:43:48 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Class Code for OS/2 … … 197 197 * Variables : 198 198 * Result : If the function finds a matching class and successfully copies 199 * 199 * the data, the return value is TRUE; 200 200 * otherwise, it is FALSE. 201 201 * To get extended error information, call GetLastError. … … 203 203 *****************************************************************************/ 204 204 BOOL WIN32API GetClassInfoExA(HINSTANCE hInstance, 205 206 205 LPCTSTR lpszClass, 206 LPWNDCLASSEXA lpwcx) 207 207 { 208 208 BOOL rc; 209 209 Win32WndClass *wndclass; 210 210 211 dprintf(("USER32:GetClassInfoExA (%08xh,%x,%08x).\n", 212 hInstance, 213 lpszClass, 214 lpwcx)); 211 if(HIWORD(lpszClass)) { 212 dprintf(("USER32:GetClassInfoExA (%08xh,%s,%08x)", 213 hInstance, lpszClass, lpwcx)); 214 } 215 else dprintf(("USER32:GetClassInfoExA (%08xh,%x,%08x)", 216 hInstance, lpszClass, lpwcx)); 215 217 216 218 wndclass = Win32WndClass::FindClass(hInstance, (LPSTR)lpszClass);
Note:
See TracChangeset
for help on using the changeset viewer.