Opened 16 years ago

Closed 16 years ago

#399 closed Bug (No Bug)

Advanced Mode with GuiCtrlRead for Context Menu

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:



With AutoIt, it always return "-1" instead of the text of the control (Context Menu)

It work perfectly with

Attachments (0)

Change History (6)

comment:1 Changed 16 years ago by Valik

And the script to reproduce the issue?

comment:2 Changed 16 years ago by jpm

I think it has been solved in Can you verified with the latest beta?

comment:3 Changed 16 years ago by dgz

I tried with beta but it's still the same.

@Valik: here is a sample script:

#include <GUIConstantsEx.au3>
Opt("GUIOnEventMode", 1)

GUICreate ("Test", 200, 200)
$contextmenu = GUICtrlCreateContextMenu()
GUICtrlCreateMenuItem ("Item 1", $contextmenu)
GUICtrlSetOnEvent (-1, "ItemInfo")
GUICtrlCreateMenuItem ("Item 2", $contextmenu)
GUICtrlSetOnEvent (-1, "ItemInfo")
GUICtrlCreateMenuItem ("Item 3", $contextmenu)
GUICtrlSetOnEvent (-1, "ItemInfo")
GUICtrlCreateMenuItem ("Item 4", $contextmenu)
GUICtrlSetOnEvent (-1, "ItemInfo")
GUISetState ()

While 1

Func ItemInfo ()
MsgBox (0,0,GUICtrlRead(@GUI_CtrlId,1))

comment:4 follow-up: Changed 16 years ago by Gary works for me.

Are you sure you ran it in beta?

#include <GUIConstantsEx.au3>

MsgBox(4096, "AutoIt Version", @AutoItVersion)
Opt("GUIOnEventMode", 1)

GUICreate("Test", 200, 200)
$contextmenu = GUICtrlCreateContextMenu()
GUICtrlCreateMenuItem("Item 1", $contextmenu)
GUICtrlSetOnEvent(-1, "ItemInfo")
GUICtrlCreateMenuItem("Item 2", $contextmenu)
GUICtrlSetOnEvent(-1, "ItemInfo")
GUICtrlCreateMenuItem("Item 3", $contextmenu)
GUICtrlSetOnEvent(-1, "ItemInfo")
GUICtrlCreateMenuItem("Item 4", $contextmenu)
GUICtrlSetOnEvent(-1, "ItemInfo")

While 1

Func ItemInfo()
	MsgBox(0, 0, GUICtrlRead(@GUI_CtrlId, 1))
EndFunc   ;==>ItemInfo

comment:5 in reply to: ↑ 4 Changed 16 years ago by dgz

Sorry, It's the first time I run Beta, and believed it replace the old version.

It's ok with Thanks

comment:6 Changed 16 years ago by Jpm

  • Resolution set to No Bug
  • Status changed from new to closed
  • Version changed from to

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The ticket will remain with no owner.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.