Program Launcher

'*****************************************************************
'Program Launcher Version 1.0
'Developed by: P. Meyyappan
'EMail: meyyappan_rmp@yahoo.com
'FREEWARE: You can very well plug in this technology into your
'          application. I am giving this source for the sake of
'          sharing the knowledge. Please feel free to send your
'          feedback/enhancements/new requirements.
'*****************************************************************

About Program Launcher

Program Launcher is a simple utility to launch files/folders by pressing a combination of keys, irrespective of whichever application is active. This utility is similar to the one used by multimedia keyboards. All multimedia keyboards make use of a program that is running in the background. The only difference is that the multimedia keyboards have special keys, such as a volume control, that does not need that program to be active.

Technical Details

I have developed this program using Microsoft Visual Basic 6. I have integrated many concepta/technology/logic into a useful utility. Some raw materials have been processed into a useful product.

This program makes use of several API functions and other techniques posted on VB source code Web sites, such as allapi.net, vbaccelerator.com, vbcode.com, freevbcode.com, and so forth. The backbone of this program is the RegisterHotKey API function.

Once the program is started, a keyboard icon will appear next to the system clock. Right-click on the the icon to display a menu. The details of the application/file, path, or keystrokes are written to a binary file called data.dat. Press Win+A to show this program.

Functionality

Assume that you want to open Notepad when you press Win+Shift+N. Follow these steps:

  1. Register the keys with the RegisterHotKey funtion by passing a unique hotkey ID and the keystrokes.
  2. In an infinite loop, listen to Windows messages. When a hotkey message is found, check whether that hotkey was registered by your program by using a handle to the window. If so, open Notepad.
  3. To remove the hotkey at any time, call UnregisterHotKey by passing the hotkeyid.

What You Will Learn

From this project, you will learn how to implement the following through VB6:

  1. How to display a form on top of all other windows.
  2. How to add an icon to the System Tray.
  3. How to open files of any type with the associated application.
  4. How to remove the title bar during run time.
  5. How to create binary files by using Open method; read record by record from the file
  6. How to use structures in VB
  7. How to create shortcut (.lnk) files
  8. How to create a gradient color effect in a form
  9. How to restrict the number of instances of the application running. (Another instance of Registry Editor, Yahoo Messenger, or Winamp cannot be opened.) Although this can be implemented effortlessly by using the “App.PreviousInstance” property, still another instance can be opened by using a seperate copy of the EXE file. In this project, you wil find how to check whether another instance is already running by using the FindWindow API funcion.
  10. Last, but not least, about the cool interface of Program Launcher.

You can include this utility in your projects and make it more useable for your clients. Please do send in your feedback/enhancements/new requirements.

-Meyyappan

More by Author

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Must Read