Sign in to follow this  
Followers 0
ptt

how can i use guigetmsg() from menus w/o submenu

5 posts in this topic

I tried to make the menu using GUICtrlCreateMenu only (without using GUICtrlCreateMenuItem).... for example : view1 = GUICtrlCreateMenu("View1"), view2 = GUICtrlCreateMenu("View2")

When i use guigetmsg() , and when i try to select either view 1 or view2, it wont return any thing for guigetmsg().....what shoujd i do ? Please help me out.........I really dont wnt to create submenu due to my work has lots of repeated test i dont wnt to click further down to submenu.

tx in advanced.

Share this post


Link to post
Share on other sites



$openafile = GUICtrlCreateMenu("OpenFile")

$Closeafile = GUICtrlCreateMenu("Close")

for example i hve menus above ( those are not GUICtrlCreateMenuItem).....when i click on either , In VB6, it is mnuOpen_click()

what is the equivalent code when a menu selected in au3 ?

Share this post


Link to post
Share on other sites

GUIGetMsg doesnt return anything with just the menu, you need the sub menus...

Also, the menu doesnt return a control ID (via MouseGetPos()) unlike the normal controls

Share this post


Link to post
Share on other sites

This'll probly be the best youll get:

$Gui = GUICreate("beef", 100, 100)
$Menu = GUICtrlCreateMenu("File")
$Open = GUICtrlCreateMenuitem("Open File", $Menu)
$Close = GUICtrlCreateMenuitem("Close", $Menu)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $Open
            FileOpenDialog("Choose a file.", @HomeDrive, "(*.*)")
        Case $Close
            Exit
    EndSwitch
    Sleep(10)
WEnd

But what do I know.


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0