Changeset 304 for trunk/src/user32/new/windowclass.cpp
- Timestamp:
- Jul 14, 1999, 11:05:59 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/windowclass.cpp
r300 r304 1 /* $Id: windowclass.cpp,v 1. 1 1999-07-14 08:35:37 sandervlExp $ */1 /* $Id: windowclass.cpp,v 1.2 1999-07-14 21:05:59 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Class Code for OS/2 … … 37 37 Win32WndClass *wclass; 38 38 39 memcpy(&wc, lpWndClass, sizeof(WNDCLASSA)); 39 //CB: size new in ex structure 40 wc.cbSize = sizeof(wc); 41 memcpy(&wc.style, lpWndClass, sizeof(WNDCLASSA)); 40 42 wc.hIconSm = 0; 41 42 wclass = new Win32WndClass(&wc );43 44 wclass = new Win32WndClass(&wc,FALSE); 43 45 if(wclass == NULL) { 44 45 46 dprintf(("RegisterClassA wclass == NULL!")); 47 return(0); 46 48 } 47 49 return(wclass->getAtom()); … … 53 55 Win32WndClass *wclass; 54 56 55 wclass = new Win32WndClass((WNDCLASSEXA *)lpWndClass );57 wclass = new Win32WndClass((WNDCLASSEXA *)lpWndClass,FALSE); 56 58 if(wclass == NULL) { 57 58 59 dprintf(("RegisterClassExA wclass == NULL!")); 60 return(0); 59 61 } 60 62 return(wclass->getAtom()); 61 63 } 62 64 //****************************************************************************** 65 //CB: update to unicode! 63 66 //****************************************************************************** 64 67 WORD WIN32API RegisterClassW(CONST WNDCLASSW *lpwc) … … 68 71 69 72 dprintf(("RegisterClassW\n")); 70 memcpy(&wclass, lpwc, sizeof(WNDCLASSA)); 73 //CB: size new in ex structure 74 wclass.cbSize = sizeof(wclass); 75 memcpy(&wclass.style, lpwc, sizeof(WNDCLASSA)); 71 76 if(wclass.lpszMenuName && ((ULONG)wclass.lpszMenuName >> 16 != 0)) { 72 77 wclass.lpszMenuName = UnicodeToAsciiString((LPWSTR)lpwc->lpszMenuName); 73 78 } 74 79 if(wclass.lpszClassName && ((ULONG)wclass.lpszClassName >> 16 != 0)) { 75 80 wclass.lpszClassName = UnicodeToAsciiString((LPWSTR)lpwc->lpszClassName); 76 81 } 77 82 rc = RegisterClassA((CONST WNDCLASSA *)&wclass); 78 83 79 84 if(lpwc->lpszMenuName && ((ULONG)lpwc->lpszMenuName >> 16 != 0)) { 80 85 FreeAsciiString((char *)wclass.lpszMenuName); 81 86 } 82 87 if(lpwc->lpszClassName && ((ULONG)lpwc->lpszClassName >> 16 != 0)) { 83 88 FreeAsciiString((char *)wclass.lpszClassName); 84 89 } 85 90 return(rc); 86 91 } 87 92 //****************************************************************************** 93 //CB: update to unicode! 88 94 //****************************************************************************** 89 95 ATOM WIN32API RegisterClassExW(CONST WNDCLASSEXW *lpwc) … … 95 101 memcpy(&wclass, lpwc, sizeof(WNDCLASSEXA)); 96 102 if(wclass.lpszMenuName && ((ULONG)wclass.lpszMenuName >> 16 != 0)) { 97 103 wclass.lpszMenuName = UnicodeToAsciiString((LPWSTR)lpwc->lpszMenuName); 98 104 } 99 105 if(wclass.lpszClassName && ((ULONG)wclass.lpszClassName >> 16 != 0)) { 100 106 wclass.lpszClassName = UnicodeToAsciiString((LPWSTR)lpwc->lpszClassName); 101 107 } 102 108 rc = RegisterClassExA((CONST WNDCLASSEXA *)&wclass); 103 109 104 110 if(lpwc->lpszMenuName && ((ULONG)lpwc->lpszMenuName >> 16 != 0)) { 105 111 FreeAsciiString((char *)wclass.lpszMenuName); 106 112 } 107 113 if(lpwc->lpszClassName && ((ULONG)lpwc->lpszClassName >> 16 != 0)) { 108 114 FreeAsciiString((char *)wclass.lpszClassName); 109 115 } 110 116 return(rc); … … 121 127 } 122 128 //****************************************************************************** 129 //CB:update to unicode! 123 130 //****************************************************************************** 124 131 BOOL WIN32API UnregisterClassW(LPCWSTR lpszClassName, HINSTANCE hinst) … … 128 135 dprintf(("USER32: UnregisterClassW\n")); 129 136 if((ULONG)lpszClassName >> 16 != 0) { 130 131 } 132 else 137 astring = UnicodeToAsciiString((LPWSTR)lpszClassName); 138 } 139 else astring = (char *)lpszClassName; 133 140 134 141 Win32WndClass::UnregisterClassA(hinst, (LPSTR)astring); 135 if((ULONG)astring >> 16 != 0) 136 142 if((ULONG)astring >> 16 != 0) 143 FreeAsciiString((char *)astring); 137 144 //Spintest returns FALSE in dll termination, so pretend it succeeded 138 145 return(TRUE); … … 150 157 wndclass = Win32WndClass::FindClass(hInstance, (LPSTR)lpszClass); 151 158 if(wndclass) { 152 wndclass->getClassInfo(&wc); 153 memcpy(lpwc, &wc, sizeof(WNDCLASSA)); 154 return(TRUE); 155 } 156 return(FALSE); 157 } 158 //****************************************************************************** 159 wndclass->getClassInfo(&wc); 160 memcpy(lpwc, &wc, sizeof(WNDCLASSA)); 161 return(TRUE); 162 } 163 return(FALSE); 164 } 165 //****************************************************************************** 166 //CB: update to unicode! 159 167 //****************************************************************************** 160 168 BOOL WIN32API GetClassInfoW(HINSTANCE hinst, LPCWSTR lpszClass, WNDCLASSW *lpwc) … … 168 176 169 177 if((ULONG)lpszClass >> 16 != 0) { 170 178 astring = UnicodeToAsciiString((LPWSTR)lpszClass); 171 179 } 172 180 else astring = (char *)lpszClass; 173 181 174 182 wndclass = Win32WndClass::FindClass(hinst, astring); 175 if((ULONG)astring >> 16 != 0) 176 183 if((ULONG)astring >> 16 != 0) 184 FreeAsciiString((char *)astring); 177 185 if(wndclass) { 178 179 180 181 } 182 return(FALSE); 186 wndclass->getClassInfo(&wc); 187 memcpy(lpwc, &wc, sizeof(WNDCLASSW)); 188 return(TRUE); 189 } 190 return(FALSE); 183 191 } 184 192 /**************************************************************************** … … 203 211 BOOL rc; 204 212 Win32WndClass *wndclass; 205 213 206 214 dprintf(("USER32:GetClassInfoExA (%08xh,%x,%08x).\n", 207 215 hInstance, 208 216 lpszClass, 209 217 lpwcx)); 210 218 211 219 wndclass = Win32WndClass::FindClass(hInstance, (LPSTR)lpszClass); 212 220 if(wndclass) { 213 214 215 } 216 return(FALSE); 221 wndclass->getClassInfo(lpwcx); 222 return(TRUE); 223 } 224 return(FALSE); 217 225 } 218 226 /***************************************************************************** … … 243 251 244 252 if((ULONG)lpszClass >> 16 != 0) { 245 253 astring = UnicodeToAsciiString((LPWSTR)lpszClass); 246 254 } 247 255 else astring = (char *)lpszClass; 248 256 249 257 wndclass = Win32WndClass::FindClass(hInstance, astring); 250 if((ULONG)astring >> 16 != 0) 251 258 if((ULONG)astring >> 16 != 0) 259 FreeAsciiString((char *)astring); 252 260 if(wndclass) { 253 254 255 } 256 return(FALSE); 261 wndclass->getClassInfo(lpwcx); 262 return(TRUE); 263 } 264 return(FALSE); 257 265 } 258 266 //****************************************************************************** … … 265 273 wnd = WIN2OS2HWND(hwnd); 266 274 if(wnd == NULL) { 267 268 275 dprintf(("GetClassNameA wnd == NULL")); 276 return(0); 269 277 } 270 278 return (wnd->getClass())->getClassName(lpszClassName, cchClassName); … … 279 287 wnd = WIN2OS2HWND(hwnd); 280 288 if(wnd == NULL) { 281 282 289 dprintf(("GetClassNameA wnd == NULL")); 290 return(0); 283 291 } 284 292 return (wnd->getClass())->getClassName(lpszClassName, cchClassName); … … 293 301 wnd = WIN2OS2HWND(hwnd); 294 302 if(wnd == NULL) { 295 296 303 dprintf(("SetClassLongA wnd == NULL")); 304 return(0); 297 305 } 298 306 return (wnd->getClass())->setClassLongA(nIndex, lNewVal); … … 307 315 wnd = WIN2OS2HWND(hwnd); 308 316 if(wnd == NULL) { 309 310 317 dprintf(("SetClassLongW wnd == NULL")); 318 return(0); 311 319 } 312 320 return (wnd->getClass())->setClassLongW(nIndex, lNewVal); … … 321 329 wnd = WIN2OS2HWND(hwnd); 322 330 if(wnd == NULL) { 323 324 331 dprintf(("SetClassWordA wnd == NULL")); 332 return(0); 325 333 } 326 334 return (wnd->getClass())->setClassWord(nIndex, wNewVal); … … 335 343 wnd = WIN2OS2HWND(hwnd); 336 344 if(wnd == NULL) { 337 338 345 dprintf(("GetClassWordA wnd == NULL")); 346 return(0); 339 347 } 340 348 return (wnd->getClass())->getClassWord(nIndex); … … 349 357 wnd = WIN2OS2HWND(hwnd); 350 358 if(wnd == NULL) { 351 352 359 dprintf(("GetClassLongA wnd == NULL")); 360 return(0); 353 361 } 354 362 return (wnd->getClass())->getClassLongA(nIndex); … … 363 371 wnd = WIN2OS2HWND(hwnd); 364 372 if(wnd == NULL) { 365 366 373 dprintf(("GetClassLongW wnd == NULL")); 374 return(0); 367 375 } 368 376 return (wnd->getClass())->getClassLongW(nIndex);
Note:
See TracChangeset
for help on using the changeset viewer.