Solved

Capture F1 from icon

Posted on 1998-08-24
4
237 Views
Last Modified: 2010-04-04
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
Comment
Question by:jexd99
  • 2
4 Comments
 
LVL 3

Expert Comment

by:d4jaj1
ID: 1337602
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
 

Author Comment

by:jexd99
ID: 1337603
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
 
LVL 4

Accepted Solution

by:
BoRiS earned 100 total points
ID: 1337604
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
 

Author Comment

by:jexd99
ID: 1337605
Thanks, I will research this api command to see what it would take to do this task.
0

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi cmd execution 6 60
Correct Component for Shopping Cart. 2 105
When i run adoquery my application freezes 26 166
Graphics32 under Delphi 10.1 Berlin 2 65
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question