windows_programming_notes.nbk: Home | Index | Next Page: WM_HSCROLLCLIPBOARD | Previous Page: WM_HOTKEY


 WM_HSCROLL

The WM_HSCROLL message is sent to a window when a scroll event occurs in the window's standard horizontal scroll bar. This message is also sent to the owner of a horizontal scroll bar control when a scroll event occurs in the control.

A window receives this message through its WindowProc function.

Syntax

    LRESULT CALLBACK WindowProc(
      HWND hwnd,       // handle to window
      UINT uMsg,       // WM_HSCROLL
      WPARAM wParam,   // request and position
      LPARAM lParam    // handle to scroll bar (HWND)
    );

Parameters

Return Values

If an application processes this message, it should return zero.

Remarks

The SB_THUMBTRACK request code is typically used by applications that provide feedback as the user drags the scroll box.

If an application scrolls the content of the window, it must also reset the position of the scroll box by using the SetScrollPos function.

Note that the WM_HSCROLL message carries only 16 bits of scroll box position data. Thus, applications that rely solely on WM_HSCROLL (and WM_VSCROLL) for scroll position data have a practical maximum position value of 65,535.

However, because the SetScrollInfo, SetScrollPos, SetScrollRange, GetScrollInfo, GetScrollPos, and GetScrollRange functions support 32-bit scroll bar position data, there is a way to circumvent the 16-bit barrier of the WM_HSCROLL and WM_VSCROLL messages. See GetScrollInfo for a description of the technique.

Requirements


windows_programming_notes.nbk: Home | Index | Next Page: WM_HSCROLLCLIPBOARD | Previous Page: WM_HOTKEY


Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time