Getting state of Dialog objects

This is a discussion on Getting state of Dialog objects within the C++ Programming forums, part of the General Programming Boards category; How can I get the state of check/radio boxes in dialogs??? I know I can use GetDlgItemText() (i think) for ...

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    18

    Getting state of Dialog objects

    How can I get the state of check/radio boxes in dialogs???
    I know I can use GetDlgItemText() (i think) for the caption/text, but I dunno what to use for the state.

    Also, does anyone know a good site with tutorials on how to use controls in win32 programming??

    Thanks

    EDIT: Almost forgot, I have a small dialog based app. The dialog was created using the resource editor. How can I set the Min/Max/Current Value for a Progress Bar control?? I was thinking about SendMessage but I don't know how to get the hWnd of the Bar... Please Help
    Last edited by void; 10-16-2002 at 10:17 PM.
    ~void

  2. #2
    Seeking motivation... endo's Avatar
    Join Date
    May 2002
    Posts
    537
    Couldn't think of anything interesting, cool or funny - sorry.

  3. #3
    Registered User
    Join Date
    Oct 2002
    Posts
    18
    Thanks, that really helped.
    One thing though... how can I get like, the hwnd of a progress bar created in a resource??? Otherwise I can't use SendMessage() to edit it...

    Thanks for the help
    ~void

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    Originally posted by void
    Thanks, that really helped.
    One thing though... how can I get like, the hwnd of a progress bar created in a resource??? Otherwise I can't use SendMessage() to edit it...

    Thanks for the help
    You kbnow the resource ID assigned by the resource editor (IDC_PROGRESS.....or whatever it is), then just use GetDlgItem()

  5. #5
    Registered User
    Join Date
    Oct 2002
    Posts
    18
    kbnow?? blah I suck at this.. what do you mean by that?? ;\
    ~void

  6. #6
    btq
    btq is offline
    julie lexx... btq's Avatar
    Join Date
    Jun 2002
    Posts
    161
    I think he just meant 'know'..
    although I'm not saying I know..
    /btq
    ...viewlexx - julie lexx

  7. #7
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    Originally posted by void
    kbnow?? blah I suck at this.. what do you mean by that?? ;\
    Sorry....I was eating a doughnut and typing with 1 finger....I meant "know"....


  8. #8
    Registered User
    Join Date
    Oct 2002
    Posts
    18
    rofl
    ~void

  9. #9
    Registered User
    Join Date
    Oct 2002
    Posts
    18
    Hmm.. I tried:

    SendMessage(GetDlgItem(hWnd,IDPB),PBM_SETPOS,0,50) ;

    but it doesn't seem to work :<.. help a newbie with this basic stuff and he'll never bother you again
    ~void

  10. #10
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    Originally posted by void
    Hmm.. I tried:

    SendMessage(GetDlgItem(hWnd,IDPB),PBM_SETPOS,0,50) ;

    but it doesn't seem to work :<.. help a newbie with this basic stuff and he'll never bother you again
    I dont prefer to nest API calls like that.......Assign GetDlgItem to a HWND and check if its NULL before sending the message

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 02-13-2008, 01:59 PM
  2. input/switch statement issues
    By peanut in forum C Programming
    Replies: 5
    Last Post: 10-27-2006, 02:58 PM
  3. NAQ: Everything you never wanted to know about CPP
    By evildave in forum C Programming
    Replies: 21
    Last Post: 12-12-2005, 09:56 AM
  4. Getting Key state in Dialog based app
    By Unregistered in forum Windows Programming
    Replies: 21
    Last Post: 07-19-2002, 08:05 AM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM

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