Forum Discussion

Madhi's avatar
Madhi
Contributor
14 years ago

simulate Context menu

Trying to simulate right click by using sendkeys (shift f10).  But the script pauses on executing the shift+f10.

Is there a workaround for this.  ClickR is not consistent in my app.

7 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Madhi,



    Try .Keys('[Apps]') - for me it works better than Shift-F10...
  • Alex:

    Can you be more clear on this.  I tried sys.desktop.keys as well as obj.keys('[apps]')

    on encountering the first single quote the line is considered as commment.  Please explain.

  • Hi Madhi,





    Looks like you are using VBScript, so you need to use double quotes for string constants:

    obj.keys("[Apps]")





    Important: the constants passed to the Keys method are case-sensitive.
  • Thanks for all your help..

    But i get the error message "Unable to focus the control" - Ours is a WPF windows application.
  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Madhi,



    Can you provide more details as for when the error occurs and a code snippet that is executed?

  • Hi Madhi,





    Yes, we need more info to proceed. Can the control be focused manually?

    For the suggested approach to work, it should be possible to do the same actions manually - focus the control and press the Apps key on the keyboard.
  • Oh..okay.. that is not happening manually.  I was tyring all possible combinations to make it work.