creating progress bar class

Started by
1 comment, last by synthexp 22 years, 9 months ago
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);
Regards,synthexp
Advertisement

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

thank you very much HTH

the code is now working,

regards
Regards,synthexp

This topic is closed to new replies.

Advertisement