﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
116	Windows menu bug	Champak	Jpm	"This was brought up by PianoMan as a bug (http://svn.autoitscript.com/trac/ticket/97) do to my post in the forum (http://www.autoitscript.com/forum/index.php?showtopic=63384), but it was not resolved do to, I suspect, how he explained it and his example. 

WinMenuSelectItem does not work on hidden windows but the help file says that it does. PianoMan, made a workaround, which is cool, but isn't really any help because it requires both GUIs to initially show, which isn't practical.....for me at least.

Here is my example of what I am experiencing, and what I believe would be a more realistic/common encounter of the problem.

{{{
#include <GUIConstants.au3>

HotKeySet(""{ENTER}"", ""HOTKEY"")

$GUI1 = GUICreate(""My GUI 1"",300,200)
    GUICtrlCreateLabel(""Now the msgbox wont show with the hotkey or button"",20,120)
    $Button1 = GUICtrlCreateButton(""Page 1"", 40, 40)
    $ButtonMenu1 = GUICtrlCreateButton(""Menu Test"", 40, 70)
GUISetState (@SW_HIDE)


$GUI2 = GUICreate(""My GUI 2"",300,200)
    GUICtrlCreateLabel(""MAIN PAGE"",20,20)
    $filemenu = GUICtrlCreateMenu (""File"")
    $fileitem = GUICtrlCreateMenuitem (""TEST"",$filemenu)
    $Button2 = GUICtrlCreateButton(""Page 2"", 40, 40) 
	$ButtonMenu2 = GUICtrlCreateButton(""Menu Test"", 40, 70)
GUISetState ()

While 1
    $msg = GUIGetMsg()

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    Select
        Case $msg = $Button1
            GUISetState(@SW_HIDE, $GUI1)
            GUISetState(@SW_SHOW, $GUI2)

        Case $msg = $Button2
            GUISetState(@SW_HIDE, $GUI2)
            GUISetState(@SW_SHOW, $GUI1)
           
        Case $msg = $fileitem
            MsgBox(0,1,""Menu Clicked"")
           
        Case $msg = $ButtonMenu1 Or $msg = $ButtonMenu2
            WinMenuSelectItem(""My GUI 2"", ""MAIN PAGE"", ""File"", ""TEST"")
    EndSelect
WEnd

Func HOTKEY()
    WinMenuSelectItem(""My GUI 2"", ""MAIN PAGE"", ""File"", ""TEST"");I've tried both the window handle and title
EndFunc
}}}

"	Bug	closed	3.2.11.2	AutoIt	3.2.10.0		Fixed	Win XP SP2	
