gottygolly Posted April 21, 2015 Share Posted April 21, 2015 I've been searching around for this answer and can't seem to find it anywhere. My problem is I want to run an external program like Notepad or something and then using ControlClick() click the file button within Notepad, is there any way to do this? #include <WindowsConstants.au3> Run("Notepad") $gui = GUICreate("title",500,300,-1,-1) Opt("GUIOnEventMode",1) GUISetOnEvent(-3,"_Exit") GUISetState() ;---Found this searching around. $hPid=Run(@SystemDir & 'notepad.exe',"", @SW_HIDE) WinWait("[CLASS:Notepad]", "", 5) $hChild = WinGetHandle("[CLASS:Notepad]", "") $NEXSTYLE = DllCall("user32.dll", "int", "GetWindowLong", "hwnd", $hChild, "int", 236) DllCall("user32.dll", "int", "SetWindowLong", "hwnd", $hChild, "int", 236, "int", BitOR($NEXSTYLE[0], $WS_EX_MDICHILD)) DllCall("user32.dll", "int", "SetParent", "hwnd", $hChild, "hwnd", $Gui) WinMove($hChild, "", 0, 0,320,240) GUISetState(@SW_SHOW, $Gui) WinSetState($hChild,"",@SW_SHOW) ;--- While 1 Sleep(10) WEnd Func _Exit() Exit EndFunc Link to comment Share on other sites More sharing options...
computergroove Posted April 21, 2015 Share Posted April 21, 2015 You can use winactivate("notepad") and send ctrl + f or you can figure out what the control is for notepad. You might be able to figure it out with C:Program Files (x86)AutoIt3au3info.exe Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
junkew Posted April 21, 2015 Share Posted April 21, 2015 if au3info is not helping out search for simplespy and iuiautomation FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
jdelaney Posted April 22, 2015 Share Posted April 22, 2015 (edited) Do you mean the 'file' menu? You have to get your controls correct if you want relevant help: WinMenuSelectItem Edited April 22, 2015 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now