Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Confusing Minimize button behavior

57 views
Skip to first unread message

jc

unread,
May 30, 2010, 3:00:01 AM5/30/10
to
Hello,

We added minimize and maximize buttons to our dialog based
application. However, when we click the minimize button,
the application minimizes to a small "title bar" application
at the bottom left corner of the desktop (just above the taskbar).

How do we get the application to minimize to the taskbar icon
that is visible?

TIA
-jc

David Lowndes

unread,
May 30, 2010, 8:22:13 AM5/30/10
to

You don't have to do anything special to get the default behaviour of
minimizing to the task bar. If you try adding a minimize button to a
default dialog application it should work as you'd hope it would. I
wonder if you're incorrectly handing some Windows message and that's
giving rise to what you're seeing.

Dave

David Ching

unread,
May 30, 2010, 2:25:09 PM5/30/10
to
"jc" <j...@discussions.microsoft.com> wrote in message
news:C8F14F99-2968-4A11...@microsoft.com...

> Hello,
>
> We added minimize and maximize buttons to our dialog based
> application. However, when we click the minimize button,
> the application minimizes to a small "title bar" application
> at the bottom left corner of the desktop (just above the taskbar).
>

It sounds like you have created an MDI app that is maximized, and when you
minimize one of its MDI windows, it shows a mini title bar at the lower left
corner of your app window (which being maximized, is right above the Windows
taskbar).

Could this be what happened?

-- David

Joseph M. Newcomer

unread,
May 30, 2010, 9:14:07 PM5/30/10
to
I the dialog style set to "popup"? This would be wrong; it should be set to "Overlapped".
And it must NOT be set to "child".
joe

Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

jc

unread,
May 31, 2010, 4:08:01 PM5/31/10
to

Hello,

Thank you for taking the time to reply my posting.

Yes, the dialog style was set to "popup", but changing the style
to "overlapped" did not fix the problem.

As such, we decided to minimize the application to the System Tray. The
System Tray icon is working OK (both opening and minimizing the application).
But, the task bar icon is always visible. even when the icon is in the
System Tray.

How do we hide and show the taskbar icon?

TIA,
-jc

David Ching

unread,
May 31, 2010, 6:32:42 PM5/31/10
to
"jc" <j...@discussions.microsoft.com> wrote in message
news:B1291FC5-3F6E-44E0...@microsoft.com...

> But, the task bar icon is always visible. even when the icon is in the
> System Tray.
>
> How do we hide and show the taskbar icon?
>

Set the WS_EX_TOOLWINDOW style.

-- David

jc

unread,
Jun 1, 2010, 4:39:01 AM6/1/10
to
Hello David,

Thank you for taking the time to reply to my posting.

Yes, setting the window style to WS_EX_TOOLWINDOW
removed the taskbar icon; however, we can dynamically
restore the taskbar icon (when the window opens).

hide:
ModifyStyleEx(WS_EX_APPWINDOW, WS_EX_TOOLWINDOW);

show:
ModifyStyleEx(WS_EX_APPWINDOW, ~WS_EX_TOOLWINDOW);

How can we dynamically hide/show the taskbar icon?

TIA,
-jc

David Ching

unread,
Jun 1, 2010, 10:24:49 AM6/1/10
to
"jc" <j...@discussions.microsoft.com> wrote in message
news:2E32E090-BF9E-4DBB...@microsoft.com...

Sorry, I don't understand. You say ModifyStyleEx() allows you to
dynamically hide and show the taskbar icon, yet you ask how to do that?
Does ModifyStyleEx() work or not?

Thanks,
David

Tom Serface

unread,
Jun 1, 2010, 12:28:38 PM6/1/10
to
You could try PJ's class CSystemTray. It has a HideIcon() function that
makes this really easy.

http://www.naughter.com/ntray.html

Or if you want to do it yourself you can make a call to Shell_NotifyIcon:

http://msdn.microsoft.com/en-us/library/bb762159(VS.85).aspx

Tom

"jc" <j...@discussions.microsoft.com> wrote in message

news:2E32E090-BF9E-4DBB...@microsoft.com...

0 new messages