Thank you for this great work. I am trying to get a script to interface with an edit control from another script. The following first script creates an edit control:
Code: Select all
Gui, +HwndhGui
Gui, Add, Edit, w100 h100, this is text
Gui, Show, AutoSize, Gui_title
ControlSend, Edit1, {Home}, ahk_id %hGui%
Return
Code: Select all
hGui := WinExist("Gui_title ahk_class AutoHotkeyGUI")
ControlGet, hEdit, Hwnd,, Edit1, ahk_id %hGui%
hFindDialog := Dlg_FindText(hGui,"","is","OnFind")
Return
OnFind(hDialog,p_Event,p_Flags,p_SearchText,Dummy="") {
global hEdit
if p_Event = C
Return
FindPos := Edit_FindText(hEdit,p_SearchText)
MsgBox %FindPos%
Edit_SetSel(hEdit,FindPos,FindPos+StrLen(p_SearchText))
}
GuiClose:
ExitApp
#include Edit.ahk
#include Dlg2.ahk
- iPhilip
P.S.: In actuality, the edit control is generated by a separate application which I cannot control.