Skip to content

Instantly share code, notes, and snippets.

@AlexArchive
Created September 26, 2014 18:52
Show Gist options
  • Save AlexArchive/75ed139ec18c469e4b09 to your computer and use it in GitHub Desktop.
Save AlexArchive/75ed139ec18c469e4b09 to your computer and use it in GitHub Desktop.
**Set up the Project**
1. In Visual Studio, create an Windows Forms Application.
2. In Solution Explorer, right-click the project, select Add | Class. Name the class HotkeyManager.cs and add it to the project.
**Note:** In this tutorial we will place all of our code files in one code file.
3. Replace the code in the new HotkeyManager class with the following code.
4. In the Solution explorer, open the `Form1.cs` class emitted by Visual Studio.
5. Replace the default code in the class with the following code.
**Run the Sample**
1. Press F5 to run the project in debug mode.
2. Press Control + A. You should observe a message box.
3. Minimize the the application and then press Control + A. You should still observe a message box.
**Note:** Message boxes do not always obtain focus but the message box should always appear in the task bar.
**Examine the Code**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment