C++ MFC

Moderators: Lundin
Number of threads: 3337
Number of posts: 9005

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
TaskBar Posted by DB1 on 19 Jan 2004 at 4:35 AM
I've made a MFC dialog app with no border and title bar (no minimize maximize & close buttons). I use "SetWindowText" so that I have a taskbar button with the title, but when you right-click on the taskbar button, there is no options pop-up. Is there a way to have at least a minimize/maximize option added to the taskbar button without adding a title bar to the application?

Thanks :)



To understand recursive, first you need to understand recursive
Report
Re: TaskBar Posted by DB1 on 29 Jan 2004 at 3:19 PM
: I've made a MFC dialog app with no border and title bar (no minimize maximize & close buttons). I use "SetWindowText" so that I have a taskbar button with the title, but when you right-click on the taskbar button, there is no options pop-up. Is there a way to have at least a minimize/maximize option added to the taskbar button without adding a title bar to the application?
:
: Thanks :)
:


If anyone wants to know the answer, I was looking through a .rc file for another project and came up with this...

When you have a dialog that has no title bar or system menu (such as a custom draw bitmap dialog), all you end up with for a taskbar button is a blank button that does nothing except bring a window into focus. So, just 2 lines of code seem to resolve the issue:

SetWindowText("My Application"); // sets the taskbar button text

ModifyStyle( 0, WS_MINIMIZEBOX | WS_SYSMENU );

The WS_MINIMIZEBOX style sets it so that clicking on the taskbar button will minimize/restore the application, and the WS_SYSMENU style sets it so that 1) your application icon shows up on the taskbar button and 2) there is a right-click system menu on the taskbar button.

Hope someone else finds this useful.

To understand recursive, first you need to understand recursive




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.