This example shows a very small part of the processing that must be done for a WM_VSCROLL message, which will be sent when a vertical scroll bar has a significant event to notify its owner.

#define INCL_WINSCROLLBARS
#define INCL_WINWINDOWMGR
#include <OS2.H>
#define COUNT 10

HWND   hwndClient;
MPARAM mp2;
ULONG  msg;

switch(msg)
{

case WM_VSCROLL:

 switch (SHORT2FROMMP(mp2))

   case SB_LINEUP:     /*  Sent if the operator      */
                                /*  clicks on the up arrow    */
                                /*  of the scroll bar, or     */
                                /*  presses the VK_UP key. */

        WinScrollWindow(hwndClient,
                        0,
                        (LONG)20,  /* vertical scroll */
                        (PRECTL)NULL,
                        (PRECTL)NULL,
                        (HRGN)NULLHANDLE,
                        (PRECTL)NULL,
                        0);
                break;
                        .
                        .
                        .

break;
}


[Back] [Next]