Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Capture F1 from icon

Posted on 1998-08-24
4
Medium Priority
?
244 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 300 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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 is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

647 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