Sign in to follow this  
Followers 0
Damein

Problems with GUI Menus..

3 posts in this topic

I read through the help files.. and the topics posted to me before.. and for some reason I just cannot understand somethings.

I can easily do this kind of stuff in AHK, and this language is not the much different. I can't even seem to use the help file examples to create what I want :/

This is my code

#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
HotKeySet("`", "ShowGUI")

While 1
    Sleep(10)
WEnd

Func ShowGUI()
GUICreate("Quick Search", 200, 100)
    $HelpMenu = GUICtrlCreateMenu("Help")
    $HelpItem = GUICtrlCreateMenuItem("Help file", $HelpMenu)
GUISetState(@SW_SHOW)
EndFunc

GUISetState()
While 1
        $msg = GUIGetMsg()
        If $msg = $HelpItem Then 
            MsgBox(0, "Info", "Only a test...")
    EndIf
    WEnd

So all I am attempting to do is a create a menu that shows a msgbox once I select it.

I tried taking snippets from the help file and putting them in but I always get errors that way.


MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Share this post


Link to post
Share on other sites



you can try like this ! Posted Image

#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
HotKeySet("`", "ShowGUI")

GUICreate("Quick Search", 200, 100)
$HelpMenu = GUICtrlCreateMenu("Help")
$HelpItem = GUICtrlCreateMenuItem("Help file", $HelpMenu)

While 1
    $msg = GUIGetMsg()
    If $msg = $HelpItem Then MsgBox(0, "Info", "Only a test...")
WEnd

Func ShowGUI()
    GUISetState(@SW_SHOW)
EndFunc

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

for toggle

#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
HotKeySet("`", "ShowGUI")

GUICreate("Quick Search", 200, 100)
$HelpMenu = GUICtrlCreateMenu("Help")
$HelpItem = GUICtrlCreateMenuItem("Help file", $HelpMenu)
$state = 1
While 1
    $msg = GUIGetMsg()
    If $msg = $HelpItem Then MsgBox(0, "Info", "Only a test...")
    if $msg = $GUI_EVENT_CLOSE then Exit
WEnd

Func ShowGUI()
    if $state = 1 Then
    GUISetState(@SW_SHOW)
    $state = 0
Else
    GUISetState(@SW_HIDE)
    $state = 1
    EndIf
EndFunc

[Cheeky]Comment[/Cheeky]

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