Jump to content
Sign in to follow this  

Problem with ContextMenu

Recommended Posts


I Found on Google the code I'm looking for.

This code:

#include <GUIMenu.au3>
#include <File.au3>
#include <WindowsConstants.au3>

Local $GUIContextMenu = GUICreate("Context Menu", -1, 1, -5, -5, $WS_POPUP, $WS_EX_TOOLWINDOW)
local $MainContextMenu = GUICtrlCreateContextMenu()

$LvL1 = GUICtrlCreateMenu("LvL1", $MainContextMenu)
$LvL2 = GUICtrlCreateMenu("LvL2", $LvL1)

$ret = _GUICtrlMenu_TrackPopupMenu(GUICtrlGetHandle($MainContextMenu), $GUIContextMenu, 250, 250, 1, 1, 2)

I cleaned up the code to make it basic.

This code does Almost what I need.

The problem is that if I run the code so if I click the mouse anywhere else, then the menu does not disappear.

The menu disappears only if I first click on something on the menu and then click anywhere else.

What should I do?

I hope you understand ..

Edited by gil900

Share this post

Link to post
Share on other sites

we do, well at least i think that i do

add GUISetState() before _GUICtrlMenu_TrackPopupMenu to see if it help

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)

There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.


Share this post

Link to post
Share on other sites

Thank you.

There is another problem.

Once the menu is up, the window is not active ..

I do not want to use each time the command WinActivate Because it does not work well on Microsoft Word..

What needs to change?

Edited by gil900

Share this post

Link to post
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

Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.