Jump to content

A question: ContextMenu


Josbe
 Share

Recommended Posts

I need to simulate the right-click over a second ContextMenu($mnc_2) created, clicking in the button.

How I could display it?

Btw, I send this message, but I don't got it (with $WM_RBUTTONDOWN = 00000204)

Here a portion:

#include <GuiConstants.au3>

GuiCreate("GUI", 187, 125)

$mnc_1 = GUICtrlCreateContextMenu()
GUICtrlCreateMenuitem("CMenu1", $mnc_1)

$Btn1 = GuiCtrlCreateButton("Show ContextMenu", 20, 30, 150, 30)
$mnc_2 = GUICtrlCreateContextMenu($btn1)
GUICtrlCreateMenuitem("CMenu2", $mnc_2)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop

    Case $msg = $mnc_2
    ;
    Case Else
    EndSelect
WEnd
Link to comment
Share on other sites

I used the exact same code.

Yesterday I was thinking "Isn't there another way to show the menu?"

Then I realised there is the "appskey", the key next to the second Windows-key. Because when you click, the control has focus the appskey will work.

Send('{APPSKEY}')
Link to comment
Share on other sites

I used the exact same code.

Yesterday I was thinking "Isn't there another way to show the menu?"

Then I realised there is the "appskey", the key next to the second Windows-key. Because when you click, the control has focus the appskey will work.

Send('{APPSKEY}')

<{POST_SNAPBACK}>

Yes, but not in all the cases. Finally I used something like this:

ControlClick( $myGUI, "", $msg, "right")
:lmao:
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...