; ; AutoIt Version: 3.0 ;----------------------------------------------------------------------- ; Language: English ; Platform: Win9x/NT ; Author: Michael Bee ;----------------------------------------------------------------------- ; Script Function: ; Opens MSPAINT (AKA PBRUSH) with a .bmp file and "tile" desktop ;----------------------------------------------------------------------- Dim $Debug ;$Debug="Y" ; Func Tile() Dim $cmdLineRaw_Check ; Dim $vFileSpecArr Dim $vFileSpecArr_UBound Dim $vFileSpec_Short ; Dim $vFileSpec_Full ; $cmdLineRaw_Check=$CmdLineRaw ; If $Debug="Y" Then MsgBox ( 4096, @ScriptName, "$cmdLineRaw_Check[" & $cmdLineRaw_Check & "]", 15) ; Dim $sExt If stringInstr(stringLower($cmdLineRaw),".au3")>0 Then $sExt=".au3" Else If stringInstr(stringLower($cmdLineRaw),".exe")>0 Then $sExt=".exe" EndIf Endif $vFileSpec_Full= _ chr(34) & _ stringMid( _ $cmdLineRaw, _ stringInStr( _ stringLower($cmdLineRaw), _ $sExt) , _ stringLen($cmdLineRaw) - stringInStr( _ stringLower($cmdLineRaw), _ $sExt) + 1 _ ) & _ chr(34) ; If $Debug="Y" Then MsgBox ( 4096, @ScriptName, "$vFileSpec_Full[" & $vFileSpec_Full & "]", 15) ; $vFileSpecArr=stringsplit($vFileSpec_Full,"\") $vFileSpecArr_UBound=UBound($vFileSpecArr) - 1 $vFileSpec_Short=$vFileSpecArr[$vFileSpecArr_UBound] $vFileSpec_Short=stringreplace($vFileSpec_Short,chr(34),"") ; If $Debug="Y" Then MsgBox ( 4096, @ScriptName, "$vFileSpec_Short[" & $vFileSpec_Short & "]", 15) ; Run("mspaint.exe " & $vFileSpec_Full) ; $vFound=WinWaitActive($vFileSpec_Short & " - Paint","",15) ; If $Debug="Y" Then MsgBox ( 4096, @ScriptName, "$vFound[" & $vFound & "]", 15) ; If $vFound=1 Then Send("!FB") sleep(250) Send("!FX") sleep(250) Else MsgBox ( 16+4096, @ScriptName, "Failed to launch paint in enough time...", 15) EndIf EndFunc ;-------------------------------------------------------------------------------------------------------- BlockInput(1) Tile() BlockInput(0) ;----------------------------------------------------------------------- exit ;-----------------------------------------------------------------------