Solved

Got a minimize button going spare?

Posted on 2000-04-14
10
193 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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

16 Experts available now in Live!

Get 1:1 Help Now