Jump to content

Recommended Posts

Posted

On pressing a hotkey, I wish to send a right-click to a previously (manually) selected file-name, in a folder called "MyFolder".  Here is the code I wrote thanks to the so many contributers to this great software:

===========

#include <Constants.au3>

HotKeySet("^q", "ToRightClick") ; Ctrl+q

While 1
    Sleep(100)
WEnd

Func ToRightClick()

WinActivate("MyFolder")

WinWaitActive("MyFolder")

Sleep(1000)

MouseClick($MOUSE_CLICK_SECONDARY)

Sleep(1000)

EndFunc   ;==>ToRightClick

===========

When I execute the code, the right-click functions as intended, BUT, not on the required file-name, rather on the blank space in the folder.

I wish to activate the right-click menu of a file, not see the right-click option of the folder.

How do I achieve this?

Well, this is just a simulation of what I want to do in another program.  Using the 'menu key' would have been ideal, but unfortunately the menu key does not work in that program, so I have to resort to sending mouse click after having a Focus on the currently selected file.

Any suggestions are welcome.  Thanks.

 

 

Posted
  On 11/12/2016 at 3:16 PM, Charles777 said:

Well, this is just a simulation of what I want to do in another program.

Expand  

Could you post the name of the real program? Why solve a dummy problem when we could solve the real problem?

My UDFs and Tutorials:

  Reveal hidden contents

 

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
  • Recently Browsing   0 members

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