Got a minimize button going spare?

I have a toolwindow that DevStudio refuses to put a minimize button on, and I really need one. It has to be a window that doesn't have a button in the main taskbar, which is why it's a toolwindow.

That about sums up the problem..
Do I research owner-draw? Of which I know nothing, or is there another method?

I've rated this a moderate question, ideally I would like a lot of info. If the gods smile on me and someone sends me an entire solution or something close, I'll give out oodles of points and be eternally grateful!
LoggytronicAsked:
Who is Participating?
 
RONSLOWConnect With a Mentor Commented:
What I would try is creating a dummy hidden window and then when you crate the dialog, pass the CWnd* of the hidden window as the parent of the dialog (the optional arg to the CDialog destructor.
0
 
bertpCommented:
My guess is that you might be able to debug through MFC and watch the toolbar frame during creation. Start by looking at CFrameWnd::FloatControlBar and step into it frome there.. If you can debug through it, then you probably can cut and paste to the code to your app and then alter frame's style to have the minimize button..
I don't currently have a copy of vc++ or the vc docs on my home computer so I can't give you anthing more specific right now..

Good luck and have fun!
0
 
Vinayak KumbarSr Program ManagerCommented:
HI,

Interesting....

VinExpert
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
RONSLOWCommented:
Have you tried other methods of removing it from the taskbar (eg. make it popup and the child of a hidden window)?  Or is it essential that is have the toolbar window appearance?

0
 
RONSLOWCommented:
Another thought is to draw your own title bar and draw a minimise button.  Then handle WM_NCHITTEST to return HTMINBUTTON when the mouse is over the minimise button you painted.

See MSJ Jan 1997 C++ Q*A article for info on drawing your own title bar
0
 
LoggytronicAuthor Commented:
Hi ronslow, I'm trying the child of another hidden window idea, although I'm still hitting the same problems. The toolbar appearance is not necessary, so I made it style:Popup, Border:Dialog Frame, and put a minimize button on it. I made a new main window class and I'm creating my dialog within that class. However, I'm still getting it's taskbar button - do I have to do something to specifically make it a child window? There is a style:Child but then it won't let me have a minimize button again!
0
 
LoggytronicAuthor Commented:
Apologies for leaving this so long. I would still appreciate your help. I've just had a few weeks of hell from my university, but I've rejoined life now and would like to continue with this little project... ;)
I seem to remember trying the idea of a dummy window and creating the real dialog as a child, but it still had a taskbar button. I'll be trying it again soon with a different test program.

0
 
LoggytronicAuthor Commented:
Comment accepted as answer
0
 
LoggytronicAuthor Commented:
Ok, it's taken another 10 days to do this but I've got it working - if anyone is still reading this thread!
I ended up doing the hidden parent window idea, but the child window cannot be labeled as a child window in the properties thing. I pass it the pointer of the parent window at creation time. Getting the parent window not to appear was difficult - I couldn't seem to use the SW_HIDE property to do it. So I call child window's DoModal from parent's InitInstance and then call OnOK in parent before ending InitInstance. It complains that the parent's dialogue creation failed but... oh well!! :)
Next I found it minimized to a bar just above the start button so I had to intercept the system command for minimize and do a SW_HIDE instead.
Thanks Ronslow for the idea, I give you the points for it.
0
 
RONSLOWCommented:
Glad you got it working
0
All Courses

From novice to tech pro — start learning today.