• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 245
  • Last Modified:

Capture F1 from icon

I currently have an application that resides only in the system tray. Although I can access stuff with right-left-clicks, I would also like it to react when I press F1.  Does anyone know how to do this?
                  Thanks
0
jexd99
Asked:
jexd99
  • 2
1 Solution
 
d4jaj1Commented:
Don't think you can because your system Tray "icon" won't have focus when the F1 key is pressed.  Either the Windows desktop has focus (the Windows default Help file will open) or the active window's application's help file will display.

The only way around this is to display your application and make sure it's active OR add a menu item to your system tray's popup-menu.

Any questions, let me know.

Jay
0
 
jexd99Author Commented:
Thank you for the response.  I would like to override the F1 key even if the systray app doesn't have focus.  This could be way to deep into windows OS system to override this function when another app has focus, but it is something I would like to do. In other words, if Netscape is open, and the icon app is in the system tray, pressing F1 would be intercepted by the app in the systray and perform it's function.  Does this make any sense? :-)
0
 
BoRiSCommented:
jexd99

the only way to do this would be to run a system hook to trap the message of the f1 key been pressed...this could pose a problem as f1 is the standard default key for help files in all applications etc. but here is the API call you can use...

SetWindowsHookEx(WH_KEYBOARD, someDLL, nil, nil);

this is just a simple eg as to how it should look for mre detailed help check the win32.hlp file

Later
BoRiS
0
 
jexd99Author Commented:
Thanks, I will research this api command to see what it would take to do this task.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now