For example, you have an exe that you need to force it fullscreen, on top and borderless and yet you have no access to the source code.
AutoHotKey is here to rescue.
Do you know that you can compile an AutoHotKey script into exe file? Then, you can pass parameter to it from CLI.
Step 1: grab this code
(assume your screen resolution is 1920×1080) and save as fullscreen.ahk
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
w = 1920 h = 1080 #SingleInstance, Force #NoTrayIcon SetTitleMatchMode, RegEx Title = %1% Title := Title . "$" Target = %2% Run, %Target% WinWaitActive, %Title% WinGet Style, Style, A WinGetPos, X, Y, Width, Height, A WinSet, Style, -0xC40000, A WinMove,A,,0,0,w,h ExitApp |
Step 2: convert it to fullscreen.exe
You can use the free Ahk2Exe.exe to convert the ahk into a exe file. Look for the compiler at path like: “C:\Program Files (x86)\AutoHotkey\Compiler”
Step 3: create a launcher.bat
Put the following line inside:
|
cd C:\MyApps fullscreen "window_title_name" "app.exe" |
make sure your fullscreen.exe and app.exe (program to launch in fullscreen) are in the same folder (in this case is in C:\MyApps). You will also need to change the window_title_name to the correct title name.
How to know my application title name
AutoHotKey come with another goodies called “Active Windows Info” or simple window spy. You can locate it at path like “C:\Program Files (x86)\AutoHotkey\AU3_Spy.exe”
Launch it then focus on the application that you wanto find out the title. Look for the first line under
>>>>>>>>>>( Window Title & Class )<<<<<<<<<<< section, that’s your application title name!