JellyFish666 Posted June 22, 2008 Posted June 22, 2008 Alright I doubt this will protect your screen and isn't really a screen saver, but it did entertain me for a bit. #include <Misc.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> HotKeySet("{ESC}" , "_Exit") $Amount = -50 $GUI = GUICreate("", @DesktopWidth +50, @DesktopHeight +50, -1, -1, $WS_POPUP);, $WS_EX_TOPMOST) GUISetBkColor(0x000000) GUISetState() While 1 _Screen() WEnd Func _Screen() If $Amount = @DesktopWidth +50 Then $Amount = 0 Else $Random = Random(0x000000, 0xFFFFFF) $Amount = $Amount +1 GUICtrlCreateGraphic($Amount , 0, 1, @DesktopHeight + 50) GUICtrlSetColor(-1, $Random) GUICtrlSetBkColor(-1, $Random) EndIf EndFunc Func _Exit() Exit EndFunc
metalicaman8 Posted June 23, 2008 Posted June 23, 2008 I used this as a template to make another program that should run a gradient across the screen. This is my code. When I run it it displays only a blue gradient. Originally The binary in declaring the global was not there but I put it there in an attempt to solve my problem. include <Misc.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> HotKeySet("{ESC}" , "_Exit") Global $count = -50 Global $Random = Binary(0x000000) $GUI = GUICreate("", @DesktopWidth +50, @DesktopHeight +50, -1, -1, $WS_POPUP);, $WS_EX_TOPMOST) GUISetBkColor(0x000000) GUISetState() While 1 $count = 0 Do _Screen() Sleep(10) $count = $count +1 $Random = $Random +1 Until $count >= @DesktopWidth +50 Sleep(1000) $count = 0 WEnd Func _Screen() ToolTip($Random, 5,5) ;~ $Random = Random(0x000000, 0xFFFFFF) GUICtrlCreateGraphic($count , 0, 1, @DesktopHeight +50) ;~ GUICtrlSetColor(-1, $Random) GUICtrlSetBkColor(-1, $Random) EndFunc Func _Exit() Exit EndFunc [center]Take the Magic: The Gathering 'What Color Are You?' Quiz.[/center]
sandin Posted June 23, 2008 Posted June 23, 2008 maybe you'll like this : #include <Misc.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> HotKeySet("{ESC}" , "_Exit") $divider = 2 ;you can change this value, it's the size of the square, min = 2, max = @DesktopWidth $GUI = GUICreate("", @DesktopWidth , @DesktopHeight, 0, 0, $WS_POPUP);, $WS_EX_TOPMOST) GUISetBkColor(0) GUISetState() While 1 _Screen2() Sleep(10) WEnd func _Screen2() $Random_x = Random(0, @DesktopWidth/$divider, 1) $Random_y = Random(0, @DesktopHeight/$divider, 1) if PixelGetColor($Random_x*$divider+$divider/2, $Random_y*$divider+$divider/2) = 0 Then $Random = Random(0x000000, 0xFFFFFF) GUICtrlCreateGraphic($Random_x*$divider, $Random_y*$divider, $divider, $divider) GUICtrlSetBkColor(-1, $Random) EndIf EndFunc Func _Exit() Exit EndFunc Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll
UPSman2 Posted June 23, 2008 Posted June 23, 2008 (edited) maybe you'll like this :oddly enough... thats interesting to me... lol Edited June 23, 2008 by UPSman2
smashly Posted June 23, 2008 Posted June 23, 2008 (edited) Hi JellyFish666, I like the concept, but running your script leaves my CPU usage @ 80%+ and it also chews a lot of memory if you leave it running for any great length of time. The memory use is because your creating a graphics control every loop and never deleting them. which means a memory blowout at some point. The cpu usage there's no sleep in between creating the controls. Here's something similar using gdiplusexpandcollapse popup#include <Misc.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> Global $speed = 10 ; Bigger the number faster the lines are drawn and more cpu usage. Global $hGUI, $hWnd, $hGraphic, $hPen, $vDir, $vCnt, $hDir, $hCnt, $iDir, $i $hGUI = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP) GUISetBkColor(0) GUISetState() _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) $hPen = _GDIPlus_PenCreate() While Not _IsPressed("1B") Sleep(20) Do _GDIPlus_Line() $i += 1 Until ($i = $speed) $i = 0 WEnd _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() Func _GDIPlus_Line() _GDIPlus_PenSetColor($hPen, StringReplace(Hex(Random(0x000000, 0xFFFFFF)), "00", "0xFF", 1)) If $vCnt = @DesktopWidth + 1 Then $vDir = 1 If $vCnt = -1 Then $vDir = 0 If $hCnt = @DesktopHeight + 1 Then $hDir = 1 If $hCnt = -1 Then $hDir = 0 If $iDir = 0 Then _GDIPlus_GraphicsDrawLine($hGraphic, $vCnt, 0, $vCnt, @DesktopHeight, $hPen) If $vDir = 0 Then $vCnt += 1 If $vDir = 1 Then $vCnt -= 1 If $vCnt = @DesktopWidth + 1 Or $vCnt = -1 Then $iDir = 1 ElseIf $iDir = 1 Then _GDIPlus_GraphicsDrawLine($hGraphic, 0, $hCnt, @DesktopWidth , $hCnt, $hPen) If $hDir = 0 Then $hCnt += 1 If $hDir = 1 Then $hCnt -= 1 If $hCnt = @DesktopHeight + 1 Or $hCnt = -1 Then $iDir = 0 EndIf EndFunc ;==>_GDIPlus_Line Cheers Edited June 23, 2008 by smashly
JellyFish666 Posted June 23, 2008 Author Posted June 23, 2008 (edited) Hi JellyFish666, I like the concept, but running your script leaves my CPU usage @ 80%+ and it also chews a lot of memory if you leave it running for any great length of time. The memory use is because your creating a graphics control every loop and never deleting them. which means a memory blowout at some point. The cpu usage there's no sleep in between creating the controls. Here's something similar using gdiplusexpandcollapse popup#include <Misc.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> Global $speed = 10 ; Bigger the number faster the lines are drawn and more cpu usage. Global $hGUI, $hWnd, $hGraphic, $hPen, $vDir, $vCnt, $hDir, $hCnt, $iDir, $i $hGUI = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP) GUISetBkColor(0) GUISetState() _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) $hPen = _GDIPlus_PenCreate() While Not _IsPressed("1B") Sleep(20) Do _GDIPlus_Line() $i += 1 Until ($i = $speed) $i = 0 WEnd _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() Func _GDIPlus_Line() _GDIPlus_PenSetColor($hPen, StringReplace(Hex(Random(0x000000, 0xFFFFFF)), "00", "0xFF", 1)) If $vCnt = @DesktopWidth + 1 Then $vDir = 1 If $vCnt = -1 Then $vDir = 0 If $hCnt = @DesktopHeight + 1 Then $hDir = 1 If $hCnt = -1 Then $hDir = 0 If $iDir = 0 Then _GDIPlus_GraphicsDrawLine($hGraphic, $vCnt, 0, $vCnt, @DesktopHeight, $hPen) If $vDir = 0 Then $vCnt += 1 If $vDir = 1 Then $vCnt -= 1 If $vCnt = @DesktopWidth + 1 Or $vCnt = -1 Then $iDir = 1 ElseIf $iDir = 1 Then _GDIPlus_GraphicsDrawLine($hGraphic, 0, $hCnt, @DesktopWidth , $hCnt, $hPen) If $hDir = 0 Then $hCnt += 1 If $hDir = 1 Then $hCnt -= 1 If $hCnt = @DesktopHeight + 1 Or $hCnt = -1 Then $iDir = 0 EndIf EndFunc ;==>_GDIPlus_LineoÝ÷ Ø(^z»?ªê-{ 0¶±ìZrÙrÂ"y¢æî¶ -nÞu·jëܲÚ,ØhºHw°)¶Á«'ßÛmæÞ²Üʦlº·¦k&ÞÝý²;¬¶Ø^Á¬²¢ébëhr^¢¹É·º{.궬v¬nëZé÷öÛazǬ¶¬jgºÚ"µÍ[[ ÌÍÚHH ÌÍÜÜYY oÝ÷ Ù«¢+ÙU¹Ñ¥°ÀÌØí¤ôÀÌØíÍÁ Edited June 23, 2008 by JellyFish666
smashly Posted June 23, 2008 Posted June 23, 2008 Yep they're the same, just a pointless intermittent habit, be it bad or good I'm not sure But it does no harm
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