charon Posted October 4, 2013 Share Posted October 4, 2013 I can't figure out why this doesn't work. Here is what I am trying to do: When u run a scan(click run cleaner button) in ccleaner you can right click on the results window which brings up a context menu where you select save as text file. I am trying to automate the right click with the following script: #include <GuiListView.au3> Local $hList = ControlGetHandle("[CLASS:PiriformCCleaner]", "", "[CLASS:Edit; INSTANCE:2]") Local $aClient = WinGetPos($hList) Local $aPos = _GUICtrlListView_GetItemPosition($hList, _GUICtrlListView_GetSelectedIndices($hList)) MouseClick("Right", $aClient[0] + $aPos[0] + 40, $aClient[1] + $aPos[1] +40) I notice if I have another window on top of ccleaner like notepad++ and run the script I get the context menu for notepad Link to comment Share on other sites More sharing options...
charon Posted October 4, 2013 Author Share Posted October 4, 2013 Fixed it #requireadmin #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator #include <GuiListView.au3> ;~ Shellexecute("\Cleaner\apps\CCleaner\CCleaner.exe") ;~ sleep(2000) WinActivate("Piriform CCleaner", "&Run Cleaner") WinWaitActive("Piriform CCleaner", "&Run Cleaner") ;~ ControlClick("Piriform CCleaner", "&Run Cleaner", "[CLASS:Button; INSTANCE:2]") ;Local $hList = ControlGetHandle("[CLASS:ATL:00000001405248F0]", "", "[CLASS:Edit; INSTANCE:1]") Local $hList = ControlGetHandle("[CLASS:PiriformCCleaner]", "", "[CLASS:Edit; INSTANCE:2]") Local $aClient = WinGetPos($hList) Local $aPos = _GUICtrlListView_GetItemPosition($hList, _GUICtrlListView_GetSelectedIndices($hList)) $x = MouseClick("Right", $aClient[0] + $aPos[0] +170, $aClient[1] + $aPos[1] +230, 1, 40) ;msgbox(0, "", "x is: " & $x) Link to comment Share on other sites More sharing options...
charon Posted October 4, 2013 Author Share Posted October 4, 2013 Now I need to know how to select a menu item on the context menu 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