Statusbars in dialog based application
-
I am new to WTL and was wondering if I could use a status bar in my applicatin. I've noticed that some of the examples (by Ed Gadziemski and Michael Dunn) use CreateSimpleStatusBar() which is only available if i derive my main form from CFrameWindowImpl. But my application is based on Dialogs and derives from CAxDialogImpl (I'm using ActiveX). Here i cannot call CreateSimpleStatusBar() and dont have the member variable m_hWndStatusBar which gets initialized by CreateSimpleStatusBar(). How do i use CMultiPaneStatusBarCtrl here? Any pointers will be helpful. Thankx in advance. -Tareq
-
I am new to WTL and was wondering if I could use a status bar in my applicatin. I've noticed that some of the examples (by Ed Gadziemski and Michael Dunn) use CreateSimpleStatusBar() which is only available if i derive my main form from CFrameWindowImpl. But my application is based on Dialogs and derives from CAxDialogImpl (I'm using ActiveX). Here i cannot call CreateSimpleStatusBar() and dont have the member variable m_hWndStatusBar which gets initialized by CreateSimpleStatusBar(). How do i use CMultiPaneStatusBarCtrl here? Any pointers will be helpful. Thankx in advance. -Tareq
still no reply ... so replying to myself :( ... i've tried to manually create the statusbar using CreateWindowEx and CStatusBarCtrl but no hope. the function succeedes but there is no statusbar visible. i've also tried to use ShowWindow on the statusbar but no hope. No errors reported. Plz help meeee. -Tareq
-
still no reply ... so replying to myself :( ... i've tried to manually create the statusbar using CreateWindowEx and CStatusBarCtrl but no hope. the function succeedes but there is no statusbar visible. i've also tried to use ShowWindow on the statusbar but no hope. No errors reported. Plz help meeee. -Tareq
Sometimes it's easier to use the Win32 api... eg.
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { hSTMode = ::CreateWindowEx(0L, STATUSCLASSNAME, _T("Full Auto"), WS_CHILD, 0, 0, 0, 0, m_hWnd, (HMENU)IDC_MODE_DISPLAY, _Module.GetResourceInstance(), NULL); }
where hSTMode is an HWND and m_hWnd is the parent window (eg. CWindow) This will create the window if you have a corresponding message handler. You then need to send SB_SETPARTS to hSTMode which will fill in the window with rects and stuff. See the MSDN documentation under common controls for an example. Ryan