Is there a way to place the progress bar inside the status bar without using MFC classes, just plain simple API?
thank you.
Is there a way to place the progress bar inside the status bar without using MFC classes, just plain simple API?
thank you.
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
CreateStatusBar gives you a window handle, so create a progress bar child window and place it inside one of your parts. I don't know of any specialized api calls to do it.
If I'm not mistaken, CreateStatusBar is a part of some sort of class...
Last edited by Devil Panther; 07-18-2005 at 01:22 PM.
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
oops, meant CreateStatusWindow
What I use is the next:MSDN: This function is obsolete. Use CreateWindow instead.
But is there a simple way to do this, like getting the sub handle of the StatusBar's second part and then create it directly inside there. Or is this the only way.Code:int iBarWidths[] = {120, 285, -1}; static HWND StatusBar, hProgressBar; /* Creating a Status Bar */ hStatusBar = CreateWindowEx(NULL, STATUSCLASSNAME, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hwnd, (HMENU)IDD_STATUSBAR, hInst, NULL); SendMessage(hStatusBar, SB_SETPARTS, 3, (LPARAM) iBarWidths); SendMessage(hStatusBar, SB_SETTEXT, 0, (LPARAM) "some text 1"); SendMessage(hStatusBar, SB_SETTEXT, 2, (LPARAM) "some text 2"); /* Creating and place the Progress Bar inside the StatusBar */ hProgressBar = CreateWindowEx(NULL, "msctls_progress32", NULL, WS_CHILD | WS_VISIBLE, 122,2,163,18, hStatusBar, (HMENU)IDD_PROGRESS, hInst, NULL); SendMessage(hProgressBar, PBM_SETSTEP, (WPARAM)5, 0);
Last edited by Devil Panther; 07-18-2005 at 01:25 PM.
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
I assume the parts are windows, though I'm not positive, you will always know where your second part is, so you could try WindowFromPoint to get a handle to it
Though I'm not sure this would make it easier than just making it a child window and positioning it in your parts
Last edited by valis; 07-18-2005 at 01:48 PM.
But that's exactly what it is right now... a child window of the statusbar control
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
yup I believe your stuck with that, if you're not already, SB_GETRECT might make it easier
What can I do with it, does it return a handle or something like that?SB_GETRECT
wParam = (WPARAM) iPart;
lParam = (LPARAM) (LPRECT) lprc;
Retrieves the bounding rectangle of a part in a status window.
Returns TRUE if successful, or FALSE otherwise.
iPart
Zero-based index of the part whose bounding rectangle is to be retrieved.
lprc
Address of a RECT structure that receives the bounding rectangle.
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.