Solved

Got a minimize button going spare?

Posted on 2000-04-14
10
197 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.

756 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