Capturing Mouse Events with a Transparent Window

In my recent article on the AutoHotKey scripting language, I advocated using hotkeys to address different domains separated into their own scripts. Of course, when you start a script up you might have difficulty remembering what hotkeys and actions the script allows. Luckily, AutoHotKey allows you to make GUIs quickly. Place the following code in your AutoHotKey script:

WinKill, HotKeysTutorGui, +AlwaysOnTop -SysMenuGui Color, F0F8FF                     Gui +E0x20   Gui Show, X650 Y0 W200 H100, HotKeysTutor ;Gui, Add, Text,,"Delete Key:"Gui, Add, Text,,"+ 2 = select two mails"Gui, Add, Text,,"+ Down = select number mails user inputs"WinGet ID, ID, A                   ; ...with HWND/handle IDWinSet Transparent,150,ahk_id %ID%

This will render a transparent floating window at the X coordinate, 650 pixels to the right on your screen, and a Y coordinate, 0 pixels down. Its width and height will be 200 X 100, and the title of the Window will be HotKeysTutor.

The text in the window tells you what hotkeys your script supports. Since you know what these are, write them using the GUI, Add, and Text commands.

Note: At the very top, the script uses the command WinKill, this will destroy any window named HotKeysTutor when the script loads. Thus, if you have numerous scripts, you can put it into any script and customize it for that script and then destroy it when you load a new script.

With very little effort, you can create a function in your scripts to write the window for any particular script and make it creatable by a hotkey.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

The Latest

microsoft careers

Top Careers at Microsoft

Microsoft has gained its position as one of the top companies in the world, and Microsoft careers are flourishing. This multinational company is efficiently developing popular software and computers with other consumer electronics. It is a dream come true for so many people to acquire a high paid, high-prestige job

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a

chrome os developer mode

How to Turn on Chrome OS Developer Mode

Google’s Chrome OS is a popular operating system that is widely used on Chromebooks and other devices. While it is designed to be simple and user-friendly, there are times when users may want to access additional features and functionality. One way to do this is by turning on Chrome OS