Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Scroll Bar

bodhi2016bodhi2016 Member Posts: 50
PLzzz can explin the use of parameters "wparam" and "lparam".
Whemn i am making a scroll bar in the client area
[code]case WM_SIZE:
cyClient = HIWORD (lParam) ;
return 0 ;

case WM_VSCROLL:
switch (LOWORD (wParam))
{
case SB_LINEUP:
iVscrollPos -= 1 ;
break ;

case SB_LINEDOWN:
iVscrollPos += 1 ;
break ;

case SB_PAGEUP:
iVscrollPos -= cyClient / cyChar ;
break ;

case SB_PAGEDOWN:
iVscrollPos += cyClient / cyChar ;
break ;

case SB_THUMBPOSITION:
iVscrollPos = HIWORD (wParam) ;
break ;

default :
break ;[/code]
The only thing i didnt understand was the use of these lines
[code] cyClient = HIWORD (lParam)[/code]
[code] switch (LOWORD (wParam))[/code]
[code]iVscrollPos = HIWORD (wParam) [/code]
My main point what is the use of wparam and lparam.Plzzzzz somebody explain

Comments

  • MT2002MT2002 Member Posts: 1,444
    This is where MSDN is useful for a reference.

    LOWORD and HIWORD macros are used to return the low and high words of its (Should be dword-sized) parameter.

    MSDN states that the WM_SIZE notification passes the size type in wParam, and the new width and height in lParam.

    wParam can be one of the following:

    [code]
    SIZE_MAXHIDE SIZE_MAXIMIZED
    SIZE_MAXSHOW SIZE_MINIMIZED
    SIZE_RESTORED[/code]

    lParam is a 32 bit value with the format:

    low word: new width of client area
    high word: new height of client area

    In your WM_VSCROLL message:

    wParam is of the following format:

    high word: current position of the scroll box if its low word is SB_THUMBPOSITION or SB_THUMBTRACK, else 0.

    low word: Scrolling request. Can be one of the following:

    [code]
    SB_BOTTOM SB_ENDSCROLL
    SB_LINEDOWN SB_LINEUP
    SB_PAGEDOWN SB_PAGEUP
    SB_THUMBPOSITION SB_THUMBTRACK
    SB_STOP[/code]

    lParam - Not directly used. See MSDN for details.

    Last but not least--please use proper language, no slang or 1337-sp34k. i.e., Dont use "Plezzzzzz", instead use "Please". It makes your post look alot nicer and easier to read.

    [hr][size=1][leftbr].:EvolutionEngine[rightbr][leftbr].:MicroOS Operating System[rightbr][leftbr][link=http://www.brokenthorn.com]Website :: OS Development Series[rightbr][/link][/size]
Sign In or Register to comment.