Solved

Capture F1 from icon

Posted on 1998-08-24
4
234 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now