Jump to content

How can I select a context menu


Recommended Posts

Hi, I want to right click on a exe and then select one of the context menu.

For example: right click on notepad.exe then select "scan with XXX antivirus"

I know that I can use Send('+{F10}') to right click

$file = 'C:Windowsnotepad.exe'
Run("explorer /select," & $file)
WinWaitActive('Windows')
Send('+{F10}')

But I do not know how to select the item of "scan with XXX antivirus"

I know maybe somebody use the "up" or "down" key to select, but on different computer, the item "scan with XXX antivirus" may be on the 7th or th 8th, so you can not use it.

So is there anybody can help on this?

Could you pls paste the code, because I am new to autoit.

Thank you very much

Edited by yangyuanyuan
Link to comment
Share on other sites

This is how i get the context menu controls: WinGetHandle("[CLASS:#32768]")...you can see the class if you remove the 'freeze' option from the object spy.

Then, sometimes, sometimes not, you can read the values of the menu using one of the _Gui functions...i forget which, since the context menus i have only expose the counts...so i need to use relative positions (blah)

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