-
Scroll bars don't work?
In my main window i have some button controls and i have this code:
Code:
/* Register the window class, and if it fails quit the program */
if (!RegisterClassEx (&wincl)){
return 0;
}
/* The class is registered, let's create the program*/
hwnd = CreateWindowEx (
0, /* Extended possibilites for variation */
szClassName, /* Classname */
"Example", /* Title Text */
WS_HSCROLL|ES_AUTOHSCROLL, /*window type */
CW_USEDEFAULT, /* Windows decides the position */
CW_USEDEFAULT, /* where the window ends up on the screen */
200, /* The programs width */
600, /* and height in pixels */
NULL, /* The window is not a child*/
NULL, /* No menu */
hThisInstance, /* Program Instance handler */
NULL /* No Window Creation data */
);
But when i test it i see the scroll bar but it doesn't work
Why?
p.s. I'm using code bolcks
-
I'm assuming 'hwnd' is your main window, why attempt to use a scrollbar as the window-type? You'd want to create a separate control (child of main window) for that and doing so still won't make the scrollbar control accessible until it's actually expanded and needed for scrolling. At least, that's how I recall how scrollbars behave.
-
If this is a custom window class (which it appears to be), then you need to actually implement the scrollbar functionality.
Read this for more information.