Sign in to follow this  
Followers 0
Tomb

something that made me LOL

12 posts in this topic

i decided i wanted to make my own custom message box that was actually a GUI masked as a msg box

so i wrote up this code.

i have before never laughed so hard at my own work

:)

#include <GuiConstants.au3>

$GUI = Guicreate("Custom Message Box", 260, 150, -1, -1, BitOR($WS_POPUPWINDOW, $WS_BORDER, $GUI_ONTOP), $WS_EX_STATICEDGE + $WS_EX_TOPMOST)
GuiSetState(@SW_SHOW, $GUI)

$YES = GuiCtrlCreateButton("Yes", 20, 100, 60, 30)

$NO = GuiCtrlCreateButton("No", 100, 100, 60, 30)

$PANIC = GuiCtrlCreateButton("Panic!", 180, 100, 60, 30)

$LABEL = GuiCtrlCreateLabel("Would you like to hit NO or YES?", 40, 20)

Global $NEWLABEL

Global $var

While 1
$msg = GuiGetMsg()
Select


    Case $msg = $YES
        Exit
    Case $msg = $NO
        Exit
    Case $msg = $PANIC
        GUICtrlDelete($YES)
        GUICtrlDelete($NO)
        GUICtrlDelete($PANIC)
        GUICtrlDelete($LABEL)
        $font="Comic Sans MS"
        GUISetFont (45, 400, 0, $font)
        $NEWLABEL = GuiCtrlCreateLabel("PANIC", 30, 30)
        ExitLoop
        

EndSelect
WEnd

While 1
$var = $var + 1
If $var = 10 Then
Exit
Else
GUISetBkColor(0x000000, $GUI)
GUICtrlSetBkColor(0xff0000, $NEWLABEL)
sleep(100)
GUISetBkColor(0xff0000, $GUI)
GUICtrlSetBkColor(0x000000, $NEWLABEL)
sleep(100)
EndIf

WEnd

Share this post


Link to post
Share on other sites



Why is this in GUI Help and Support?

Share this post


Link to post
Share on other sites

Why is this in GUI Help and Support?

its a GUI and eh why not.

give me support on it MEH

:)

Share this post


Link to post
Share on other sites

Here is something to laugh on too :)

It's called «Catch me if you can» :) ...

Are you satisfied with your salary?

#include <GUIConstants.au3>

$Gui = GUICreate("Satisfaction with salary issue", 300, 200)
$yes = GUICtrlCreateButton("Yes", 20, 50, 50, 25)
$no = GUICtrlCreateButton("No!", 200, 50, 50, 25)
$label = GUICtrlCreateLabel("Are you satisfied with your salary?", 50, 10, 200, 20)

GUISetState()

While 1
    $msg = GUIGetMsg()
    $CurInfo = GUIGetCursorInfo($Gui)
    If $CurInfo[4] = $no Then
        $CurrentCoords = ControlGetPos($Gui, "", $no)
        $Random_Left_Coords = Random(20, 250, 1)
        $Random_Top_Coords = Random(30, 160, 1)
        
        While $Random_Left_Coords > 20 And $Random_Left_Coords < 70
            $Random_Left_Coords = Random(20, 250, 1)
        WEnd
        
        While $Random_Top_Coords > 30 And $Random_Top_Coords < 75
            $Random_Top_Coords = Random(30, 160, 1)
        WEnd
        
        GUICtrlSetPos($no, $Random_Left_Coords, $Random_Top_Coords)
    EndIf
    
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $yes
            MsgBox(64, "Yes", "We thought so ;)!")
            ExitLoop
    EndSelect
WEnd

This should be in the Example section i think, or even in the Chat :)


 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

Here is something to laugh on too :)

It's called «Catch me if you can» :) ...

Are you satisfied with your salary?

#include <GUIConstants.au3>

$Gui = GUICreate("Satisfaction with salary issue", 300, 200)
$yes = GUICtrlCreateButton("Yes", 20, 50, 50, 25)
$no = GUICtrlCreateButton("No!", 200, 50, 50, 25)
$label = GUICtrlCreateLabel("Are you satisfied with your salary?", 50, 10, 200, 20)

GUISetState()

While 1
    $msg = GUIGetMsg()
    $CurInfo = GUIGetCursorInfo($Gui)
    If $CurInfo[4] = $no Then
        $CurrentCoords = ControlGetPos($Gui, "", $no)
        $Random_Left_Coords = Random(20, 250, 1)
        $Random_Top_Coords = Random(30, 160, 1)
        
        While $Random_Left_Coords > 20 And $Random_Left_Coords < 70
            $Random_Left_Coords = Random(20, 250, 1)
        WEnd
        
        While $Random_Top_Coords > 30 And $Random_Top_Coords < 75
            $Random_Top_Coords = Random(30, 160, 1)
        WEnd
        
        GUICtrlSetPos($no, $Random_Left_Coords, $Random_Top_Coords)
    EndIf
    
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $yes
            MsgBox(64, "Yes", "We thought so ;)!")
            ExitLoop
    EndSelect
WEnd

This should be in the Example section i think, or even in the Chat :)

OMG I LOVE IT

that is amazingly LOL

Share this post


Link to post
Share on other sites

dont it work or what?

Share this post


Link to post
Share on other sites

Here is something to laugh on too :)

It's called «Catch me if you can» :) ...

There is something wrong with your script...

I can TAB from the Yes to the NO button and then hit the spacebar to push the No button, but nothing happens!

Plz fix it so I can make my dissatisfaction known :)

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

There is something wrong with your script...

I can TAB from the Yes to the NO button and then hit the spacebar to push the No button, but nothing happens!

Plz fix it so I can make my dissatisfaction known :)

just edit it to this

#include <GUIConstants.au3>

$Gui = GUICreate("Satisfaction with salary issue", 300, 200)
$yes = GUICtrlCreateButton("Yes", 20, 50, 50, 25)
$no = GUICtrlCreateButton("No!", 200, 50, 50, 25)
$label = GUICtrlCreateLabel("Are you satisfied with your salary?", 50, 10, 200, 20)

GUISetState()

While 1
    $msg = GUIGetMsg()
    $CurInfo = GUIGetCursorInfo($Gui)
    If $CurInfo[4] = $no Then
        $CurrentCoords = ControlGetPos($Gui, "", $no)
        $Random_Left_Coords = Random(20, 250, 1)
        $Random_Top_Coords = Random(30, 160, 1)
        
        While $Random_Left_Coords > 20 And $Random_Left_Coords < 70
            $Random_Left_Coords = Random(20, 250, 1)
        WEnd
        
        While $Random_Top_Coords > 30 And $Random_Top_Coords < 75
            $Random_Top_Coords = Random(30, 160, 1)
        WEnd
        
        GUICtrlSetPos($no, $Random_Left_Coords, $Random_Top_Coords)
    EndIf
    
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $yes
            MsgBox(64, "Yes", "We thought so !")
            ExitLoop
        Case $msg = $No
            MsgBox(64, "No", "We don't care ^ _ ^")
            ExitLoop
    EndSelect
WEnd
Edited by Tomb616

Share this post


Link to post
Share on other sites

Here is something to laugh on too :D

It's called «Catch me if you can» :) ...

Are you satisfied with your salary?

#include <GUIConstants.au3>

$Gui = GUICreate("Satisfaction with salary issue", 300, 200)
$yes = GUICtrlCreateButton("Yes", 20, 50, 50, 25)
$no = GUICtrlCreateButton("No!", 200, 50, 50, 25)
$label = GUICtrlCreateLabel("Are you satisfied with your salary?", 50, 10, 200, 20)

GUISetState()

While 1
    $msg = GUIGetMsg()
    $CurInfo = GUIGetCursorInfo($Gui)
    If $CurInfo[4] = $no Then
        $CurrentCoords = ControlGetPos($Gui, "", $no)
        $Random_Left_Coords = Random(20, 250, 1)
        $Random_Top_Coords = Random(30, 160, 1)
        
        While $Random_Left_Coords > 20 And $Random_Left_Coords < 70
            $Random_Left_Coords = Random(20, 250, 1)
        WEnd
        
        While $Random_Top_Coords > 30 And $Random_Top_Coords < 75
            $Random_Top_Coords = Random(30, 160, 1)
        WEnd
        
        GUICtrlSetPos($no, $Random_Left_Coords, $Random_Top_Coords)
    EndIf
    
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $yes
            MsgBox(64, "Yes", "We thought so ;)!")
            ExitLoop
    EndSelect
WEnd

This should be in the Example section i think, or even in the Chat :)

:) That's great!

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites

Plz fix it so I can make my dissatisfaction known

just edit it to this

I got better fix Posted Image :

#include <GUIConstants.au3>

HotKeySet("^{TAB}", "HotKeys_Event")
HotKeySet("+{TAB}", "HotKeys_Event")
HotKeySet("{TAB}", "HotKeys_Event")
HotKeySet("{Right}", "HotKeys_Event")
HotKeySet("{Left}", "HotKeys_Event")
HotKeySet("{Up}", "HotKeys_Event")
HotKeySet("{Down}", "HotKeys_Event")
HotKeySet("{Space}", "HotKeys_Event")
HotKeySet("{Enter}", "HotKeys_Event")


$Gui = GUICreate("Satisfaction with salary issue", 300, 200)
$yes = GUICtrlCreateButton("Yes", 20, 50, 50, 25)
$no = GUICtrlCreateButton("No!", 200, 50, 50, 25)
$label = GUICtrlCreateLabel("Are you satisfied with your salary?", 50, 10, 200, 20)

GUISetState()

While 1
    $msg = GUIGetMsg()
    $CurInfo = GUIGetCursorInfo($Gui)
    If $CurInfo[4] = $no Then
        $CurrentCoords = ControlGetPos($Gui, "", $no)
        $Random_Left_Coords = Random(20, 250, 1)
        $Random_Top_Coords = Random(30, 160, 1)
        
        While $Random_Left_Coords > 20 And $Random_Left_Coords < 70
            $Random_Left_Coords = Random(20, 250, 1)
        WEnd
        
        While $Random_Top_Coords > 30 And $Random_Top_Coords < 75
            $Random_Top_Coords = Random(30, 160, 1)
        WEnd
        
        GUICtrlSetPos($no, $Random_Left_Coords, $Random_Top_Coords)
    EndIf
    
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $yes
            MsgBox(64, "Yes", "We thought so !")
            ExitLoop
        Case $msg = $No
            MsgBox(16, "No", "Unacceptable answer, please try again.")
    EndSelect
WEnd

Func HotKeys_Event()
    If Not WinActive($Gui) Then
        HotKeySet(@HotKeyPressed)
        Send(@HotKeyPressed)
        HotKeySet(@HotKeyPressed, "HotKeys_Event")
    EndIf
EndFunc

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Share this post


Link to post
Share on other sites

just edit it to this

#include <GUIConstants.au3>

...
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $yes
            MsgBox(64, "Yes", "We thought so !")
            ExitLoop
        Case $msg = $No
            MsgBox(64, "No", "We don't care ^ _ ^")
            ExitLoop
    EndSelect
WEnd
Hmmmm, I thought it would be more like this:

#include <GUIConstants.au3>

$Gui = GUICreate("Satisfaction with salary issue", 300, 200)
$yes = GUICtrlCreateButton("Yes", 20, 50, 50, 25)
$no = GUICtrlCreateButton("No!", 200, 50, 50, 25)
$label = GUICtrlCreateLabel("Are you satisfied with your salary?", 50, 10, 200, 20)

GUISetState()

While 1
    $msg = GUIGetMsg()
    $CurInfo = GUIGetCursorInfo($Gui)
    If $CurInfo[4] = $no Then
        $CurrentCoords = ControlGetPos($Gui, "", $no)
        $Random_Left_Coords = Random(20, 250, 1)
        $Random_Top_Coords = Random(30, 160, 1)

        While $Random_Left_Coords > 20 And $Random_Left_Coords < 70
            $Random_Left_Coords = Random(20, 250, 1)
        WEnd

        While $Random_Top_Coords > 30 And $Random_Top_Coords < 75
            $Random_Top_Coords = Random(30, 160, 1)
        WEnd

        GUICtrlSetPos($no, $Random_Left_Coords, $Random_Top_Coords)
    EndIf

    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $yes
            MsgBox(64, "Yes", "We thought so !")
            ExitLoop
        Case $msg = $no
            $YesPos = ControlGetPos($Gui, "", $yes)
            Opt("MouseCoordMode", 2)
            MouseMove($YesPos[0] + 10, $YesPos[1] + 10, 40)
            ControlFocus($Gui, "", $yes)
            Sleep(300)
            ControlClick($Gui, "", $yes)
    EndSelect
WEnd

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