Modify

Opened 18 years ago

Closed 18 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)

in reply to:  description comment:1 by Piano_man, 18 years ago

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 by Valik, 18 years ago

Resolution: nobug
Status: newclosed

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.

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.