Jump to content
Sign in to follow this  
gottygolly

ControlClick Child Window

Recommended Posts

gottygolly

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

Share this post


Link to post
Share on other sites
computergroove

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

Share this post


Link to post
Share on other sites
jdelaney

Do you mean the 'file' menu?  You have to get your controls correct if you want relevant help:

WinMenuSelectItem
Edited 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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×