Jump to content

SpalshScreen [solved]


Recommended Posts

so i tried on an other computer.

it worked:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

HotKeySet("{ESC}", "On_Exit")

$sPicPath = "c:\asd.jpg"

$sDimensions = ""
$oShellApp = ObjCreate("shell.application")
If IsObj($oShellApp) Then
    Local $oDir = $oShellApp.NameSpace("C:\")
    If IsObj($oDir) Then
    Local $oFile = $oDir.Parsename("asd.jpg")
    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

but if I start it on my computer then it write: object creation failed. ive got net framework 4, GeForce 9600 GT (driver and others installed), it can'T create that objeeecct aargh! -.-" i'm so angry. whyyyyy!? LoL really don'T know...

Edited by Unc3nZureD
Link to comment
Share on other sites

Sure, use

$hGUI = GUICreate("Test", $aDimensions[0], $aDimensions[1], Default, Default, $WS_POPUP, $WS_EX_TOPMOST)

instead.

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

If you have 2 windows which are both topmost, which one will be "the one" being topmost?

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

If you have 2 windows which are both topmost, which one will be "the one" being topmost?

BR,

UEZ

don'T really understand. i want to let it always on the top. So if I put a simple total commander or firefox, let it be visible.because if I activate the window, the script will be on the background. Is it possible?

(and sorry for bad english sometimes)

Link to comment
Share on other sites

What he means is this:

If another Window you have opened (not necessisarily one of yours) already has Always on Top set then there is no way to be sure that yours will be the one on top. Windows will get confused and make an arbitrary decision about which will really be top most.

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

You also might want to try forcing it right after the GUISetState()

WinSetOnTop($hGUI) but even that may not work for the same reason outlined above.

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

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