Jump to content

GUI useless script :-)


JoeCool
 Share

Recommended Posts

#include <guiconstants.au3>
#include <constants.au3>

;---------------------------------------------------------------------------

Global Const $W_EXIST = 0x01
Global Const $W_VISIBLE = 0x02
Global Const $W_ENABLE = 0x04
Global Const $W_ACTIVE = 0x08
Global Const $W_MINIMIZE = 0x10
Global Const $W_MAXIMIZE = 0x20

;---------------------------------------------------------------------------

func wndClose()
  exit
endfunc

func wndMinimize()
   guiSetState( @SW_HIDE, $gui )
endfunc

func wndRestore()
   guiSetState( @SW_RESTORE, $wnd )
endfunc

func wndMaximize()
   guiSetState( @SW_MAXIMIZE, $wnd )
endfunc

func trayLClick()
   dim $state

   $state = winGetState( $gui )
   if bitAnd( $state, $W_VISIBLE) = $W_VISIBLE then
      guiSetState( @SW_HIDE, $gui)
   else
      guiSetState( @SW_SHOW, $gui)
   endif
endfunc

func btn()
   trayTip("I'm a title ", "I'm the message", 4, 1)
   traySetState( @SW_TRAYFLASH )
   sleep(5000)
   trayTip("", "", 0)
   sleep( 1000 )
   trayTip("I'm a title", "I'm the message", 5, 2)
   sleep( 1000 )
   trayTip("I'm a title", "I'm the message", 5, 3)
   sleep (1000)
   trayTip("", "", 0)
   traySetState( @SW_TRAYNOFLASH )
endfunc

opt( "GUIOnEventMode", 1)
opt( "GUIEventCompatibilityMode", 1 )
opt( "TrayAutoPause", 0)
opt( "TrayOnEventMode", 1)

$flag = bitOr( $WS_SYSMENU, $WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)
$gui = guiCreate( "Hello World", 200, 200, 20, 20, $flag )

$btn = guiCtrlCreateButton( "bouton", 20, 20, 90, 30 )
guiCtrlSetOnEvent( -1, "btn" )

guiSetOnEvent( $GUI_EVENT_CLOSE, "wndClose" )
guiSetOnEvent( $GUI_EVENT_MINIMIZE, "wndMinimize" )
guiSetOnEvent( $GUI_EVENT_RESTORE, "wndRestore" )
guiSetOnEvent( $GUI_EVENT_MAXIMIZE, "wndMaximize" )

traySetClick( 16 )
traySetOnEvent( $TRAY_EVENT_PRIMARYUP, "trayLClick" )
;traySetOnEvent( $TRAY_EVENT_PRIMARYDOUBLE, "trayLClick" )

traySetToolTip( "Click Me !" )

guiSetState( @SW_HIDE )
while 1
   sleep( 5000 )
wend

Just for the fun of doing it :)

Link to comment
Share on other sites

Good example. [stupid kids cartoon voice]Theres a bug, can you find it?[/stupid kids cartoon voice]

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

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...