Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Got a minimize button going spare?

Posted on 2000-04-14
10
Medium Priority
?
201 Views
Last Modified: 2013-11-20
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!
0
Comment
Question by:Loggytronic
10 Comments
 

Expert Comment

by:bertp
ID: 2719753
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
 
LVL 8

Expert Comment

by:Vinayak Kumbar
ID: 2719976
HI,

Interesting....

VinExpert
0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 2721304
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 10

Expert Comment

by:RONSLOW
ID: 2721315
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
 

Author Comment

by:Loggytronic
ID: 2723916
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
 
LVL 10

Accepted Solution

by:
RONSLOW earned 200 total points
ID: 2724986
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
 

Author Comment

by:Loggytronic
ID: 2815373
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
 

Author Comment

by:Loggytronic
ID: 2854505
Comment accepted as answer
0
 

Author Comment

by:Loggytronic
ID: 2854506
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
 
LVL 10

Expert Comment

by:RONSLOW
ID: 2855317
Glad you got it working
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question