FrashMX Posted January 23, 2006 Posted January 23, 2006 (edited) Hello there, I tried to reproduce the animated bar of the "classic style logon screen" Windows XP uses. It works, although I have excessive flickering. Any ideas? #include <GuiConstants.au3> GUICreate("Animated bar",680,300,-1,-1) $bar=GUICtrlCreatePic("./barbg.gif",0,0,680,15) $bar2=GUICtrlCreatePic("./barbg.gif",-680,0,680,15) GUISetState () $count = 0 While 1 While $count <= 680 $count = $count + 10 GUICtrlSetPos ($bar, $count,0) GUICtrlSetPos ($bar2, -680+$count,0) $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit sleep(50) Wend $count = 0 Wend You can find barbg.gif in the attachment. Thanks in advance! Edited January 23, 2006 by FrashMX
Valik Posted January 23, 2006 Posted January 23, 2006 You might try something like getting the handles of the controls (GUICtrlGetHandle in the latest betas) and then use that handle in WinMove().
GaryFrost Posted January 23, 2006 Posted January 23, 2006 (edited) You might try something like getting the handles of the controls (GUICtrlGetHandle in the latest betas) and then use that handle in WinMove(). I would think ControlMove would work better instead of moving the whole window Made a solid bar so only have to move one graphic, and set the sleep a little higher #include <GuiConstants.au3> $gui = GUICreate("Animated bar", 680, 300, -1, -1) $bar = GUICtrlCreatePic("barbg-1.gif", 0, 0, 680, 15) $bar2 = GUICtrlCreatePic("barbg.gif", -680, 0, 680, 15) GUISetState() $count = 0 While 1 While $count <= 680 * 2 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit $count = $count + 10 ;GUICtrlSetPos ($bar, $count,0) ControlMove($gui, "", $bar2, -680 + $count, 0) ;GUICtrlSetPos ($bar2, -680+$count,0) Sleep(100) WEnd $count = 0 WEnd http://www.autoitscript.com/fileman/users/gafrost/barbg-1.JPG Edited January 23, 2006 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
Valik Posted January 23, 2006 Posted January 23, 2006 Gary, re-read. I didn't say move the whole window, I said get a handle to the control and use WinMove() on the control. It will move the control, not the whole window.
GaryFrost Posted January 23, 2006 Posted January 23, 2006 Gary, re-read. I didn't say move the whole window, I said get a handle to the control and use WinMove() on the control. It will move the control, not the whole window. My bad, little hard to concentrate this morning inner ear problem causing equal Librium offset SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
FrashMX Posted January 23, 2006 Author Posted January 23, 2006 (edited) Thanks for them replies, ima check it out.My bad, little hard to concentrate this morning inner ear problem causing equal Librium offsetThat somehow sounds really annoying.. hope it'll go over soon (w/e it is)Edit 1: Btw I tried both scripts and I still experience (minor) flickering. I might be too perfectionistic in this case hehEdit 2: I noticed the flickering only occurs at certain spots.. it's not like the entire image is flickering Edited January 23, 2006 by FrashMX
Moderators SmOke_N Posted January 25, 2006 Moderators Posted January 25, 2006 Nice Larry... Very Nice (as usual) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
FrashMX Posted January 25, 2006 Author Posted January 25, 2006 (edited) Holy cow, this is simply amazing. Very awesome Larry! For those who are interested, I added a few bars: bar_blue - A bar with blue gradient (Windows XP alike) bar_gray - A bar with a gray gradient (Windows Server alike) bar_gold - A bar with a golden gradient bar_maroon - A bar with a maroon gradientbar_blue.bmpbar_gold.bmpbar_maroon.bmpbar_gray.bmp Edited January 25, 2006 by FrashMX
rush4hire Posted February 24, 2007 Posted February 24, 2007 (edited) I realize this is over a year old, but I like this idea. But how do you use it with a program that sleeps and polls every second? Where do you learn about all these dll calls.. this is so complicated to me now.. $hInst = DllCall("user32.dll", "int", "GetWindowLong", "hWnd", $hwnd, "int", $GWL_HINSTANCE) $hBmp = DllCall("user32.dll", "hwnd", "LoadImage", "hwnd", $hInst[0], "str", $szFile, _ "int", $IMAGE_BITMAP, "int", 0, "int", 0, "int", $LR_LOADFROMFILE) $phWnd = DLLCall("user32.dll","hwnd","GetDlgItem","hwnd",$hWin,"int",$nID) $dc = DllCall("user32.dll","int","GetDC","hwnd",$phWnd[0]) $dc1 = DLLCall("gdi32.dll","int","CreateCompatibleDC","int",$dc[0]) $old = DLLCall("gdi32.dll","hwnd","SelectObject","int",$dc1[0],"hwnd",$hBmp[0]) ????? Also.. I want a thin thing like this to continue orbiting a rectangle.. that would be cool effect Edited February 24, 2007 by rush4hire Decompilable game code manager for Dark Deeds 6 for Warcraft IIIA web broadcast TiVo like thing.. (this example is for 3abn.org)Finally.. AutoIt Pac-Man Digital Hymn Player
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