Ignore:
Timestamp:
Oct 29, 2002, 1:19:36 PM (23 years ago)
Author:
sandervl
Message:

Wine resync

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comctl32/updown.c

    r8382 r9370  
    1 /*             
     1/*
    22 * Updown control
    33 *
     
    1818 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1919 *
     20 * NOTE
     21 *
     22 * This code was audited for completeness against the documented features
     23 * of Comctl32.dll version 6.0 on Sep. 9, 2002, by Dimitrie O. Paun.
     24 *
     25 * Unless otherwise noted, we believe this code to be complete, as per
     26 * the specification mentioned above.
     27 * If you discover missing features, or bugs, please note them below.
     28 *
    2029 */
    2130
     
    3039#include "commctrl.h"
    3140#include "winnls.h"
    32 #include "ntddk.h"
     41#include "wine/unicode.h"
    3342#include "wine/debug.h"
    34 #ifdef __WIN32OS2__
    35 #include "comctl32.h"
    36 #endif
    3743
    3844WINE_DEFAULT_DEBUG_CHANNEL(updown);
     
    8793#define BUDDY_SUPERCLASS_WNDPROC "buddySupperClassWndProc"
    8894
    89 #define UNKNOWN_PARAM(msg, wParam, lParam) WARN(\
    90         "Unknown parameter(s) for message " #msg \
    91         "(%04x): wp=%04x lp=%08lx\n", msg, wParam, lParam);
    92 
    9395#define UPDOWN_GetInfoPtr(hwnd) ((UPDOWN_INFO *)GetWindowLongA (hwnd,0))
    9496#define COUNT_OF(a) (sizeof(a)/sizeof(a[0]))
     
    155157 */
    156158static BOOL UPDOWN_HasBuddyBorder(UPDOWN_INFO* infoPtr)
    157 { 
     159{
    158160    DWORD dwStyle = GetWindowLongW (infoPtr->Self, GWL_STYLE);
    159161
     
    185187        else
    186188            rect->right -= DEFAULT_BUDDYBORDER;
    187    
     189
    188190        InflateRect(rect, 0, -DEFAULT_BUDDYBORDER);
    189191    }
     
    194196        else rect->left += DEFAULT_BUDDYSPACER;
    195197    }
    196    
     198
    197199    /*
    198200     * We're calculating the midpoint to figure-out where the
     
    203205        int len = rect->right - rect->left + 1; /* compute the width */
    204206        if (arrow & FLAG_INCR)
    205             rect->left = rect->left + len/2; 
     207            rect->left = rect->left + len/2;
    206208        if (arrow & FLAG_DECR)
    207209            rect->right =  rect->left + len/2 - 1;
     
    271273        if (!GetWindowTextW(infoPtr->Buddy, txt, COUNT_OF(txt))) return FALSE;
    272274
    273         sep = UPDOWN_GetThousandSep(); 
     275        sep = UPDOWN_GetThousandSep();
    274276
    275277        /* now get rid of the separators */
     
    279281
    280282        /* try to convert the number and validate it */
    281         newVal = wcstol(txt, &src, infoPtr->Base);
     283        newVal = strtolW(txt, &src, infoPtr->Base);
    282284        if(*src || !UPDOWN_InBounds (infoPtr, newVal)) return FALSE;
    283285    }
    284  
     286
    285287    TRACE("new value(%d) from buddy (old=%d)\n", newVal, infoPtr->CurVal);
    286288    infoPtr->CurVal = newVal;
     
    310312        return SendMessageW(infoPtr->Buddy, LB_SETCURSEL, infoPtr->CurVal, 0) != LB_ERR;
    311313    }
    312    
     314
    313315    /* Regular window, so set caption to the number */
    314316    if (infoPtr->Base == 16) fmt[1] = 'X';
    315     len = swprintf(txt, fmt, infoPtr->CurVal);
     317    len = wsprintfW(txt, fmt, infoPtr->CurVal);
    316318
    317319
     
    321323        WCHAR sep = UPDOWN_GetThousandSep();
    322324        int start = len % 3;
    323        
     325
    324326        memcpy(tmp, txt, sizeof(txt));
    325327        if (start == 0) start = 3;
     
    332334        *dst = 0;
    333335    }
    334    
     336
    335337    return SetWindowTextW(infoPtr->Buddy, txt);
    336 } 
     338}
    337339
    338340/***********************************************************************
     
    350352    if (UPDOWN_HasBuddyBorder(infoPtr)) {
    351353        GetClientRect(infoPtr->Self, &rect);
    352         DrawEdge(hdc, &rect, EDGE_SUNKEN, 
    353                  BF_BOTTOM | BF_TOP | 
     354        DrawEdge(hdc, &rect, EDGE_SUNKEN,
     355                 BF_BOTTOM | BF_TOP |
    354356                 (dwStyle & UDS_ALIGNLEFT ? BF_LEFT : BF_RIGHT));
    355357    }
    356  
     358
    357359    /* Draw the incr button */
    358360    UPDOWN_GetArrowRect (infoPtr, &rect, FLAG_INCR);
    359361    pressed = (infoPtr->Flags & FLAG_PRESSED) && (infoPtr->Flags & FLAG_INCR);
    360362    hot = (infoPtr->Flags & FLAG_INCR) && (infoPtr->Flags & FLAG_MOUSEIN);
    361     DrawFrameControl(hdc, &rect, DFC_SCROLL, 
     363    DrawFrameControl(hdc, &rect, DFC_SCROLL,
    362364        (dwStyle & UDS_HORZ ? DFCS_SCROLLRIGHT : DFCS_SCROLLUP) |
    363365        ((dwStyle & UDS_HOTTRACK) && hot ? DFCS_HOT : 0) |
     
    369371    pressed = (infoPtr->Flags & FLAG_PRESSED) && (infoPtr->Flags & FLAG_DECR);
    370372    hot = (infoPtr->Flags & FLAG_DECR) && (infoPtr->Flags & FLAG_MOUSEIN);
    371     DrawFrameControl(hdc, &rect, DFC_SCROLL, 
     373    DrawFrameControl(hdc, &rect, DFC_SCROLL,
    372374        (dwStyle & UDS_HORZ ? DFCS_SCROLLLEFT : DFCS_SCROLLDOWN) |
    373375        ((dwStyle & UDS_HOTTRACK) && hot ? DFCS_HOT : 0) |
     
    402404{
    403405    int arrow;
    404    
     406
    405407    if (key == VK_UP) arrow = FLAG_INCR;
    406408    else if (key == VK_DOWN) arrow = FLAG_DECR;
    407409    else return 1;
    408    
     410
    409411    UPDOWN_GetBuddyInt (infoPtr);
    410412    infoPtr->Flags &= ~FLAG_ARROW;
     
    417419
    418420/***********************************************************************
    419  * UPDOWN_Buddy_SubclassProc used to handle messages sent to the buddy 
     421 * UPDOWN_Buddy_SubclassProc used to handle messages sent to the buddy
    420422 *                           control.
    421423 */
    422 static LRESULT CALLBACK 
     424static LRESULT CALLBACK
    423425UPDOWN_Buddy_SubclassProc(HWND  hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
    424426{
    425427    WNDPROC superClassWndProc = (WNDPROC)GetPropA(hwnd, BUDDY_SUPERCLASS_WNDPROC);
    426     TRACE("hwnd=%04x, wndProc=%d, uMsg=%04x, wParam=%d, lParam=%d\n",
     428    TRACE("hwnd=%p, wndProc=%d, uMsg=%04x, wParam=%d, lParam=%d\n",
    427429          hwnd, (INT)superClassWndProc, uMsg, wParam, (UINT)lParam);
    428430
    429431    if (uMsg == WM_KEYDOWN) {
    430432        HWND upDownHwnd = GetPropA(hwnd, BUDDY_UPDOWN_HWND);
    431      
     433
    432434        UPDOWN_KeyPressed(UPDOWN_GetInfoPtr(upDownHwnd), (int)wParam);
    433435    }
     
    440442 * Tests if 'bud' is a valid window handle. If not, returns FALSE.
    441443 * Else, sets it as a new Buddy.
    442  * Then, it should subclass the buddy 
     444 * Then, it should subclass the buddy
    443445 * If window has the UDS_ARROWKEYS, it subcalsses the buddy window to
    444446 * process the UP/DOWN arrow keys.
     
    451453    RECT  budRect;  /* new coord for the buddy */
    452454    int   x, width;  /* new x position and width for the up-down */
    453     WNDPROC baseWndProc, currWndProc;
     455    WNDPROC baseWndProc;
    454456    CHAR buddyClass[40];
    455          
     457
    456458    /* Is it a valid bud? */
    457459    if(!IsWindow(bud)) return FALSE;
    458460
    459     TRACE("(hwnd=%04x, bud=%04x)\n", infoPtr->Self, bud);
    460    
     461    TRACE("(hwnd=%p, bud=%p)\n", infoPtr->Self, bud);
     462
    461463    /* there is already a body assigned */
    462464    if (infoPtr->Buddy)  RemovePropA(infoPtr->Buddy, BUDDY_UPDOWN_HWND);
    463465
    464466    /* Store buddy window handle */
    465     infoPtr->Buddy = bud;   
    466 
    467     /* keep upDown ctrl hwnd in a buddy property */           
    468     SetPropA( bud, BUDDY_UPDOWN_HWND, infoPtr->Self); 
     467    infoPtr->Buddy = bud;
     468
     469    /* keep upDown ctrl hwnd in a buddy property */
     470    SetPropA( bud, BUDDY_UPDOWN_HWND, infoPtr->Self);
    469471
    470472    /* Store buddy window class type */
     
    478480
    479481    if(dwStyle & UDS_ARROWKEYS){
    480         /* Note that I don't clear the BUDDY_SUPERCLASS_WNDPROC property 
    481            when we reset the upDown ctrl buddy to another buddy because it is not 
     482        /* Note that I don't clear the BUDDY_SUPERCLASS_WNDPROC property
     483           when we reset the upDown ctrl buddy to another buddy because it is not
    482484           good to break the window proc chain. */
    483         currWndProc = (WNDPROC) GetWindowLongW(bud, GWL_WNDPROC);
    484         if (currWndProc != UPDOWN_Buddy_SubclassProc) {
    485             baseWndProc = (WNDPROC)SetWindowLongW(bud, GWL_WNDPROC, (LPARAM)UPDOWN_Buddy_SubclassProc);
     485        if (!GetPropA(bud, BUDDY_SUPERCLASS_WNDPROC)) {
     486            baseWndProc = (WNDPROC)SetWindowLongW(bud, GWL_WNDPROC, (LPARAM)UPDOWN_Buddy_SubclassProc);
    486487            SetPropA(bud, BUDDY_SUPERCLASS_WNDPROC, (HANDLE)baseWndProc);
    487488        }
     
    505506    /* first adjust the buddy to accomodate the up/down */
    506507    SetWindowPos(infoPtr->Buddy, 0, budRect.left, budRect.top,
    507                  budRect.right  - budRect.left, budRect.bottom - budRect.top, 
     508                 budRect.right  - budRect.left, budRect.bottom - budRect.top,
    508509                 SWP_NOACTIVATE|SWP_NOZORDER);
    509510
     
    515516    /*
    516517     * If the updown has a buddy border, it has to overlap with the buddy
    517      * to look as if it is integrated with the buddy control. 
     518     * to look as if it is integrated with the buddy control.
    518519     * We nudge the control or change it size to overlap.
    519520     */
     
    525526    }
    526527
    527     SetWindowPos(infoPtr->Self, infoPtr->Buddy, x, 
    528                  budRect.top - DEFAULT_ADDTOP, width, 
     528    SetWindowPos(infoPtr->Self, infoPtr->Buddy, x,
     529                 budRect.top - DEFAULT_ADDTOP, width,
    529530                 budRect.bottom - budRect.top + DEFAULT_ADDTOP + DEFAULT_ADDBOT,
    530531                 SWP_NOACTIVATE);
    531532
    532533    return TRUE;
    533 }         
     534}
    534535
    535536/***********************************************************************
    536537 *           UPDOWN_DoAction
    537538 *
    538  * This function increments/decrements the CurVal by the 
     539 * This function increments/decrements the CurVal by the
    539540 * 'delta' amount according to the 'action' flag which can be a
    540541 * combination of FLAG_INCR and FLAG_DECR
     
    559560    ni.hdr.hwndFrom = infoPtr->Self;
    560561    ni.hdr.idFrom   = GetWindowLongW (infoPtr->Self, GWL_ID);
    561     ni.hdr.code = UDN_DELTAPOS; 
     562    ni.hdr.code = UDN_DELTAPOS;
    562563    if (!SendMessageW(GetParent (infoPtr->Self), WM_NOTIFY,
    563564                   (WPARAM)ni.hdr.idFrom, (LPARAM)&ni)) {
     
    570571        }
    571572    }
    572  
     573
    573574    /* Also, notify it. This message is sent in any case. */
    574     SendMessageW( GetParent(infoPtr->Self),
    575                   dwStyle & UDS_HORZ ? WM_HSCROLL : WM_VSCROLL,
    576                   MAKELONG(SB_THUMBPOSITION, infoPtr->CurVal), infoPtr->Self);
     575    SendMessageW( GetParent(infoPtr->Self),
     576                  dwStyle & UDS_HORZ ? WM_HSCROLL : WM_VSCROLL,
     577                  MAKELONG(SB_THUMBPOSITION, infoPtr->CurVal),
     578                  (LPARAM)infoPtr->Self);
    577579}
    578580
     
    597599 * Deletes any timers, releases the mouse and does  redraw if necessary.
    598600 * If the control is not in "capture" mode, it does nothing.
    599  * If the control was not in cancel mode, it returns FALSE. 
     601 * If the control was not in cancel mode, it returns FALSE.
    600602 * If the control was in cancel mode, it returns TRUE.
    601603 */
     
    603605{
    604606    if (!(infoPtr->Flags & FLAG_PRESSED)) return FALSE;
    605    
     607
    606608    KillTimer (infoPtr->Self, TIMER_AUTOREPEAT);
    607609    KillTimer (infoPtr->Self, TIMER_ACCEL);
    608610    KillTimer (infoPtr->Self, TIMER_AUTOPRESS);
    609  
     611
    610612    if (GetCapture() == infoPtr->Self) {
    611613        NMHDR hdr;
     
    616618        ReleaseCapture();
    617619    }
    618    
     620
    619621    infoPtr->Flags &= ~FLAG_PRESSED;
    620622    InvalidateRect (infoPtr->Self, NULL, FALSE);
    621  
     623
    622624    return TRUE;
    623625}
     
    628630 * Handle a mouse event for the updown.
    629631 * 'pt' is the location of the mouse event in client or
    630  * windows coordinates. 
    631  */
    632 static void UPDOWN_HandleMouseEvent (UPDOWN_INFO *infoPtr, UINT msg, POINT pt)
     632 * windows coordinates.
     633 */
     634static void UPDOWN_HandleMouseEvent (UPDOWN_INFO *infoPtr, UINT msg, POINTS pts)
    633635{
    634636    DWORD dwStyle = GetWindowLongW (infoPtr->Self, GWL_STYLE);
     637    POINT pt = { pts.x, pts.y };
    635638    RECT rect;
    636639    int temp, arrow;
     
    650653                /* Update the CurVal if necessary */
    651654                if (dwStyle & UDS_SETBUDDYINT) UPDOWN_GetBuddyInt (infoPtr);
    652        
     655
    653656                /* Set up the correct flags */
    654                 infoPtr->Flags |= FLAG_PRESSED; 
    655      
     657                infoPtr->Flags |= FLAG_PRESSED;
     658
    656659                /* repaint the control */
    657660                InvalidateRect (infoPtr->Self, NULL, FALSE);
     
    682685                if(infoPtr->AccelIndex != -1) infoPtr->AccelIndex = 0;
    683686            }
    684            
     687
    685688            /* If state changed, redraw the control */
    686689            if(temp != infoPtr->Flags)
     
    703706    DWORD dwStyle = GetWindowLongW (hwnd, GWL_STYLE);
    704707    int temp;
    705    
     708
    706709    if (!infoPtr && (message != WM_CREATE))
    707         return DefWindowProcW (hwnd, message, wParam, lParam); 
     710        return DefWindowProcW (hwnd, message, wParam, lParam);
    708711
    709712    switch(message)
     
    719722            infoPtr->AccelVect = 0;
    720723            infoPtr->AccelIndex = -1;
    721             infoPtr->CurVal = 0; 
    722             infoPtr->MinVal = 0; 
     724            infoPtr->CurVal = 0;
     725            infoPtr->MinVal = 0;
    723726            infoPtr->MaxVal = 9999;
    724727            infoPtr->Base  = 10; /* Default to base 10  */
     
    729732            if (dwStyle & UDS_AUTOBUDDY)
    730733                UPDOWN_SetBuddy (infoPtr, GetWindow (hwnd, GW_HWNDPREV));
    731        
    732             TRACE("UpDown Ctrl creation, hwnd=%04x\n", hwnd);
    733             break;
    734    
     734
     735            TRACE("UpDown Ctrl creation, hwnd=%p\n", hwnd);
     736            break;
     737
    735738        case WM_DESTROY:
    736739            if(infoPtr->AccelVect) COMCTL32_Free (infoPtr->AccelVect);
     
    740743            COMCTL32_Free (infoPtr);
    741744            SetWindowLongW (hwnd, 0, 0);
    742             TRACE("UpDown Ctrl destruction, hwnd=%04x\n", hwnd);
    743             break;
    744        
     745            TRACE("UpDown Ctrl destruction, hwnd=%p\n", hwnd);
     746            break;
     747
    745748        case WM_ENABLE:
    746749            if (dwStyle & WS_DISABLED) UPDOWN_CancelMode (infoPtr);
     
    774777                temp = infoPtr->AccelIndex == -1 ? 1 : infoPtr->AccelVect[infoPtr->AccelIndex].nInc;
    775778                UPDOWN_DoAction(infoPtr, temp, infoPtr->Flags & FLAG_ARROW);
    776        
     779
    777780                if(infoPtr->AccelIndex != -1 && infoPtr->AccelIndex < infoPtr->AccelCount-1) {
    778781                    KillTimer(hwnd, TIMER_ACCEL);
     
    780783                    temp = infoPtr->AccelVect[infoPtr->AccelIndex].nSec * 1000 + 1;
    781784                    /* make sure we have at least 1ms intervals */
    782                     SetTimer(hwnd, TIMER_ACCEL, temp, 0);           
     785                    SetTimer(hwnd, TIMER_ACCEL, temp, 0);
    783786                }
    784787            }
     
    790793        case WM_LBUTTONUP:
    791794            if (GetCapture() != infoPtr->Self) break;
    792            
     795
    793796            if ( (infoPtr->Flags & FLAG_MOUSEIN) &&
    794797                 (infoPtr->Flags & FLAG_ARROW) ) {
    795                    
    796                 SendMessageW( GetParent(hwnd), 
     798
     799                SendMessageW( GetParent(hwnd),
    797800                              dwStyle & UDS_HORZ ? WM_HSCROLL : WM_VSCROLL,
    798                               MAKELONG(SB_ENDSCROLL, infoPtr->CurVal), hwnd);
     801                              MAKELONG(SB_ENDSCROLL, infoPtr->CurVal),
     802                              (LPARAM)hwnd);
    799803                if (UPDOWN_IsBuddyEdit(infoPtr))
    800804                    SendMessageW(infoPtr->Buddy, EM_SETSEL, 0, MAKELONG(0, -1));
     
    802806            UPDOWN_CancelMode(infoPtr);
    803807            break;
    804      
     808
    805809        case WM_LBUTTONDOWN:
    806810        case WM_MOUSEMOVE:
    807             if(UPDOWN_IsEnabled(infoPtr)){
    808                 POINT pt;
    809                 pt.x = SLOWORD(lParam);
    810                 pt.y = SHIWORD(lParam);
    811                 UPDOWN_HandleMouseEvent (infoPtr, message, pt );
    812             }
     811            if(UPDOWN_IsEnabled(infoPtr))
     812                UPDOWN_HandleMouseEvent (infoPtr, message, MAKEPOINTS(lParam));
    813813            break;
    814814
    815815        case WM_KEYDOWN:
    816             if((dwStyle & UDS_ARROWKEYS) && UPDOWN_IsEnabled(infoPtr)) {
     816            if((dwStyle & UDS_ARROWKEYS) && UPDOWN_IsEnabled(infoPtr))
    817817                return UPDOWN_KeyPressed(infoPtr, (int)wParam);
    818             }
    819             break;
    820      
     818            break;
     819
    821820        case WM_PAINT:
    822821            return UPDOWN_Paint (infoPtr, (HDC)wParam);
    823    
     822
    824823        case UDM_GETACCEL:
    825824            if (wParam==0 && lParam==0) return infoPtr->AccelCount;
     
    829828                return temp;
    830829            }
    831             UNKNOWN_PARAM(UDM_GETACCEL, wParam, lParam);
    832830            return 0;
    833831
    834832        case UDM_SETACCEL:
    835             TRACE("UpDown Ctrl new accel info, hwnd=%04x\n", hwnd);
     833            TRACE("UpDown Ctrl new accel info, hwnd=%p\n", hwnd);
    836834            if(infoPtr->AccelVect) {
    837835                COMCTL32_Free (infoPtr->AccelVect);
     
    846844
    847845        case UDM_GETBASE:
    848             if (wParam || lParam) UNKNOWN_PARAM(UDM_GETBASE, wParam, lParam);
    849846            return infoPtr->Base;
    850847
    851848        case UDM_SETBASE:
    852             TRACE("UpDown Ctrl new base(%d), hwnd=%04x\n", wParam, hwnd);
    853             if ( !(wParam==10 || wParam==16) || lParam)
    854                 UNKNOWN_PARAM(UDM_SETBASE, wParam, lParam);
     849            TRACE("UpDown Ctrl new base(%d), hwnd=%p\n", wParam, hwnd);
    855850            if (wParam==10 || wParam==16) {
    856851                temp = infoPtr->Base;
     
    861856
    862857        case UDM_GETBUDDY:
    863             if (wParam || lParam) UNKNOWN_PARAM(UDM_GETBUDDY, wParam, lParam);
    864             return infoPtr->Buddy;
     858            return (LRESULT)infoPtr->Buddy;
    865859
    866860        case UDM_SETBUDDY:
    867             if (lParam) UNKNOWN_PARAM(UDM_SETBUDDY, wParam, lParam);
    868             temp = infoPtr->Buddy;
    869             UPDOWN_SetBuddy (infoPtr, wParam);
     861            temp = (int)infoPtr->Buddy;
     862            UPDOWN_SetBuddy (infoPtr, (HWND)wParam);
    870863            return temp;
    871864
    872865        case UDM_GETPOS:
    873             if (wParam || lParam) UNKNOWN_PARAM(UDM_GETPOS, wParam, lParam);
    874866            temp = UPDOWN_GetBuddyInt (infoPtr);
    875867            return MAKELONG(infoPtr->CurVal, temp ? 0 : 1);
    876868
    877869        case UDM_SETPOS:
    878             if (wParam || HIWORD(lParam)) UNKNOWN_PARAM(UDM_GETPOS, wParam, lParam);
    879870            temp = SLOWORD(lParam);
    880             TRACE("UpDown Ctrl new value(%d), hwnd=%04x\n", temp, hwnd);
     871            TRACE("UpDown Ctrl new value(%d), hwnd=%p\n", temp, hwnd);
    881872            if(!UPDOWN_InBounds(infoPtr, temp)) {
    882873                if(temp < infoPtr->MinVal) temp = infoPtr->MinVal;
     
    887878            if(dwStyle & UDS_SETBUDDYINT) UPDOWN_SetBuddyInt (infoPtr);
    888879            return wParam;            /* return prev value */
    889      
     880
    890881        case UDM_GETRANGE:
    891             if (wParam || lParam) UNKNOWN_PARAM(UDM_GETRANGE, wParam, lParam);
    892882            return MAKELONG(infoPtr->MaxVal, infoPtr->MinVal);
    893883
    894884        case UDM_SETRANGE:
    895             if (wParam) UNKNOWN_PARAM(UDM_SETRANGE, wParam, lParam);
    896885                                               /* we must have:     */
    897886            infoPtr->MaxVal = SLOWORD(lParam); /* UD_MINVAL <= Max <= UD_MAXVAL */
    898887            infoPtr->MinVal = SHIWORD(lParam); /* UD_MINVAL <= Min <= UD_MAXVAL */
    899888                                               /* |Max-Min| <= UD_MAXVAL        */
    900             TRACE("UpDown Ctrl new range(%d to %d), hwnd=%04x\n",
     889            TRACE("UpDown Ctrl new range(%d to %d), hwnd=%p\n",
    901890                  infoPtr->MinVal, infoPtr->MaxVal, hwnd);
    902             break;                             
     891            break;
    903892
    904893        case UDM_GETRANGE32:
     
    912901            if (infoPtr->MaxVal <= infoPtr->MinVal)
    913902                infoPtr->MaxVal = infoPtr->MinVal + 1;
    914             TRACE("UpDown Ctrl new range(%d to %d), hwnd=%04x\n",
     903            TRACE("UpDown Ctrl new range(%d to %d), hwnd=%p\n",
    915904                  infoPtr->MinVal, infoPtr->MaxVal, hwnd);
    916905            break;
     
    931920
    932921        case UDM_GETUNICODEFORMAT:
    933             if (wParam || lParam) UNKNOWN_PARAM(UDM_GETUNICODEFORMAT, wParam, lParam);
    934922            /* we lie a bit here, we're always using Unicode internally */
    935923            return infoPtr->UnicodeFormat;
    936924
    937925        case UDM_SETUNICODEFORMAT:
    938             if (lParam) UNKNOWN_PARAM(UDM_SETUNICODEFORMAT, wParam, lParam);
    939926            /* do we really need to honour this flag? */
    940927            temp = infoPtr->UnicodeFormat;
    941928            infoPtr->UnicodeFormat = (BOOL)wParam;
    942929            return temp;
    943            
    944         default: 
    945             if (message >= WM_USER)
     930
     931        default:
     932            if ((message >= WM_USER) && (message < WM_APP))
    946933                ERR("unknown msg %04x wp=%04x lp=%08lx\n", message, wParam, lParam);
    947             return DefWindowProcW (hwnd, message, wParam, lParam); 
    948     } 
     934            return DefWindowProcW (hwnd, message, wParam, lParam);
     935    }
    949936
    950937    return 0;
     
    956943 * Registers the updown window class.
    957944 */
    958 
    959 VOID
    960 UPDOWN_Register(void)
     945void UPDOWN_Register(void)
    961946{
    962947    WNDCLASSW wndClass;
     
    970955    wndClass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
    971956    wndClass.lpszClassName = UPDOWN_CLASSW;
    972  
     957
    973958    RegisterClassW( &wndClass );
    974959}
     
    980965 * Unregisters the updown window class.
    981966 */
    982 
    983 VOID
    984 UPDOWN_Unregister (void)
     967void UPDOWN_Unregister (void)
    985968{
    986969    UnregisterClassW (UPDOWN_CLASSW, (HINSTANCE)NULL);
    987970}
    988 
Note: See TracChangeset for help on using the changeset viewer.