ezzetabi Posted June 22, 2005 Posted June 22, 2005 (edited) I sometime watch movies using my computer and so I made this little script for making the screen black all around the movie window. To start: Start it, start the movie, press CTRL. To finish: click in the black, press ALT-F4. expandcollapse popup#include <GUIConstants.au3> Opt ('MustDeclareVars', 1) Opt ('TrayIconHide', 1) Local $NullGifFile = "47494638396105000500830000000000800000008000808000000080" & _ "800080008080C0C0C0808080FF000000FF00FFFF000000FFFF00FF00" & _ "FFFFFFFFFF21F9040300000F002C0000000005000500000406F0C949ABA511003B" Local $Style = $WS_POPUP Local $ExStyle = BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST, $WS_EX_TOOLWINDOW) Local $hHandle, $aCCC GUISetBkColor(0, GUICreate('', @DesktopWidth, @DesktopHeight, 0, 0, $Style, $ExStyle, 0)) FileDelete(@ScriptDir & '\null.gif') _CreateFile($NullGifFile, @ScriptDir & '\null.gif') If FileExists(@ScriptDir & '\null.gif') Then Do $hHandle = _WaitTheWindow() $aCCC = WinGetPos($hHandle) Until Not @error GUICtrlCreatePic('null.gif', $aCCC[0], $aCCC[1], $aCCC[2], $aCCC[3], -1, -1) FileDelete(@ScriptDir & '\null.gif') GUISetState() While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd EndIf Exit Func _WaitTheWindow() While _IsPressed(0x11) = 0 ToolTip('Activate the window and press "Ctrl".') Sleep(1) WEnd ToolTip('') Return WinGetHandle('') EndFunc ;==>_WaitTheWindow Func _IsPressed($hexKey) Local $aR = DllCall("user32", "int", "GetAsyncKeyState", "int", $hexKey) If Not @error And BitAND($aR[0], 0x8000) = 0x8000 Then Return 1 Else Return 0 EndIf EndFunc ;==>_IsPressed Func _CreateFile($sHexData, $sFileName) Local $dllKernel32 = DllOpen("kernel32.dll") Local $nStrSize = StringLen($sHexData) Local $p = DllStructCreate ("ubyte[" & $nStrSize / 2 & "]") For $i = 1 To $nStrSize Step 2 DllStructSetData ($p, 1, Dec(StringMid($sHexData, $i, 2)) , ($i + 1) / 2) Next Local $ret = DllCall($dllKernel32, "int", "CreateFile", _ "str", $sFileName, _ "int", 0x40000000, _ "int", 1, _ "ptr", 0, _ "int", 4, _ "int", 0x80, _ "ptr", 0) DllCall($dllKernel32, "int", "WriteFile", _ "int", $ret[0], _ "ptr", DllStructGetPtr ($p), _ "int", $nStrSize / 2, _ "int_ptr", 0, _ "ptr", 0) DllCall($dllKernel32, "int", "CloseHandle", "int", $ret[0]) DllClose($dllKernel32) EndFunc ;==>_CreateFile Edited June 23, 2005 by ezzetabi
layer Posted June 22, 2005 Posted June 22, 2005 Haha, that's a really neat script Keep it up. Actually, pretty usefull too, because watching movies on the computer is like, next generation stuff here! FootbaG
layer Posted June 22, 2005 Posted June 22, 2005 ?<{POST_SNAPBACK}>get it? $aHole? asshole? BTW,what is $HoleFile? what is all that Chr stuff? FootbaG
Lazycat Posted June 22, 2005 Posted June 22, 2005 what is $HoleFile? what is all that Chr stuff?I think this is should be some GIF file, but it is created wrong for me.Anyway, not surely understand script purpose - isn't any player can expand movie to fullscren? Or you watch movies in small window? Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s])
ezzetabi Posted June 22, 2005 Author Posted June 22, 2005 (edited) I watch movies in a small window. I can't focus to the whole screen surface as I like. Secondly, some movies fullscreen become too pixelated. Edit: Since LazyCat have some problems with the creationg of the gif file I changed the script, put the script and the attached .gif file in the same folder. Edited June 22, 2005 by ezzetabi
Lazycat Posted June 23, 2005 Posted June 23, 2005 (edited) Yes, now it works Here a simple function that should correctly write gif:Func _CreateNullGif() Local $sHexData = "47494638396105000500830000000000800000008000808000000080" &_ "800080008080C0C0C0808080FF000000FF00FFFF000000FFFF00FF00" & _ "FFFFFFFFFF21F9040300000F002C0000000005000500000406F0C949ABA511003B" Local $nStrSize = StringLen($sHexData) Local $p = DllStructCreate("byte[" & $nStrSize/2 & "]") For $i = 1 To $nStrSize Step 2 DllStructSetData($p, 1, Dec(StringMid($sHexData, $i, 2)), ($i+1)/2) Next Local $ret = DllCall("kernel32.dll","int","CreateFile",_ "str","null1.gif",_ "int",0x40000000,_ "int",1,_ "ptr",0,_ "int",4,_ "int",0x80,_ "ptr",0) DllCall("kernel32.dll","int","WriteFile",_ "int",$ret[0],_ "ptr",DllStructGetPtr($p),_ "int",$nStrSize/2,_ "int_ptr",0,_ "ptr",0) DllCall("kernel32.dll","int","CloseHandle","int",$ret[0]) EndFuncEdit: wordwrap Edited June 23, 2005 by Lazycat Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s])
ezzetabi Posted June 23, 2005 Author Posted June 23, 2005 (edited) Thanks to the most excellent LazyCat func, a new version! It is interesting how to a simple .gif file makes a hole in the gui so easily... Edited June 23, 2005 by ezzetabi
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