Jump to content

ControlClick Child Window


Recommended Posts

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

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.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...