Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Notify icon not calling back

Status
Not open for further replies.

BasicBoy

Programmer
Feb 22, 2008
156
ZA
I have used the Mictrosoft procedure to put an icon in the system tray : However, when I minimise the form, the popup menu does not appear when I move my mouse over the tray icon. Also it does not restore the form when I click the icon - the mousemove event or callback is apparently not fired.
Any help will be appreciated.
Thanks
 
That code, as given, works fine. So ... have you made any chages? And if so you'll need to show us your code before we can begin to help
 
I have not made any changes, but I suspect certain form properties might have to be changed. When I minimise the form,it fires the mousemove event, but not again when I move the mouse over the icon. And I do not know why the popup menu does not appear when I right click - might it not be some setting on the system tray.
 
I have happily used this code in the past without any problems. And to test I have just cut and pasted the example code given in your link straight into a new VB project and it works fine.

Are you running any system tray utilities?
 
I am not aware of running any other system tray utlilies - I am on Windows 7, but it does the same in XP. In fact an older version of this program runs this routine of hiding perfectly and restoring perfectly, and I have compared the two - they are identical. There is one difference which I noted. In the literature it says you must set your form property of 'shownintaskbar' to false, whilst my older program has it as true. It works in neither with my new version.
 
Ok - is it failing in the IDE? With a compiled version? Both?
 
It is failing in the IDE and the compiled version
 
How can I find it which event fires when I click the trayicon?
 
Thanks

I was really trying to establish whether there are not any other events that will be fired as well, as the mousemove event does not fire. Is there not an event call stack that I can check when I click on the notifyicon?
 
Sorry - bit brusque there.

The ONLY message that the tray icon is sending to your VB application is WM_MOUSEMOVE and that is being sent to your form. Your form wraps that up in the Form_MouseMocve event.

There are no other message that the tray icon is sending to your application
 
I have started a new program and entered the notifyincon routines as recommended, and it works fine. I then started adding the controls from the old existing/program, and it keeps on working fine until a certain stage, when not all the controls have been added. I tried to isolate which control added takes away this functionality, but if differs from different attempts.
The end is that at a certain point the notifyicon functionality disappears for no apparent reason whilst the notifyincon always appears due to the routines producing it.
If I changed a routine, I might interfere with certain form resize events, but this is just entering controls which takes away its ability to activate the mouse mouse event.
 
Are these the normal VB controls or 3rd party controls? Sounds like something is subclassing the form.
 
I found an excellent notifyicon user control on the net. Thanks for your assitance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top