Jump to content

Performing Actions At Gui Load?


Recommended Posts

I've looked through the help files in autoit and I can't find out how to do things at GUI startup when the program starts, such as a traytip. Any ideas?

Thx, eMac

Codename: Source ProgrammerWhat Is Codename: Source? A community designed operating system based off of the Windows OS. Source brings the ideas of the community to life as each user brings his or her own ideas into the development of this project.
Link to comment
Share on other sites

  • Moderators

I've looked through the help files in autoit and I can't find out how to do things at GUI startup when the program starts, such as a traytip. Any ideas?

Thx, eMac

:) Well... what do you want to do? After making the functions / GUISetState() to show / While/WEnd to loop and do something within the loop. Don't know what traytip has to do with the GUI really, but maybe you'd care to elaborate a bit more.

P.S. - Oh ... Welcome to the forums.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

:) Well... what do you want to do? After making the functions / GUISetState() to show / While/WEnd to loop and do something within the loop. Don't know what traytip has to do with the GUI really, but maybe you'd care to elaborate a bit more.

P.S. - Oh ... Welcome to the forums.

Thanks for the welcoming :( Great program so far. Love it

Welp, I just wanna learn how I can do specific things RIGHT when the GUI

(program) is executed. Like, say right when the program loads, a balloon (TrayTip) appears and says

"Welcome to Program, to get started click on this. For help, you may press F1 to view the Help File."

TrayTip("Welcome", "Welcome to Program, to get started click on this. For help, you may press F1 to view the Help File.", 5, 1)

Hope this explains more :D

Thx again!

eMac

Codename: Source ProgrammerWhat Is Codename: Source? A community designed operating system based off of the Windows OS. Source brings the ideas of the community to life as each user brings his or her own ideas into the development of this project.
Link to comment
Share on other sites

TrayTip("Welcome", "Welcome to Program, to get started click on this. For help, you may press F1 to view the Help File.", 5, 1)

Hope this explains more :)

Thx again!

eMac

As smoke hinted at

if you just want a traytip or similar to show as the gui appears

just add the relevant command just after the:

GUISetState() ; which displays the GUI

HardCopy

Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad

Link to comment
Share on other sites

  • Moderators

I would suggest downloading the Beta of AutoIt and when wanting to use GUI functions, take a look at GUIBuilder and Koda, until then you can take a look at this:

#include <GUIConstants.au3>

Global $TrayTip
HotKeySet('{F2}', "_TrayTipToggle")
$MainGUI = GUICreate('Just An Example', 200, 100)
$Label = GUICtrlCreateLabel('Hi, This is your GUI', 10, 150, 20)
$Button = GUICtrlCreateButton('Exit', 35, 55, 65, 30)

_TrayTipToggle()

GUISetState()
    
While 1
    $GetInfoFromGUI = GUIGetMsg()
    Select
        Case $GetInfoFromGUI = $GUI_EVENT_CLOSE
            Exit
        Case $GetInfoFromGUI = $Button
            If MsgBox(52, 'Attention!', 'Are you sure you want to exit?') = 6 Then
                Exit
            EndIf
    EndSelect   
    Sleep(10)
WEnd

Func _TrayTipToggle()
    $TrayTip = Not $TrayTip
    While $TrayTip
        TrayTip("Welcome", "Welcome to Program, to get started click on this. For help, you may press F1 to view the Help File." & _
            @CR & 'Please Press F2 to get started!', 5, 1)
        Sleep(10)
    WEnd
    TrayTip('', '', 0, 0)
EndFunc

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Thx both you guys, it does what I want it to now :)

thx for all of the help, I appreciate it.

FYI: Yes, I do have the beta version, latest release. :(

Codename: Source ProgrammerWhat Is Codename: Source? A community designed operating system based off of the Windows OS. Source brings the ideas of the community to life as each user brings his or her own ideas into the development of this project.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...