System Tray Bug !? 
Author Message
 System Tray Bug !?

Hi all,

I'm programming an app that stay in the system tray. Everything works fine
but now I want to show my app when I doubleclick on the systray icon. I
tried to do Form1.SetFocus but the app doesn't get the focus?! When I put my
code in a popup menu, everything works. Is that a VB6 bug?

Can anyone help me?



Tue, 07 Oct 2003 07:18:24 GMT  
 System Tray Bug !?
Probably not.  I'm gonna take a wild guess and say that you're probably
using the WM_MOUSEMOVE hack; therefore, the form is not receiving any kind
of notification when you double click on the systray icon.  Of course, since
you didn't provide any example code demonstrating how you're doing this,
it's hard to really say for certain this is the problem.

The proper way to add an icon to the system tray is to specify an
application-defined callback message and subclass the form to receive that
message.  You can then check lParam to determine button up, button down,
double click messages and which mouse button it was.

Mike


Quote:
> Hi all,

> I'm programming an app that stay in the system tray. Everything works fine
> but now I want to show my app when I doubleclick on the systray icon. I
> tried to do Form1.SetFocus but the app doesn't get the focus?! When I put
my
> code in a popup menu, everything works. Is that a VB6 bug?

> Can anyone help me?



Tue, 07 Oct 2003 11:01:22 GMT  
 System Tray Bug !?
To avoid any confusion with the messages from the tray icon, you could
place an invisible control (which has a .hWnd property) and subclass that
control
instead of the window itself.
There's also a known issue that the popup menu shown from the system tray
cannot be canceled (click somewhere else) unless you call
SetForegroundWindow
before showing the popup menu.

Alex



Quote:
> Probably not.  I'm gonna take a wild guess and say that you're probably
> using the WM_MOUSEMOVE hack; therefore, the form is not receiving any kind
> of notification when you double click on the systray icon.  Of course,
since
> you didn't provide any example code demonstrating how you're doing this,
> it's hard to really say for certain this is the problem.

> The proper way to add an icon to the system tray is to specify an
> application-defined callback message and subclass the form to receive that
> message.  You can then check lParam to determine button up, button down,
> double click messages and which mouse button it was.

> Mike



> > Hi all,

> > I'm programming an app that stay in the system tray. Everything works
fine
> > but now I want to show my app when I doubleclick on the systray icon. I
> > tried to do Form1.SetFocus but the app doesn't get the focus?! When I
put
> my
> > code in a popup menu, everything works. Is that a VB6 bug?

> > Can anyone help me?



Tue, 07 Oct 2003 17:39:12 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Q: Problems with System Tray functionality in VB5 and question about TaskBar/System Tray

2. CoolHide - Help you hide/minimize window to Tray and hide icons from the system tray

3. CoolHide - Help you hide/minimize window to Tray and hide icons from the system tray

4. Sys Tray Menu Bug

5. Minimize AC00 to system tray

6. minimized in system tray

7. OL2K accessing the system tray?

8. System tray icon doesn't get updated

9. How to remove Mail icon from system tray?

10. New Mail System Tray Icon

11. Mail rule must deactivate system tray icon

12. System Tray application

 

 
Powered by phpBB® Forum Software