473,796 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6623
On Wed, 9 Nov 2005 18:08:18 -0500, "Nicolas Poirier"
<ni***********@ tlb.sympatico.c a> 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.c a> wrote in message
news:Ej******** ************@ne ws20.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.c a> wrote in message
news:Ej******** ************@ne ws20.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_QueryUnloa d(Cancel As Integer, UnloadMode As Integer)
Cancel = True
Me.Hide
End Sub
'=======

'Change that to:
'=======
Private Sub Form_QueryUnloa d(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbFormControlMe nu 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
6965
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 his users run PC Anywhere from the shell, and minimize it, it minimizes to the system tray. With no task bar, there is no system tray, so there is no way to restore the PC Anywhere window. The shell starts PC Anywhere using ShellExecute. I...
1
482
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 will shows message above the system tray. for example " balu comes is on online " above system tray . whenever a new user logout ,The messenger will shows message above the
0
1451
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, system asks to kill an unresponsive task before shut sown. How does I make shut down run more correctly? Thank you Nicolas Poirier
4
5663
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 displayed. It goes away when the mouse is pointed over the icon. I wonder if there is any way to force system tray refresh during the VB.NET app crash? I tried to add some code in the finalize but it didn't do anything. I think
10
3142
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
1001
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 MainWindowHandle but not all of those show in the taskbar always. Thanks Nick
2
3298
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, similar to how the windows clock works. I have seen various freeware apps which do this so i assume there must be a method, but i am having difficulty locating information on how to code it. Any help would be much appreciated.
3
7943
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 but the tray icon is not there. If I start the program after Windows has booted up the icon shows every time. I am assuming that the reason is due to the icon being created before the system tray is loaded/running. I have used a timer with...
3
3323
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 please guide me how to show the progress bar out of the boundaries of the application form area and near the system tray. Regards Usman
0
9680
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
9528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10174
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10012
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7548
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6788
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
5575
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2926
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.