#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Func SEARCHHWND($INPID)
Local $I, $HWIN, $LISTWIN = WinList()
$I = 0
Do
$I = $I + 1
$HWIN = WinGetProcess($LISTWIN[$I][0])
Until $HWIN = $INPID Or $I >= $LISTWIN[0][0]
If $HWIN = $INPID Then
Return $LISTWIN[$I][1]
Else
Return -1
EndIf
EndFunc
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Renamer by lcd1232", 252, 127, 366, 187)
$Checkbox = GUICtrlCreateCheckbox("Окна класса PW", 17, 80, 111, 41)
$Button = GUICtrlCreateButton("Переименовать", 136, 80, 97, 41, $WS_GROUP)
$Input = GUICtrlCreateInput("Новое название", 16, 48, 217, 21)
GUICtrlSetCursor (-1, 5)
$Window = GUICtrlCreateCombo("Window", 16, 8, 217, 25)
GUISetState(@SW_SHOW)
Dim $Form1_AccelTable[1][2] = [["{ENTER}", $Button]]
GUISetAccelerators($Form1_AccelTable)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
If $Window <>0 Then
SEARCHHWND($NPID)
EndIf
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd