Modify

Opened 17 years ago

Closed 17 years ago

#116 closed Bug (Fixed)

Windows menu bug

Reported by: Champak Owned by: Jpm
Milestone: 3.2.11.2 Component: AutoIt
Version: 3.2.10.0 Severity:
Keywords: Win XP SP2 Cc:

Description

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

Attachments (0)

Change History (3)

comment:1 Changed 17 years ago by Valik

  • Milestone 3.2.11.1 (Beta) deleted

comment:2 Changed 17 years ago by Jpm

  • Owner set to Jon
  • Status changed from new to assigned

comment:3 Changed 17 years ago by Jpm

  • Milestone set to 3.2.11.2
  • Owner changed from Jon to Jpm
  • Resolution set to Fixed
  • Status changed from assigned to closed

Fixed in version: 3.2.11.2

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 owner will remain Jpm.
Author


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

 
Note: See TracTickets for help on using tickets.