Archived

This topic is now archived and is closed to further replies.

creating progress bar class

This topic is 6019 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

greetings all i''ve been a little application over the past week and i''ve stumped over something. my app is dialog based and i want to create 2 progress bar from within the dialog. I hope it is possible to do so. could somebody pls tell me whether the code snippets below conforms or there is a mistake. The code compiled and linked fine but i couldn''t get the progress window handlers to work. I tested the progress window handlers for NULL condition but failed which means they were initialized. m_hWndPBCurrent & m_hWndPBOverall are the two progress window handlers and fn GetHDLG () returns parent window which is the dialog window handler. My suspicion is the parameter for parent window for the createwindowex fn, the one with GetDlgItem (..,..) which supposed to return the window handler associated with the resource identifier. I would welcome any help. Thank you for reading. this is my first posting ----------------------------------------------------------------- INITCOMMONCONTROLSEX InitCtrl = { sizeof (INITCOMMONCONTROLSEX), ICC_PROGRESS_CLASS | ICC_WIN95_CLASSES }; InitCommonControlsEx (&InitCtrl); m_hWndPBCurrent = CreateWindowEx (0, PROGRESS_CLASS, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, GetDlgItem (GetHDLG (), IDC_PRGCURRENT), NULL, NULL, NULL); m_hWndPBOverall = CreateWindowEx (0, PROGRESS_CLASS, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, GetDlgItem (GetHDLG (), IDC_PRGOVERALL), NULL, NULL, NULL);

Share this post


Link to post
Share on other sites
Guest Anonymous Poster

If you have dragged a progress control onto your dialog, there is no need to create the control dynamically like you are.

You just need to handle PBM_ messages in your dialogs window proc.

If you are trying to dynamically create the progress controls, then the parameter to CreateWindowEx that is for the parent should be the window handle of the dialog. You will still need to handle PBM_ messages in your dialogs window proc.

HTH,

-Z

Share this post


Link to post
Share on other sites