Scroll bars don't work?

This is a discussion on Scroll bars don't work? within the Windows Programming forums, part of the Platform Specific Boards category; In my main window i have some button controls and i have this code: Code: /* Register the window class, ...

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

    Question 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

    Vista - Something We all Love to Hate.

  2. #2
    Registered User
    Join Date
    Dec 2006
    Location
    Scranton, Pa
    Posts
    252
    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
    Location
    California
    Posts
    3,263
    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, 11:39 PM
  2. How to activate Control scroll bars ?
    By Frandy in forum Windows Programming
    Replies: 1
    Last Post: 10-21-2004, 06: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21