Modify

Opened 12 years ago

Closed 12 years ago

#97 closed Bug (No Bug)

WinMenuSelectItem()

Reported by: Piano_man Owned by:
Milestone: Component: AutoIt
Version: 3.2.10.0 Severity:
Keywords: WinMenuSelectItem Cc:

Description

This does not seem to be working as expected.
AutoItVersion: 3.2.10.0
Computer: Win XP SP2

#include <GUIConstants.au3>

$GUI1 = GUICreate("My GUI 1",300,200, 200, 200)
    GUICtrlCreateLabel("TEST PAGE",20,20)
    $Button1 = GUICtrlCreateButton("Hide GUI 2", 40, 40)
		$hide = False
    $ButtonMenu = GUICtrlCreateButton("Test WinMenuSelectItem()", 40, 70)
GUISetState ()

$GUI2 = GUICreate("My GUI 2",300,200, 510, 200)
    GUICtrlCreateLabel("MAIN PAGE",20,20)
    $filemenu = GUICtrlCreateMenu ("File")
    $fileitem = GUICtrlCreateMenuitem ("TEST",$filemenu)
GUISetState ()

While 1
    $msg = GUIGetMsg()

    If $msg = $GUI_EVENT_CLOSE Then 
		Exit
	EndIf 
	
    Select
        Case $msg = $Button1
			If Not $hide then 
				WinSetState('My GUI 2', '', @SW_HIDE)
				GuiCtrlSetData($Button1, 'Show GUI 2')
			Else 
				WinSetState('My GUI 2', '', @SW_SHOW)
				GuiCtrlSetData($Button1, 'Hide GUI 2')
			EndIf 
			
			$hide = Not $hide
           
        Case $msg = $fileitem
            MsgBox(0,1,"Menu Clicked")
           
        Case $msg = $ButtonMenu
            WinMenuSelectItem("My GUI 2", "MAIN PAGE", "File", "TEST")
    EndSelect
WEnd

Attachments (0)

Change History (2)

comment:1 in reply to: ↑ description Changed 12 years ago by Piano_man

Replying to Piano_man:

This does not seem to be working as expected.
AutoItVersion: 3.2.10.0
Computer: Win XP SP2

I found solution, if you put the window handle, $GUI_2 in this case, in the first parameter it works. However, the helpfile says that you just need the title, so possibly the function should be changed or the helpfile modified.

comment:2 Changed 12 years ago by Valik

  • Resolution set to nobug
  • Status changed from new to closed

You say it doesn't work as expected, but you don't say what you expect. Looking at the code, clicking "Test WinMenuSelectItem" should trigger the event which displays a message box. It does that for me.

Resolving as no bug as I don't see anything wrong here.

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

Action
as closed The ticket will remain with no owner.
Author


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

 
Note: See TracTickets for help on using tickets.