Rasmus Posted March 8, 2008 Posted March 8, 2008 i have made a little application, and i wont a splash image to pop up, at the start.but how do i insert a image to the script without have a picture file located on my computer, i mean so it still only have to be an exe and no extra files.the splash pics,1st. 2nd. the code for now:expandcollapse popup#include <GuiConstants.au3> ; GUI GuiCreate("Shutdown", 125, 277,-1,-1,$WS_OVERLAPPED) GuiSetIcon(@SystemDir & "\power.ico", 0) ; GROUP WITH RADIO BUTTONS GuiCtrlCreateGroup("Options", 5, 5, 110, 120) $shutdown = GuiCtrlCreateRadio("Shutdown", 15, 20, 80) $standby = GuiCtrlCreateRadio("Standby", 15, 40, 80) $logoff = GuiCtrlCreateRadio("Log off", 15, 60, 80) $hibernate = GuiCtrlCreateRadio("Hibernate", 15, 80, 80) $reboot = GuiCtrlCreateRadio("Reboot", 15, 100, 80) GUICtrlCreateGroup ("",-99,-99,1,1) ;close group ;clock groupe GuiCtrlCreateGroup("Timing", 5, 135, 110, 65) ; UPDOWN GuiCtrlCreateLabel("Hours Minutes", 20, 150) $hours = GuiCtrlCreateInput("0", 20, 167, 40, 20) GuiCtrlCreateUpDown(-1) $minutes = GuiCtrlCreateInput("0", 65, 167, 40, 20) GuiCtrlCreateUpDown(-1) ; BUTTON $ok = GuiCtrlCreateButton("OK", 5, 210, 55, 30) $cancel = GuiCtrlCreateButton("Cancel", 60, 210, 55, 30) ; Variabler $kommando = 0 $tid = 0 ; GUI MESSAGE LOOP GuiSetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $cancel ExitLoop Case $msg = $shutdown And BitAND(GUICtrlRead($shutdown), $GUI_CHECKED) = $GUI_CHECKED $kommando = 5 Case $msg = $standby And BitAND(GUICtrlRead($standby), $GUI_CHECKED) = $GUI_CHECKED $kommando = 36 Case $msg = $logoff And BitAND(GUICtrlRead($logoff), $GUI_CHECKED) = $GUI_CHECKED $kommando = 4 Case $msg = $hibernate And BitAND(GUICtrlRead($hibernate), $GUI_CHECKED) = $GUI_CHECKED $kommando = 68 Case $msg = $reboot And BitAND(GUICtrlRead($reboot), $GUI_CHECKED) = $GUI_CHECKED $kommando = 6 Case $msg = $ok $tid = GUICtrlRead($hours) * 1000 * 60 * 60 $tid = $tid + GUICtrlRead($minutes) * 1000 * 60 sleep($tid) Shutdown($kommando) EndSelect WEnd
Rasmus Posted March 8, 2008 Author Posted March 8, 2008 will it all be taken together if i just make img path and then combine to exe?
ByteMyCookies Posted March 8, 2008 Posted March 8, 2008 (edited) I dont this this can be done, if you are making this into an .exe to move it to a different computer you have to bring the files with you. If you got a flash drive that you are moving it with you can use this however. FileInstall("Location of your pic on flash drive", "What you wqant it installed on target computer",1) Edited March 8, 2008 by ByteMyCookies My Scripts,[topic="65986"]AI Example[/topic] ,Capable of Emotion!
Rasmus Posted March 8, 2008 Author Posted March 8, 2008 ok, but wich code shall i use to set a picture to backgruond in my GUI / window ?
ByteMyCookies Posted March 8, 2008 Posted March 8, 2008 Here this is a good example, make sure you have $WS_EX_LAYERED as one of you GUI Styles. #include <GUIConstants.au3> $GuiHeight = 500 $GuiWidth = 500 GUICreate ("My GUI",$Guiwidth,$GuiHeight,-1,-1,$WS_EX_LAYERED) GUISetState () GUICtrlCreatePic ( "Location of your backround here.", 0, 0, $Guiwidth, $GuiHeight) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend My Scripts,[topic="65986"]AI Example[/topic] ,Capable of Emotion!
Rasmus Posted March 8, 2008 Author Posted March 8, 2008 but it looks like this now, is there anyway to make all the "gray" color to tranparent?is says: Picture controls have always a transparent color.what is this transparent color code?, oh and btw, i cant press any of the buttons now, why that ?
Rasmus Posted March 8, 2008 Author Posted March 8, 2008 man, dont anyone know how to make the background color tranparent?
ByteMyCookies Posted March 9, 2008 Posted March 9, 2008 (edited) I don't know how... I can look in to it though.. I found -2 is the RGB code for transparent. But that will not fix the other issues. Edited March 9, 2008 by ByteMyCookies My Scripts,[topic="65986"]AI Example[/topic] ,Capable of Emotion!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now