I have a window with an edit control field that i want to send a number to. Why is it not clicking the edit control 111? You can see I've defined it in the script as hWnd4 .
Code: Select all
setkeydelay , -1
DetectHiddenWindows On
DetectHiddenText On
SetTitleMatchMode, 2
winTitle := "Custom Filter - Occurrence List - Q-Pulse"
winTitle2 := "LaunchPad <Knight, James>"
winTitle3 := "_Customer Complaint - Occurrence Details - Q-Pulse"
winTitle4 := "_Customer Complaint - Incident Details - Q-Pulse"
winClass := "ahk_class WindowsForms10.Window.8.app.0.2eed1ca_r9_ad1"
editControl := "WindowsForms10.EDIT.app.0.2eed1ca_r9_ad"
hWnd1 := WinExist(winTitle) ; Get Custom Filter window hWnd
hWnd2 := WinExist(winTitle2) ; Get LaunchPad window hWnd
hWnd3 := WinExist(winTitle3) ; Get Complaint window hWnd
hWnd4 := WinExist(winTitle4) ; Get Incident window hWnd
ptrS := A_PtrSize ? "Ptr" : "UInt"
Loop, Read, \\private\Users\private\Documents\18-Customer complaint reports PDFs\New deliveries\4-batch no.txt
IDArr%A_Index%:= RegExReplace(A_LoopReadLine, "\D")
While % IDArr%A_index%
{
winclose, Customer Complaint - Occurrence Details - Q-Pulse
winclose, Customer Complaint - Incident Details - Q-Pulse
WinMinimizeAll
Sleep, 800
if (hWnd1) {
if (hWnd2)
DllCall("ShowWindow", ptrS, hWnd2, "Int", 6) ; Minimize LaunchPad window
DllCall("ShowWindow", ptrS, hWnd1, "Int", 3) ; Maximize Custom Filter window
Sleep, 50
ControlClick, % editControl "11", % "ahk_id " hWnd1
Sleep, 100
Send, ^{end}
Sleep, 100
Send, ^+{home}
Sleep, 100
Send % "comp-" . IDArr%A_index%
Sleep, 100
Send {Enter}
Sleep, 3000
Loop 6
{
Send, ^{o}
sleep, 1000
IfWinActive, Details - Q-Pulse
break
}
winwait, _Customer Complaint - Incident Details - Q-Pulse
DllCall("ShowWindow", ptrS, hWnd4, "Int", 3) ; Maximize window
ControlClick, % editControl "111", % "ahk_id " hWnd4
Sleep, 100
Send, ^{end}
Sleep, 100
Send, ^+{home}
Sleep, 100
Send % "250"
Sleep, 100
}
}
return
J