Solved

Got a minimize button going spare?

Posted on 2000-04-14
10
194 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:VinExpert
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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 10

Accepted Solution

by:
RONSLOW earned 100 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Running shell command from Access 3 68
Add content to output file 4 62
maxBlock challenge 30 111
while loop over for loop 7 92
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

914 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now