473,748 Members | 7,608 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Force Minimize to taskbar

Hi,

My VC++ application does not have a titlebar (and therefore no System menu,
no minimize, no maximize
and no close button). We have a custom button for minimize and close.

When the app is in normal/maximized view, clickinng on the taskbar entry
does not minimize the
application. Normally (with apps with titlebar), the application would
minimize when you click on
the taskbar entry.

How do I trap the click event on the taskbar entry so I can minimize the
application?

Thanks for any help.

Nov 17 '05 #1
3 4960
"Maka Sili" <ma******@hotma il.com> wrote in message
news:OM******** ******@TK2MSFTN GP12.phx.gbl...
My VC++ application does not have a titlebar (and therefore no System
menu,
no minimize, no maximize and no close button). We have a custom button
for minimize and close.
...
How do I trap the click event on the taskbar entry so I can minimize the
application?


The shell provides a single function for adding, modifying and updating the
icons in the tray. It is documented here:

http://msdn.microsoft.com/library/de...notifyicon.asp

VC++ v6.0 comes with (or is it the SDK that comes with?) a sample named
TRAYNOT, which demonstrates this "tray notification icon" stuff.

http://msdn.microsoft.com/library/de...smptraynot.asp

Note two important things: Before you put up a context menu in response to a
click on such an icon of yours make sure that a window of yours is in the
foreground - i.e. call SetForegroundWi ndow(). In addition make sure you send
that Window a WM_NULL message when you take the menu down.

Regards,
Will
Nov 17 '05 #2
I already have the function/menu in the system tray (no problem there).
The problem is in the taskbar entry (not icon): taskbar entry meaning one
of those list of running/active applications that you can "Alt-Tab" to.

Problem is "when the application is in the foreground and in normal view,
clicking on that "active application's entry in the taskbar" does not
minimize
the application. Supposedly, it should, just like if you minimize this
news readers window by clicking on the taskbar on the entry with caption
"Re: Force Minimize to..." or something like that.

"William DePalo [MVP VC++]" <wi***********@ mvps.org> wrote in message
news:ue******** ******@TK2MSFTN GP15.phx.gbl...
"Maka Sili" <ma******@hotma il.com> wrote in message
news:OM******** ******@TK2MSFTN GP12.phx.gbl...
My VC++ application does not have a titlebar (and therefore no System
menu,
no minimize, no maximize and no close button). We have a custom button
for minimize and close.
...
How do I trap the click event on the taskbar entry so I can minimize the
application?


The shell provides a single function for adding, modifying and updating
the icons in the tray. It is documented here:

http://msdn.microsoft.com/library/de...notifyicon.asp

VC++ v6.0 comes with (or is it the SDK that comes with?) a sample named
TRAYNOT, which demonstrates this "tray notification icon" stuff.

http://msdn.microsoft.com/library/de...smptraynot.asp

Note two important things: Before you put up a context menu in response to
a click on such an icon of yours make sure that a window of yours is in
the foreground - i.e. call SetForegroundWi ndow(). In addition make sure
you send that Window a WM_NULL message when you take the menu down.

Regards,
Will

Nov 17 '05 #3
"Maka Sili" <ma******@hotma il.com> wrote in message
news:et******** ******@TK2MSFTN GP15.phx.gbl...
I already have the function/menu in the system tray (no problem there).
The problem is in the taskbar entry (not icon): taskbar entry meaning one
of those list of running/active applications that you can "Alt-Tab" to.
Problem is "when the application is in the foreground and in normal view,
clicking on that "active application's entry in the taskbar" does not
minimize
the application. Supposedly, it should, just like if you minimize this
news readers window by clicking on the taskbar on the entry with caption
"Re: Force Minimize to..." or something like that.


The shell sends a WM_SYSCOMMAND with the SC_MINIMIZE flag when you choose
that menu option, no? But it _does_ not know that you'd prefer to minimize
to a tray icon so you have to add a handler for that message, and in it
potentially hide your "main" window and insert the tray icon if it is not
already there.

Just by the way, some tray applications forego the "button" in the taskbar
altogether. If you don't want to do that you can stop reading here.
Otherwise note to do that there are a few options:

1) Hide your main (unowned) window and display your UI in
another window which is a child of the hidden main window

2) Give the (visible) main window the WS_EX_TOOLWINDO W style.
A side effect here is a more squat caption.

3) Use the shell's ITaskBarList interface

Regards,
Will
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
6428
by: kurotsuke | last post by:
How can I hide a Form (instead of having it reduced to the taskbar) when the minimize button is pressed in C# (there's an icon in the tray bar)? I added the code protected override void OnResize(EventArgs e) { //hide the form if (this.WindowState==FormWindowState.Minimized)
0
1408
by: Víctor | last post by:
It's possible minimize windows taskbar? I can hide it, but I haven't found a way to minimize or move. I tried by using API SetWindowPos, but do nothing, and when I maximize application windows, hollow where Taskbar was, appears void. Thanks. Víctor.
2
10601
by: Nikki | last post by:
Hi, I m working on a windows application using c#.NET. Using borderless non-rectangular forms. Can anybody tell me how to minimize / restore that application from taskbar. (I m already using Notify Icon ) but also want the functionality from taskbar. Thanks, Nikki
4
4096
by: steve | last post by:
hi all, i was wondering how is it possible to add an extra box ( i think they are called boxes: upper right corner ...) in a form that will minimize it in the system tray? You know some applications have a 4th one (apart from the square , bar and X ) which contains a dot and once u click it minimizes the application to the tray. TIA
1
2853
by: zakhirn | last post by:
Anyone have code that creates a button that will Minimize Excel to the system tray. I do not need anything complicated like changing the minimize button or the close button to a minimize to tray button. I have a Form that pops up when excel loads, and I will add a command button called Minimize that I just want to minimize excel to the system tray.
3
5795
by: philelpko | last post by:
Morning all, 2 questions...... I have disabled the control boxes, minimize/maximize, resize etc on my forms so users cannot do anything other than what the forms allow. The problem is that despite the controls being disabled in access, each form appear as a separate tab on the taskbar which can be minimized / maximized / closed (on right click). Naturally this is a problem as it reduces my ability to make the database idiot proof.so.... ...
4
7210
by: Hutch | last post by:
I also un-checked all of the check boxes in the database's Startup options menu. I then added a button to the form so that the user can close the database, and another button so that the form can minimized. I made the minimize button so that when it was used, something would show-up on the taskbar and not on the desktop (above the Start button). I figured the users would get confused when they had multiple windows open and couldn't find the...
3
14286
by: Jimmy | last post by:
I'm kinda newbie to python and wxPython. Now I'm confronting a thorny problem: how can I make my program minimize to the taskbar represented as an ico, and when there is some message from network coming, it will pop out?
2
10056
by: devendraagashe | last post by:
I am developing java awt frame application. When i click on the minimize button, the icon is displayed in taskbar. but i want it not to display on taskbar, but it should go to system tray from which i can again open it. But it should not display on taskbar. can anyone please help me to solve this problem? devendra.agashe@patni.com
0
8989
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9537
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9367
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8241
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4599
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3309
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2213
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.