Sign in to follow this  
Followers 0
WoodGrain

Help starting with GUI

2 posts in this topic

Hi all,

I've been using AutoIT for some time now for scripting program installs at work - been a great help!

I now want to start using some of the GUI features and was hoping that someone could give me a start by writting this basic program so that I can build from it.

I constantly have office staff try to talk to me while I'm on the phone in the office because I have an over the ear headset. I'd like a program that will fill the whole screen with a vibrant red background with the text "I'm on the phone" in large letters, I could start the program when I see someone approaching then click anywhere on the program to close it.

A possible extension of this would be to have it come up with an InputBox upon starting where I could enter estimated minutes on the call. Below the "I'm on the phone" text could be "Est VAR mins" where VAR is the number typed into the InputBox. It would be best to put the initial red screen with "I'm on the phone" up first, then prompt with the InputBox and add the est mins after, that will ensure they get the message at least.

I know I could write a VERY basic web page to do this & just put a shortcut to it, but I'm doing this to learn.

Thanks guys!

Share this post


Link to post
Share on other sites



You have been here almost as long as me??

Dim $active = True, $input

HotKeySet("{ESC}", "Terminate")
HotKeySet("{F9}", "ShowMe")

$GUI = GUICreate("Talking", @DesktopWidth, @DesktopHeight)
GUICtrlCreateLabel("I AM ON THE PHONE NOW!! *PLEASE WAIT*", 80, 200, 850, 200)
GUICtrlSetFont(-1, 30, 1000)
$label = GUICtrlCreateLabel("", 100, 400, 800, 300)
GUICtrlSetFont(-1, 30, 1000)
GUISetState(@SW_HIDE)
WinSetOnTop("Talking", "", 1)

While 1
    Sleep(100)
WEnd

Func Terminate()
    Exit 0
EndFunc   ;==>Terminate

Func ShowMe()
    $active = Not $active
    If $active Then
        GUISetState(@SW_HIDE, $GUI)
    Else
        $input = InputBox("My Phone Message", " Please type in the estimated time you will be on the phone")
        GUICtrlSetData($label, " ESTIMATED WAIT TIME IS " & $input & " MINUTES")
        GUISetState(@SW_SHOW, $GUI)
    EndIf
EndFunc   ;==>ShowMe

Happy Birthday!!

8)


NEWHeader1.png

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