Unc3nZureD Posted June 17, 2010 Share Posted June 17, 2010 (edited) Hi, I want to do a little program. This program will show me a little picture in the middle of my screen.yes, I know the Splashimage command, but how can i remove the frame from it?(the X,minimize...). and if it possible can i put an Always on top attirbute? (like if any game or movie or any program is on it'll be ALWAYS on the top. (pic attached) Thanks! Edited June 25, 2010 by Unc3nZureD Link to comment Share on other sites More sharing options...
UEZ Posted June 17, 2010 Share Posted June 17, 2010 (edited) Here a very simple Splash Screen example I made:expandcollapse popup#include <WindowsConstants.au3> #include <GDIPlus.au3> Opt('MustDeclareVars', 1) Opt("GUIOnEventMode", 1) Global $hWnd, $hGraphic, $file, $hImage Global $iX, $iY $file = "c:\Program Files\AutoIt3\Examples\GUI\logo4.gif" If Not FileExists($file) Then Exit MsgBox(16, "Error", $file & " not found!", 10) _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile($file) $iX = _GDIPlus_ImageGetWidth($hImage) $iY = _GDIPlus_ImageGetHeight($hImage) $hWnd = GUICreate("Simple Splash Screen by UEZ", $iX, $iY, -1, -1, $WS_BORDER + $WS_SYSMENU + $WS_POPUP, $WS_EX_TOPMOST) WinSetTrans($hWnd, "", 0) GUISetState() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd) _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 0, 0, $iX, $iY) GUIRegisterMsg(0x000F, "WM_PAINT") ;$WM_PAINT = 0x000F GUIRegisterMsg(0x0014 , "WM_ERASEBKGND") ;WM_ERASEBKGND = 0x0014 GUISetOnEvent(-3, "_Exit") For $i = 0 To 255 Step 2 WinSetTrans($hWnd, "", $i) Sleep(15) Next Sleep(5000) For $i = 255 To 0 Step -2 WinSetTrans($hWnd, "", $i) Sleep(5) Next GUIDelete($hWnd) _Exit() Func _Exit() GUIRegisterMsg(0x000F, "") GUIRegisterMsg(0x0014, "") _GDIPlus_ImageDispose($hImage) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() Exit EndFunc Func WM_PAINT() _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 0, 0, $iX, $iY) Return "GUI_RUNDEFMSG" EndFunc ;==>WM_PAINT Func WM_ERASEBKGND() _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 0, 0, $iX, $iY) Return "GUI_RUNDEFMSG" EndFuncBR,UEZ Edited June 17, 2010 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Unc3nZureD Posted June 17, 2010 Author Share Posted June 17, 2010 Here a very simple Splash Screen example I made: expandcollapse popup#include <WindowsConstants.au3> #include <GDIPlus.au3> Opt('MustDeclareVars', 1) Opt("GUIOnEventMode", 1) Global $hWnd, $hGraphic, $file, $hImage Global $iX, $iY $file = "c:\Program Files\AutoIt3\Examples\GUI\logo4.gif" _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile($file) $iX = _GDIPlus_ImageGetWidth($hImage) $iY = _GDIPlus_ImageGetHeight($hImage) $hWnd = GUICreate("Simple Splash Screen by UEZ", $iX, $iY, -1, -1, $WS_BORDER + $WS_SYSMENU + $WS_POPUP, $WS_EX_TOPMOST) WinSetTrans($hWnd, "", 0) GUISetState() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd) _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 0, 0, $iX, $iY) GUIRegisterMsg(0x000F, "WM_PAINT") ;$WM_PAINT = 0x000F GUIRegisterMsg(0x0014 , "WM_ERASEBKGND") ;WM_ERASEBKGND = 0x0014 GUISetOnEvent(-3, "_Exit") For $i = 0 To 255 Step 0.005 WinSetTrans($hWnd, "", $i) Next Sleep(5000) For $i = 255 To 0 Step -0.01 WinSetTrans($hWnd, "", $i) Next GUIDelete($hWnd) _Exit() Func _Exit() GUIRegisterMsg(0x000F, "") GUIRegisterMsg(0x0014, "") _GDIPlus_ImageDispose($hImage) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() Exit EndFunc Func WM_PAINT() _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 0, 0, $iX, $iY) Return "GUI_RUNDEFMSG" EndFunc ;==>WM_PAINT Func WM_ERASEBKGND() _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 0, 0, $iX, $iY) Return "GUI_RUNDEFMSG" EndFunc BR, UEZ Dunno why but it won't work for me. If i start it nothing won't happen. (i changed the way of the pic) Link to comment Share on other sites More sharing options...
UEZ Posted June 17, 2010 Share Posted June 17, 2010 Can you add this line If Not FileExists($file) Then Exit MsgBox(16, "Error", $file & " not found!", 10) just after $file = "c:\Program Files\AutoIt3\Examples\GUI\logo4.gif"? Do you get an em?BR,UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Unc3nZureD Posted June 17, 2010 Author Share Posted June 17, 2010 Yes, Still nothing. Link to comment Share on other sites More sharing options...
UEZ Posted June 17, 2010 Share Posted June 17, 2010 Yes, Still nothing.Do you get the em: c:\Program Files\AutoIt3\Examples\GUI\logo4.gif not found?If not, what is the output from SciTE when you run the script?BR,UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Unc3nZureD Posted June 17, 2010 Author Share Posted June 17, 2010 I don't get any messages, how can i see that output? ( D:\Program Files\AutoIt3\Examples\GUI\logo4.gif ) - But I use this (not the C:\) Link to comment Share on other sites More sharing options...
Unc3nZureD Posted June 17, 2010 Author Share Posted June 17, 2010 I tried to put a wrong 'address' then it write the error. if i put in a good path it doesn'T do nothing Link to comment Share on other sites More sharing options...
UEZ Posted June 17, 2010 Share Posted June 17, 2010 (edited) Same on a different image e.g. *.jpg? BR, UEZ Edited June 17, 2010 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Unc3nZureD Posted June 17, 2010 Author Share Posted June 17, 2010 (edited) yes, it start for 0,1sec then it exit. is it works for u? ohh and an other thing: I've got the beta version. Edited June 17, 2010 by Unc3nZureD Link to comment Share on other sites More sharing options...
Unc3nZureD Posted June 17, 2010 Author Share Posted June 17, 2010 now I need to go to anywhere, after 1-1,5hour i'll come back. If u got any idea pls post it i'll try. And thx for trying to help me. Link to comment Share on other sites More sharing options...
UEZ Posted June 17, 2010 Share Posted June 17, 2010 (edited) You should update AutoIt to latest version! Yes, it is working properly on my notebook! Can somebody confirm? BR, UEZ Edited June 17, 2010 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 17, 2010 Moderators Share Posted June 17, 2010 (edited) UEZ, Works fine for me. Vista 32 SP2, AutoIt 3.3.6.1. M23 Edit: If you want do it without GDI, you can find the image dimensions from the file properties like this: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> HotKeySet("{ESC}", "On_Exit") Func On_Exit() Exit EndFunc $sPicPath = "c:\Program Files\AutoIt3\Examples\GUI\logo4.gif" $sDimensions = "" $oShellApp = ObjCreate("shell.application") If IsObj($oShellApp) Then Local $oDir = $oShellApp.NameSpace("C:\Program Files\AutoIt3\Examples\GUI") If IsObj($oDir) Then Local $oFile = $oDir.Parsename("logo4.gif") If IsObj($oFile) Then If @OSVersion = "WIN_VISTA" Or @OSVersion = "WIN_7" Then $sDimensions = $oDir.GetDetailsOf($oFile, 31) ElseIf @OSVersion = "WIN_XP" Then $sDimensions = $oDir.GetDetailsOf($oFile, 26) EndIf EndIf EndIf EndIf If $sDimensions = "" Then MsgBox(0, "Error", "Object creation failed") $aDimensions = StringSplit(StringtrimLeft(StringTrimRight(StringStripWS($sDimensions, 8), 1), 1), "x") $hGUI = GUICreate("Test", $aDimensions[1], $aDimensions[2], Default, Default, $WS_POPUP) GUICtrlCreatePic($sPicPath, 0, 0, $aDimensions[1], $aDimensions[2]) WinSetTrans($hGUI, "", 0) GUISetState() For $i = 1 To 255 Sleep(20) WinSetTrans($hGUI, "", $i) Next While 1 Sleep(10) WEnd Edited June 17, 2010 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
sahsanu Posted June 17, 2010 Share Posted June 17, 2010 (edited) Can somebody confirm?Confirmed, it is working fine on Windows XP SP3.Edit: I also tested it on a Windows 7 Virtual Machine and works fine. Both with AutoIt 3.3.6.1 Edited June 17, 2010 by sahsanu Link to comment Share on other sites More sharing options...
GEOSoft Posted June 17, 2010 Share Posted June 17, 2010 Working fine on XP(SP3, Vista(SP2), Win 7 All 32 bit George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
Unc3nZureD Posted June 17, 2010 Author Share Posted June 17, 2010 (edited) I deleted the ßeta version and i'll install it again. I hope it will work! UEZ, i saw your works and downloaded the analog meter. It's great. is that possible to let it play more then 1 music? but it's perfect! Meba23 i tried your script but it write: Object creation failed. and an error message. (I attached it) Edited June 17, 2010 by Unc3nZureD Link to comment Share on other sites More sharing options...
UEZ Posted June 17, 2010 Share Posted June 17, 2010 (edited) I deleted the ßeta version and i'll install it again. I hope it will work! UEZ, i saw your works and downloaded the analog meter. It's great. is that possible to let it play more then 1 music? but it's perfect! Meba23 i tried your script but it write: Object creation failed. and an error message. (I attached it) I never planned the Analog Meter to be a real music player! You have to drag'n'drop each mp3 manually! Maybe in the future... I don't know why you cannot get it run properly! Btw, I modified Melba23's script a little bit: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> HotKeySet("{ESC}", "On_Exit") $sPicPath = "c:\Program Files\AutoIt3\Examples\GUI\logo4.gif" $sDimensions = "" $oShellApp = ObjCreate("shell.application") If IsObj($oShellApp) Then Local $oDir = $oShellApp.NameSpace("C:\Program Files\AutoIt3\Examples\GUI") If IsObj($oDir) Then Local $oFile = $oDir.Parsename("logo4.gif") If IsObj($oFile) Then If @OSBuild > 6000 Then $sDimensions = $oDir.GetDetailsOf($oFile, 31) ElseIf @OSVersion = "WIN_XP" Then $sDimensions = $oDir.GetDetailsOf($oFile, 26) EndIf EndIf EndIf EndIf If $sDimensions = "" Then Exit MsgBox(0, "Error", "Object creation failed") $aDimensions = StringRegExp($sDimensions, "(?i)[\d]*x*[\d]", 3) If Not IsArray($aDimensions) Then Exit MsgBox(0, "Error", "Cannot get image resolution!") $hGUI = GUICreate("Test", $aDimensions[0], $aDimensions[1], Default, Default, $WS_POPUP) GUICtrlCreatePic($sPicPath, 0, 0, $aDimensions[0], $aDimensions[1]) Dim $Gui_Effects_in[10] = [0x00090000, 0x00040001, 0x00040002, 0x00040005, 0x00040004, 0x00040006, 0x00040008, 0x00040009, 0x0004000a, 0x00040010] Dim $Gui_Effects_out[9] = [0x00050001, 0x00050002, 0x00050004, 0x00050006, 0x00050005, 0x00050008, 0x00050009, 0x0005000a, 0x00050010] $effect = Random(0, 1, 1) If $effect = 1 Then WinSetTrans($hGUI, "", 0) Else DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hGUI, "int", 500, "short", $Gui_Effects_in[Random(1, 9, 1)]) EndIf GUISetState() If $effect = 1 Then For $i = 1 To 255 Step 2 WinSetTrans($hGUI, "", $i) Sleep(10) Next EndIf Sleep(3500) On_Exit() Func On_Exit() $effect = Random(0, 1, 1) Switch $effect Case 0 For $i = 255 To 0 Step -2 WinSetTrans($hGUI, "", $i) Sleep(5) Next Case 1 GUISetState(@SW_DISABLE, $hGUI) $hGUI = GUICreate("Test", $aDimensions[0], $aDimensions[1], Default, Default, $WS_POPUP, 0) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hGUI, "int", 500, "short", $Gui_Effects_out[Random(0, 8, 1)]) GUISetState(@SW_DISABLE, $hGUI) EndSwitch Exit EndFunc BR, UEZ Edited June 18, 2010 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Unc3nZureD Posted June 17, 2010 Author Share Posted June 17, 2010 I never planned the Analog Meter to be a real music player! You have to drag'n'drop each mp3 manually! Maybe in the future... I don't know why you cannot get it run properly! Btw, I modified Melba23's script a little bit: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> HotKeySet("{ESC}", "On_Exit") $sPicPath = "c:\Program Files\AutoIt3\Examples\GUI\logo4.gif" $sDimensions = "" $oShellApp = ObjCreate("shell.application") If IsObj($oShellApp) Then Local $oDir = $oShellApp.NameSpace("C:\Program Files\AutoIt3\Examples\GUI") If IsObj($oDir) Then Local $oFile = $oDir.Parsename("logo4.gif") If IsObj($oFile) Then If @OSBuild > 6000 Then $sDimensions = $oDir.GetDetailsOf($oFile, 31) ElseIf @OSVersion = "WIN_XP" Then $sDimensions = $oDir.GetDetailsOf($oFile, 26) EndIf EndIf EndIf EndIf If $sDimensions = "" Then Exit MsgBox(0, "Error", "Object creation failed") $aDimensions = StringRegExp($sDimensions, "(?i)[\d]*x*[\d]", 3) If Not IsArray($aDimensions) Then Exit MsgBox(0, "Error", "Cannot get image resolution!") $hGUI = GUICreate("Test", $aDimensions[0], $aDimensions[1], Default, Default, $WS_POPUP) GUICtrlCreatePic($sPicPath, 0, 0, $aDimensions[0], $aDimensions[1]) Dim $Gui_Effects_in[10] = [0x00090000, 0x00040001, 0x00040002, 0x00040005, 0x00040004, 0x00040006, 0x00040008, 0x00040009, 0x0004000a, 0x00040010] Dim $Gui_Effects_out[9] = [0x00050001, 0x00050002, 0x00050004, 0x00050006, 0x00050005, 0x00050008, 0x00050009, 0x0005000a, 0x00050010] $effect = Random(0, 1, 1) If $effect = 1 Then WinSetTrans($hGUI, "", 0) Else DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hGUI, "int", 500, "short", $Gui_Effects_in[Random(1, 9, 1)]) EndIf GUISetState() If $effect = 1 Then For $i = 1 To 255 Step 2 WinSetTrans($hGUI, "", $i) Sleep(10) Next EndIf Sleep(3500) On_Exit() Func On_Exit() $effect = Random(0, 1, 1) Switch $effect Case 0 For $i = 255 To 0 Step -2 WinSetTrans($hGUI, "", $i) Sleep(5) Next Case 1 $hGUI = GUICreate("Test", $aDimensions[0], $aDimensions[1], Default, Default, $WS_POPUP) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hGUI, "int", 500, "short", $Gui_Effects_out[Random(0, 8, 1)]) Sleep(50) EndSwitch Exit EndFunc BR, UEZ Object creation failed but now i don'T get the error msg don't know what the hell happaned with my cmoputer Link to comment Share on other sites More sharing options...
Unc3nZureD Posted June 23, 2010 Author Share Posted June 23, 2010 hmm the promblem still didn't solved. no1 dunno why is it don't wanna work for me? because i tried everything. is there any problem with the sources? the path is good, the script still exit after i start it. nothing don'T happens. Link to comment Share on other sites More sharing options...
UEZ Posted June 23, 2010 Share Posted June 23, 2010 Can you try the code on a different computer? Or try it with another user id, maybe profile problem. BR, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
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