How to Move a Message Box (MsgBox) Window (AutoHotkey Trick)

Sometimes a MsgBox Window Just Pops Up in the Wrong Place—Here’s How to Relocate It

I’ve experienced this problem a couple of times. I use the MsgBox command to display script information at specific spots in a script. If in the modal mode (always-on-top), the pop-up window obscures my view of the window underneath it. I want the MsgBox to open elsewhere on the screen but AutoHotkey MsgBox command does not provide options for placing the window at an alternative location.

instanthotstring overwrite
The MsgBox command does not allow options for relocating the window on the computer screen.

The WinMove command can relocate the MsgBox window, but only after the window exists.  Since the MsgBox command stops the processing of the current thread, inserting the WinMove command after the MsgBox command doesn’t work. AutoHotkey won’t run the command until after closing the MsgBox window. I need a way to initiate a separate processing thread which relocates the MsgBox window after it comes to life—without closing the MsgBox window. Continue reading

When to Rewrite Your AutoHotkey Scripts

AutoHotkey Scripting Philosophy or Speeding Up the InstantHotstring.ahk script

“Before you can fix a problem you must understand it. Before you can understand a problem you must fix it.”

Sounds like a chicken/egg problem, but I assure you it isn’t. You only begin to understand a problem when you start working on a solution. As you grind through a script, you develop a deep awareness of its inner workings. I encourage any AutoHotkey novice to jump into a new script with both feet—even if you don’t think you know what you’re doing.

Sitting around and speculating about possible answers to a question often serves as mental thumb-twiddling. You must start somewhere—anywhere. Until you actually dig into it and undertake the work, you will never truly comprehend the obstacles and pitfalls associated with implementing a fix. You’ll find this singularly true when writing AutoHotkey scripts— especially as a beginner. The answer to the question “Where do I start?” is “Anywhere!” Continue reading

New Alternative Free AutoHotkey Scripts Download Site

Augmenting the Original Free AutoHotkey Scripts Page, We Now Offer an Alternative Script Index without the EXE Files

Library Benefits

For a couple of reasons, I’ve created a new download page for the free AutoHotkey script on the ComputorEdge Software Showcase site:

  1. Depending upon Windows security settings, some people have trouble downloading ZIP files which include compiled EXE files.
  2. Recent “Denial of Service” attacks have made the ComputorEdge.com site unavailable in certain parts of the world. (For now, I know of one UK reader who has trouble connecting.)

It just makes sense to offer an alternative download site. Continue reading

Fixed the InstantHotstring.ahk Script Slow Hotstring Loading Problem

New Version of InstantHotstring.ahk Script Now Available!

I’ve rewritten the LoadHotstrings subroutine in the InstantHotstring.ahk script (alternate download) to overcome the slowdown created by using the pre-existing routines found in the original script, “AutoHotkey Script Speed Problems (Scripting Insights).” I simplified things by limiting the subroutine to:

  1. Adding Hotstrings directly from the file without extra processing—no interaction with the DropDownList GUI control.)
  2. Checking for duplicated or changed Hotstrings within a single variable.
  3. Activating each Hotstring as its added.

AutoHotkey exports the DropDownList GUI control contents just once into a single variable and only writes the new DropDownList after processing the entire target file. The test file of over 1000 Hotstrings loads in one to two seconds—depending upon the weather. (The old routine could take up to 70 seconds for that same file.)

You can find the new code (InstantHotstring(FastLoad).ahk) and the old code (InstantHotstring(SlowLoad).ahk) at the InstantHotstring.ahk section of the ComputorEdge Free AutoHotkey Scripts page.

I’m currently working on blogs which discuss both the philosophical and technical aspect of rewriting the subroutine.

Click the Follow button at the top of the sidebar on the right of this page for e-mail notification of new blogs. (If you’re reading this on a tablet or your phone, then you must scroll all the way to the end of the blog—pass any comments—to find the Follow button.)

jack

This post was proofread by Grammarly
(Any other mistakes are all mine.)

(Full disclosure: If you sign up for a free Grammarly account, I get 20¢. I use the spelling/grammar checking service all the time, but, then again, I write a lot more than most people. I recommend Grammarly because it works and it’s free.)

Formatting Fonts and Colors in AutoHotkey GUI Window Controls

Guidelines for Setting Text Styles in AutoHotkey GUI (Graphical User Interface) Controls—You Can Make Your GUI Windows Easier to Read by Changing the Text Font and/or Color of Individual Controls

While AutoHotkey doesn’t offer the same detail control of color, font, and text style that you get in graphics programs, you can enhance your GUI pop-up windows with well-placed style changes. But to get the most from your adjustments, you need to understand how AutoHotkey executes these modifications.
Continue reading

AutoHotkey Script Speed Problems (Scripting Insights)

When Debugging AutoHotkey Script Speed Problems, Look at Loops First

A number of scripting techniques can cause apps to run slowly. These slowdowns might occur when running long loops, doing extensive searches, or making numerous hard drive reads and writes. But the primary culprit tends to hide within loops or redundant operations of any type. However, you may need to look deeper to find the real source of the problem.

Tip: If you like to keep numerous other programs open, then that alone can cause significant slowing as your computer shares processing time. For example, Google Chrome runs an independent process for each browser tab. Multiple Google Chrome tabs can put a heavy load on the CPU and memory causing delays in any other apps. To optimize time tests, minimize interference by closing all other programs.

Continue reading

Use Progress Bars When Loading Large Data Files (InstantHotstrings Feature)

Long Load Times Make Us Wonder If Our Computer Has Crashed—Progress Bars Help Us Stay Patient

In the blog, Use the FileSelectFile Command to Save Instant Hotstrings to an AutoHotkey File, I discussed how the InstantHotstring.ahk script saves a set of newly created Hotstrings to a data file. The flip side of the coin reads those same (or any other) Hotstring data files into the InstantHotstring.ahk script, (Loading Hotstrings into the InstantHotstring.ahk Script from Any AutoHotkey (.ahk) File). The solution to reading Hotstring files introduced the problem of the long load times for large files (Timing Script Speed). Continue reading