PS_ PowerShell Scripts
WINDOWS / COMMAND REFERENCE

Get-HWND

Matches characters in sequence across running process names and window titles, prioritizing exact and prefix process names.

View Get-HWND.ps1 on GitHub ↗

Usage

Get-HWND -Name 'npad'
Get-HWND -ProcessId 1234

Parameters

-Name
Fuzzy app/process name or title.
-ProcessId
Exact process ID, alternative to -Name.

Returns

One or more IntPtr main-window handles; processes without a main window are omitted.

Note

'npad' matches Notepad because the characters occur in order.