473,385 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Info with system tray apps

I successfully made a system tray application.
When I do shut down the computer, how does the computer can instruct my
application to shut down?
For the moment, if I don't quit my application, system asks to kill an
unresponsive task before shut sown.
How does I make shut down run more correctly?

Thank you
Nicolas Poirier

Nov 9 '05 #1
3 6589
On Wed, 9 Nov 2005 18:08:18 -0500, "Nicolas Poirier"
<ni***********@tlb.sympatico.ca> wrote:
I successfully made a system tray application.
When I do shut down the computer, how does the computer can instruct my
application to shut down?
For the moment, if I don't quit my application, system asks to kill an
unresponsive task before shut sown.
How does I make shut down run more correctly?

Thank you
Nicolas Poirier

Are you cancelling your program's shut down in any way ? Perhaps in
QueryUnlaod ?
If so, make sure that you trap the system shutdown. Look in the help
file for the UnloadMode passed into that event and it's meanings.
You should yield when the request comes from task manager and system
shut down; clean up, unload all your Forms, trayicon, objects, timers,
etc.. and finally your main form.

--

Regards, Frank
Nov 9 '05 #2

"Nicolas Poirier" <ni***********@tlb.sympatico.ca> wrote in message
news:Ej********************@news20.bellglobal.com. ..
I successfully made a system tray application.
When I do shut down the computer, how does the computer can instruct my
application to shut down?
For the moment, if I don't quit my application, system asks to kill an
unresponsive task before shut sown.
How does I make shut down run more correctly?

Unless there's something weird going on with your app, it should just
normally upon Windows shutting down. There's something "not right" about
your app that's preventing it from properly closing. Perhaps it has to do
with having added an icon to the system tray. You're not using WM_MOUSEMOVE
as the callback message (which is a hack), are you? Is your main form the
form used to add the icon to the system tray (IOW, the form used to specify
the hwnd of the NOTIFYICONDATA structure)?

You most likely need to post your code on how you're adding an icon to the
system tray as well as your shutdown code. That way, we can see exactly
what you're doing.

--
Mike
Microsoft MVP Visual Basic
Nov 10 '05 #3
"Nicolas Poirier" <ni***********@tlb.sympatico.ca> wrote in message
news:Ej********************@news20.bellglobal.com. ..
I successfully made a system tray application.
When I do shut down the computer, how does the computer can instruct my
application to shut down?
For the moment, if I don't quit my application, system asks to kill an
unresponsive task before shut sown.
How does I make shut down run more correctly?

Thank you
Nicolas Poirier


'If you have something like this in one of your forms.....
'=======
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Cancel = True
Me.Hide
End Sub
'=======

'Change that to:
'=======
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbFormControlMenu Then
Cancel = True
Me.Hide
End If
End Sub
'=======

So it only cancels the unload if the user clicks the close button or menu.
The OS can still shut it down.

--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
Please keep all discussions in the groups..
Nov 10 '05 #4

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

Similar topics

9
by: none | last post by:
Hello all, I wrote a shell program a few years ago in VB6 that needs to be modified. The problem I have is this: The SysAdmin uses this shell in place of Explorer, so there is no taskbar. When...
1
by: balu | last post by:
Hello , I Had a problem in developing a application for getting a message over or above system tray . When we first logon into the yahoo messenger , whenever a new user logon ,The messenger...
0
by: Nicolas Poirier | last post by:
I successfully made a system tray application. When I do shut down the computer, how does the computer can instruct my application to shut down? For the moment, if I don't quit my application,...
4
by: Tom | last post by:
Hello, System tray icon informs users that the apps is running in the background. However, there are instances that the app might crash and after that the app icon in the system tray is still...
10
by: Crouchie1998 | last post by:
Hello To All You Real Programmers Out There!! There is an application called: "Tray It" Webpage: ---------- http://www.teamcti.com/trayit/trayit.htm Direct Download:
0
by: nick.spacek | last post by:
Hi everyone, I'm wondering if anyone knows how to tell if a process has an icon in the system tray? And for that matter, the taskbar as well? Currently I'm just finding out what apps have a...
2
by: s.storrow | last post by:
I'm trying to write a piece of software in C++ which will display a clock in the windows system tray. I am able to create icons there, but i am not sure whether it is possible to write text there,...
3
by: Patrick Dugan | last post by:
I am using VS2005 (vb) and I have a program that starts when Windows boots up. Occasionally the icon that should appear in the system tray does not show up. The program is still running in memory...
3
by: Usman Jamil | last post by:
Hi I've a windows application that does a lengthy backup process. While the process is going on, I need to show a progress bar inside system tray or just above the system tray. Can someone...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...

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.