Jump to content

Need help with splash screen


RichardS
 Share

Recommended Posts

This is my first script ever and is purely meant to learn the scripting language, but I can't figure out why the splash screen doesn't go away. It just stays there after the main window appears. Can anyone help me? (No, it is not finished :) )

Here is the code

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)

;Splash Screen
$tamanhox=@DesktopWidth*0.46875
$tamanhoy=$tamanhox/2
$posicaox=(@DesktopWidth/2)-($tamanhox/2)
$posicaoy=(@DesktopHeight/2)-($tamanhoy)
splashImageOn("","splash.gif",$tamanhox,$tamanhoy,$posicaox,$posicaoy,1)
$GUI = GUICreate ("Teste", $tamanhox, $tamanhoy, $posicaox, $posicaoy,$WS_POPUP, BitOR ($WS_EX_TRANSPARENT, $WS_EX_LAYERED, $WS_EX_TOPMOST))
$label = GUICtrlCreateLabel("© Richard 2009", $posicaox+($tamanhox/6), $posicaoy/($tamanhoy), $tamanhox/4, $tamanhoy/4)
GUICtrlSetFont(-1,15,$tamanhox/30)
WinSetTrans ($GUI, "", 50)
GUISetBkColor(0xffffff, $GUI)
GUISetState(@SW_SHOW,$GUI)
sleep(1000)
GUISetState(@SW_HIDE,$GUI)

;Main window
$mainwindow = GUICreate("First Script", 900, 690)
GUISetBkColor(0xFFFFFF)
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
GUICtrlCreateLabel("System tools", 58, 10)
GUICtrlCreateLabel("Benching", 773, 10)
GUICtrlCreateLabel("Internett", 773, 415)
GUICtrlCreateLabel("Gaming", 58, 415)
$shutdown = GUICtrlCreateButton("Shutdown", 35, 180, 110)
GUICtrlSetOnEvent($shutdown, "shutdowns")
$kontrollp = GUICtrlCreateButton("Kontrollpanel", 740, 30, 110)
GUICtrlSetOnEvent($kontrollp, "kontrollp")
$restart = GUICtrlCreateButton("Restart", 35, 150, 110)
GUICtrlSetOnEvent($restart, "restart")
;$sov = GUICtrlCreateButton("Hibernate", 35, 90, 110)
;GUISetOnEvent($sov, "sov")
$cancelbutton = GUICtrlCreateButton("Cancel", 740,650,110)
GUICtrlSetOnEvent($cancelbutton, "CancelButton")
$logoffbutton = GUICtrlCreateButton("Log off", 35,120,110)
GUICtrlSetOnEvent($logoffbutton, "logoffbutton")
$taskmanager = GUICtrlCreateButton("Launch taskmanager", 35,90,110)
GUICtrlSetOnEvent($taskmanager, "taskmanager")
$firewallon = GUICtrlCreateButton("Enable Firewall", 35,60,110)
GUICtrlSetOnEvent($firewallon, "firewallon")
$firewalloff = GUICtrlCreateButton("Disable Firewall", 35,30,110)
GUICtrlSetOnEvent($firewalloff, "firewalloff")
$firefox = GUICtrlCreateButton("Firefox", 740, 440, 110)
GUICtrlSetOnEvent($firefox, "firefox")
$riva = GUICtrlCreateButton("Rivatuner", 740, 60, 110)
GUICtrlSetOnEvent($riva, "riva")
$hard = GUICtrlCreateButton("Hardware", 740, 560, 110)
GUICtrlSetOnEvent($hard, "hardw")
$game = GUICtrlCreateButton("Gamer", 740, 530, 110)
GUICtrlSetOnEvent($game, "game")
$xsys = GUICtrlCreateButton("Xtremesystems", 740, 500, 110)
GUICtrlSetOnEvent($xsys, "xsys")
$guru = GUICtrlCreateButton("Guru3D", 740, 470, 110)
GUICtrlSetOnEvent($guru, "guru")
GUISetState(@SW_SHOW)
GUICtrlCreatePic(@WorkingDir & "\systool.jpg", 330, 230, 256, 256)
TraySetState(2)
 

While 1
  Sleep(1000) ;Idle around
WEnd

Func riva()
    run("C:\Programfiler\RivaTuner v2.22\RivaTuner.exe")
EndFunc

Func hardw()
    run("C:\Programfiler\Mozilla Firefox\firefox.exe www.hardware.no")
EndFunc
Func game()
    run("C:\Programfiler\Mozilla Firefox\firefox.exe www.gamer.no")
EndFunc

Func xsys()
    run("C:\Programfiler\Mozilla Firefox\firefox.exe www.xtremesystems.org/forums")
EndFunc

Func guru()
    run("C:\Programfiler\Mozilla Firefox\firefox.exe www.guru3d.com")
    EndFunc
    
Func CLOSEClicked()
  Exit
EndFunc

Func firefox()
    run("C:\Programfiler\Mozilla Firefox\firefox.exe")
EndFunc

Func cancelbutton()
    Exit
EndFunc

Func kontrollp()
    run("control")
    EndFunc

Func shutdowns()
run("shutdown.exe -p")
Exit
EndFunc

Func restart()
    run("shutdown.exe -r -t 1")
Exit
EndFunc

;Func sov()
;   Run("shutdown.exe -h")
;   Exit
;   Endfunc

Func logoffbutton()
    Run("shutdown.exe -l")
    Exit
EndFunc

Func taskmanager()
Run ("taskmgr.exe")
    EndFunc
    
    Func Firewalloff()
    Run("netsh.exe firewall set opmode disable")
    EndFunc

Func firewallon()
Run ("netsh.exe firewall set opmode enable")    
    EndFunc
Link to comment
Share on other sites

I am sorry for double posting, but it is better than opening a new thread. I can't change the icon when I am compiling the script, I have searched and found that I can use #AutoIt3Wrapper_Icon. But it will not change the icon of the exe file when I compile the script. E.g. #AutoIt3Wrapper_Icon=D:\Documents and Settings\my cool icon.ico . What do I do wrong?

Edited by RichardS
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...