Thread: Scroll bars don't work?

  1. #1
    Registered User kakayoma's Avatar
    Join Date
    Jul 2009
    Dallas, Texas

    Question Scroll bars don't work?

    In my main window i have some button controls and i have this 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


    p.s. I'm using code bolcks

    Vista - Something We all Love to Hate.

  2. #2
    Registered User
    Join Date
    Dec 2006
    Scranton, Pa
    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.

  3. #3
    Registered User
    Join Date
    Sep 2004
    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.
    bit∙hub [bit-huhb] n. A source and destination for information.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why don't the tutorials on this site work on my computer?
    By jsrig88 in forum C++ Programming
    Replies: 3
    Last Post: 05-15-2006, 10:39 PM
  2. How to activate Control scroll bars ?
    By Frandy in forum Windows Programming
    Replies: 1
    Last Post: 10-21-2004, 05:21 AM
  3. Scroll bars.......
    By incognito in forum Windows Programming
    Replies: 5
    Last Post: 01-11-2004, 07:57 AM
  4. Scroll Bars
    By incognito in forum Windows Programming
    Replies: 1
    Last Post: 01-06-2004, 09:15 PM
  5. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 12:39 PM