Get window title/hwnd from process name?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
just me
Posts: 9451
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Get window title/hwnd from process name?

06 Jun 2014, 02:24

You might use the ahk_exe option for the WinTitleparameter.
User avatar
Menixator
Posts: 69
Joined: 30 Sep 2013, 04:10

Re: Get window title/hwnd from process name?

06 Jun 2014, 02:28

Code: Select all

processName := "notepad.exe"
if (WinExist("ahk_exe " . processName)){
	WinGetTitle, title, ahk_exe %processName%
	MsgBox The title of the window is %title%
} else {
	MsgBox The process "%ProcessName%" doesn't exist.
}
You can use the WinGetTitle command with ahk_exe %the_process_name% as the title parameter..

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Lamron750 and 241 guests