3. Adding Scroll Bars

To include a horizontal or vertical scroll bar in your application window, all you need to do is include the window style identifier WS_VSCROLL or WS_HSCROLL or both in the third argument to CreateWindow.

hwnd = CreateWindow (szAppName, // window class name
TEXT ("Horizontal Scroll"), // window caption
WS_OVERLAPPEDWINDOW | WS_HSCROLL, // window style
CW_USEDEFAULT, // initial x position
CW_USEDEFAULT, // initial y position
CW_USEDEFAULT, // initial x size
CW_USEDEFAULT, // initial y size
NULL, // parent window handle
NULL, // window menu handle
hInstance, // program instance
NULL); // creation parameters

 

Prev | Home | Next

Joseph Maratt | CS561 | 4.4.2004