Ignore:
Timestamp:
Mar 31, 2001, 12:08:20 AM (24 years ago)
Author:
sandervl
Message:

syscolor change + iconsm creation in RegisterClassA/W

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/windowclass.cpp

    r5242 r5406  
    1 /* $Id: windowclass.cpp,v 1.16 2001-02-22 10:37:31 sandervl Exp $ */
     1/* $Id: windowclass.cpp,v 1.17 2001-03-30 22:08:20 sandervl Exp $ */
    22/*
    33 * Win32 Window Class Code for OS/2
     
    5151    memcpy(&wc.style, lpWndClass, sizeof(WNDCLASSA));
    5252    wc.hIconSm = 0;
     53 
     54    //TODO: not destroyed when class is unregistered (neither does Wine, but that might be a bug)
     55    int iSmIconWidth  = GetSystemMetrics(SM_CXSMICON);
     56    int iSmIconHeight = GetSystemMetrics(SM_CYSMICON);
     57
     58    wc.hIconSm = CopyImage(wc.hIcon, IMAGE_ICON, iSmIconWidth, iSmIconHeight,
     59                           LR_COPYFROMRESOURCE);
    5360
    5461    if(Win32WndClass::FindClass(wc.hInstance, (LPSTR)wc.lpszClassName)) {
     
    103110 Win32WndClass *winclass;
    104111
    105     dprintf(("RegisterClassW\n"));
    106112    //CB: size new in ex structure
    107113    wc.cbSize = sizeof(wc);
    108114    memcpy(&wc.style, lpwc, sizeof(WNDCLASSA));
    109     wc.hIconSm = 0;
     115
     116    //TODO: not destroyed when class is unregistered (neither does Wine, but that might be a bug)
     117    int iSmIconWidth  = GetSystemMetrics(SM_CXSMICON);
     118    int iSmIconHeight = GetSystemMetrics(SM_CYSMICON);
     119
     120    wc.hIconSm = CopyImage(wc.hIcon, IMAGE_ICON, iSmIconWidth, iSmIconHeight,
     121                           LR_COPYFROMRESOURCE);
    110122
    111123    if(Win32WndClass::FindClass(wc.hInstance, (LPWSTR)wc.lpszClassName)) {
    112         dprintf(("RegisterClassW %x %x already exists", wc.hInstance, wc.lpszClassName));
     124        if(HIWORD(wc.lpszClassName)) {
     125                dprintf(("RegisterClassW %x %ls already exists", wc.hInstance, wc.lpszClassName));
     126        }
     127        else    dprintf(("RegisterClassW %x %x already exists", wc.hInstance, wc.lpszClassName));
    113128        SetLastError(ERROR_CLASS_ALREADY_EXISTS);
    114129        return 0;
     
    138153
    139154    if(Win32WndClass::FindClass(wc.hInstance, (LPWSTR)wc.lpszClassName)) {
    140         dprintf(("RegisterClassW %x %x already exists", wc.hInstance, wc.lpszClassName));
     155        if(HIWORD(wc.lpszClassName)) {
     156                dprintf(("RegisterClassExW %x %ls already exists", wc.hInstance, wc.lpszClassName));
     157        }
     158        else    dprintf(("RegisterClassExW %x %x already exists", wc.hInstance, wc.lpszClassName));
    141159        SetLastError(ERROR_CLASS_ALREADY_EXISTS);
    142160        return 0;
     
    306324 char          *astring = NULL;
    307325
    308   dprintf(("USER32: GetClassInfoExW\n"));
     326  if(HIWORD(lpszClass)) {
     327       dprintf(("USER32:GetClassInfoExW (%08xh,%ls,%08x)",
     328                 hInstance, lpszClass, lpwcx));
     329  }
     330  else dprintf(("USER32:GetClassInfoExW (%08xh,%x,%08x)",
     331                 hInstance, lpszClass, lpwcx));
    309332
    310333  if(HIWORD(lpszClass) != 0) {
Note: See TracChangeset for help on using the changeset viewer.