WindowPadX  v0.1.0

Commands

Adding Commands

Additional commands for use in WindowPadX.ini may be implemented by simply adding subroutines or functions to WindowPadX.ahk. For instance, a Close command could be implemented by adding either of the following:

Close: ; Subroutine version
    if wp_WinExist(Params)
        WinClose
    return
    
Close(winTitle) { ; Function version, requires v1.60+
    if wp_WinExist(winTitle)
        WinClose
}

It would then be used like any other WindowPadX command, by adding something like this to WindowPadX.ini:

!4 = Close, A

Note that AutoHotkey or Ahk2Exe is required to run or compile WindowPadX.ahk after making changes.

Command-line Usage

As of v1.56, WindowPadX supports a command-line mode. Simply pass one or more commands on the command-line and WindowPadX will execute them and then exit. If a command's parameters contain spaces, the command and its arguments must be enclosed in quotation marks. For example:

WindowPadX.exe GatherWindows,1 "WindowScreenMove, Next, My Window"

Configuration

All configuration is currently done by editing WindowPadX.ini.

Hotkeys

Hotkeys are defined in [Hotkeys] sections. Each section contains a list of hotkey=command bindings. The syntax for a binding is:

Hotkey = Command, Params

Hotkey may be any valid AutoHotkey hotkey. Command must be a WindowPadX command, defined in the script as a label.

Hotkeys defined in the [Hotkeys] section are initially active when WindowPadX loads. Hotkey sets which use standard modifier keys like Ctrl (^) or Win (#) should be placed directly in this section.

[Hotkeys]
#Num

Custom modifier keys may be implemented by placing "pad" keys (excluding the modifier key) in a [Hotkeys: Name] section, and a hotkey in the [Hotkeys] section to enable/disable it:

[Hotkeys]
ModifierKey = Hotkeys, Name
...
[Hotkeys: Name]
Key1 = Command, Params
Key2 = Command, Params
...

Options

TitleMatchMode: Defines the default title matching mode for the script.

If WindowPadX is #included in another script, WindowPad_Init() must be called from the auto-execute section for this option to work.

[Options]
TitleMatchMode=2

Exclude Windows

WindowPadX hotkeys are disabled for windows listed in this section.

[Exclude Windows]
Window=Virtual PC
Window=ahk_class TSSHELLWND
; TSSHELLWND is the window class of Remote Desktop.

Gather Exclusions

Windows may be excluded from "gathering" either by title or by process.

In the following example, either section may be used to prevent GatherWindows from affecting Windows Vista's side bar.

[Gather: Exclude Windows]
Window=ahk_class SideBar_AppBarWindow
Window=ahk_class SideBar_HTMLHostWindow
Window=ahk_class BasicWindow

[Gather: Exclude Processes]
Process=sidebar.exe

FillVirtualScreen

Expands a window to fill the entire virtual screen, which encompasses all screens in a multi-monitor setup.

FillVirtualScreen, WinTitle

Parameters

WinTitle See Window Titles.

GatherWindows

Gathers windows onto a single monitor.

GatherWindows, WinTitle
GatherWindows, Monitor

Parameters

WinTitle Gather windows onto the monitor which contains this window. See Window Titles.
Monitor A monitor number, where 1 is the first monitor.

Hotkeys

Enables or disables a set of hotkeys.

Hotkeys, Section, Options

Parameters

Section The name of a hotkey set defined in WindowPadX.ini, excluding the Hotkeys: prefix.
Options Any option or string of options compatible with AutoHotkey's Hotkey command. For instance, On or Off.

The word Toggle to toggle each hotkey in the set.

Specify D%time% to indicate that the hotkey that launched this command must be held for at least %time% seconds before the hotkey set is enabled.

If no options are specified, the hotkeys will be automatically disabled when the hotkey that launched this command is released.

Example

In the following example, the hotkey set is enabled if CapsLock is held for 0.2 seconds, and automatically disabled when CapsLock is released:

[Hotkeys]
CapsLock = Hotkeys, Active Window, D0.2

[Hotkeys: Active Window]
z = WindowPadMove, -1, +1,  0.5, 0.5
x = WindowPadMove,  0, +1,  1.0, 0.5
...

MaximizeToggle

Maximizes or restores a window.

MaximizeToggle, WinTitle

Parameters

WinTitle Indicates which window to maximize or restore. See Window Titles.

Minimize

Minimizes a window.

Minimize, WinTitle

Parameters

WinTitle Indicates which window to minimize. See Window Titles.

Restore

Restores a window.

Restore, WinTitle

Parameters

WinTitle Indicates which window to restore. See Window Titles.

Send

Analogous to AutoHotkey's Send command.

Send, Keys

Remarks

The comma is required.

Unminimize

Restores the most recently minimized window.

Unminimize

Version History

Version 0.1.0:

Window Titles

WindowPadX commands accept any of the following for the WinTitle parameter:

WindowPadMove

Simultaneously moves and resizes a window, based on a "pad" concept.

WindowPadMove, X, Y [, WidthFactor, HeightFactor, WinTitle ]

Parameters

X -1 (left), 0 (center) or +1 (right)
Y -1 (up), 0 (center) or +1 (down)
WidthFactor A number between 0.0 and 1.0, where 0.5 is half of the screen's width.
HeightFactor A number between 0.0 and 1.0, where 0.5 is half of the screen's height.
WinTitle Indicates which window to move. See Window Titles.

Remarks

[ Brackets denote optional parameters. ]

WindowPadMove performs the first applicable action from the following list:

If the window is minimized or maximized, it will be restored before it is moved.

WindowScreenMove

Moves a window between monitors (screens.)

WindowScreenMove, Monitor, WinTitle

Parameters

Monitor Next, Previous or a monitor number, where 1 is the first monitor. N, P and Prev are also acceptable.
WinTitle Indicates which window to move. See Window Titles.