I'm using the Delphi trayIcon on a the mainform of a project which
is set at it's time of creation to ShowMainForm := False;. Basically this
is a hidden window that will be used to handle application-wide events via
the trayIcon control.
When the trayIcon is double-clicked a default action takes place,
and I'm also using a Global Hotkey component set to Ctrl + some Key which no
matter what form of the application might have focus will call this same
trayIcon double-click command. So far so good!
In addition to this, I want to be able to alter this default
double-click trayicon command so that a different command is run IF and only
IF either shift key is being held down at the same time it is
double-clicked. Obviously I don't want or expect to be able to run the
secondary branch command of the double-click at the same time the Ctrl +
somekey is clicked, but I DO want it to branch if and when I use the mouse
to actually double-click the trayicon.
So I'm looking for the "best" way to handle this. I tried setting
the mainform's KeyPreview to true and having the OnKeyDown event of the
shift Key set a Boolean var so that if the trayicon were double-clicked and
this var was set it would branch the command as wanted, but this doesn't
work. I'm not sure if this is because the trayicon has it's own handle and
so the Keypreview of the mainform isn't getting used or what. Any ideas
would be appreaciated!
from Robert Meek dba Tangentals Design
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi