Solved

How to create global hotkeys that intercept commands like Ctrl+F1 in an application that runs in the tray?

Posted on 2010-11-12
2
883 Views
Last Modified: 2013-12-17
Hi,
I wanted to find out if there is a way to set up global hotkeys for a .NET application that runs in the background/is in the system tray.  Basically what I am looking to do is allow an application to do things with hotkeys while it may not be the "active" open application.

Example: User presses [Ctrl]+[Print Scrn] then instead of the normal Windows print screen command running the application that is running in the tray should be able to perform an action based on that.
0
Comment
Question by:endrec
[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 Comments
 
LVL 9

Accepted Solution

by:
Misbah earned 500 total points
ID: 34123928
0
 
LVL 3

Expert Comment

by:Epitel0920
ID: 34124604
Another idea on asp page:
var CTRL = 0;
var KEYCODE;

document.onkeydown = KeyDownHandler;
document.onkeyup = KeyUpHandler;
function KeyDownHandler(e) {
   var evnt = window.event;
    var x = evnt.keyCode;
    if (x == <key code for CTRL>)
        CTRL = 1;
    KEYCODE = x;
}

function keyuphandler(e)
{
if (KEYCODE == <key for F12> and CTRL == 1)
   {
        //Keycode = -1 CTRL = 0;
       //you print statement
   }
}
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

734 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