jftuga Posted June 25, 2005 Posted June 25, 2005 My program is almost finished and I am just about ready to post it to "v3 Scripts and Scraps" as soon as I get this one really nagging bug fixed. I am using transparency and am trying to fade my application in & out depending on its focus. If you look in the OnAdLib() function on line 169, you will notice that FadeOut() and the two FadeIn()'s are commented out because they do not work. Under each of them I have simply changed the transparency, which does work albeit not as pretty. If I comment those lines out and try using the FadeIn() and FadeOut() functions, nothing seems to happen. What am I doing wrong? Since the code is over 300 lines long, I will attach the full source as a zip and only paste in the relative portion of the script. Any help would be greatly appreciated. I am using Windows XP SP2 and the latest AutoIt beta. Thanks, -John expandcollapse popupFunc FadeOut() ;MsgBox(0,"FadeOut","Active:"&$Active & " High:"&$High_Trans & " Default:"&$Default_Trans) for $i = $High_Trans to $Default_Trans step - 10 WinSetTrans($TopWin, "", $i) sleep(10) next endfunc Func FadeIn() ;MsgBox(0,"FadeIn","Active:"&$Active & " Default:"&$Default_Trans & " High:"&$High_Trans ) for $i = $Default_Trans to $High_Trans step + 10 WinSetTrans($TopWin, "", $i) sleep(10) next endfunc Func OnAdLib() ;MsgBox(0,"AdLib", "Active:"&$Active) Dim $pos ; going out of focus If $Active = 1 And Not WinActive($TopWin) Then $pos = MouseGetPos() if $pos[0] > $BoundingBox_A AND $pos[0] < $BoundingBox_X AND _ $pos[1] > $BoundingBox_B AND $pos[1] < $BoundingBox_Y Then return endif ;FadeOut() WinSetTrans($TopWin, "", $Default_Trans) $Active = 0 ; coming in to focus ElseIf $Active = 0 Then $pos = MouseGetPos() if $pos[0] > $BoundingBox_A AND $pos[0] < $BoundingBox_X AND _ $pos[1] > $BoundingBox_B AND $pos[1] < $BoundingBox_Y Then ;FadeIn() WinSetTrans($TopWin, "", $High_Trans) $Active = 1 return endif If WinActive($TopWin) Then ;FadeIn() WinSetTrans($TopWin, "", $High_Trans) $Active = 1 EndIf EndIf EndFuncremote_manager_v6.zip Admin_Popup, show computer info or launch shellRemote Manager, facilitates connecting to RDP / VNCProc_Watch, reprioritize cpu intensive processesUDF: _ini_to_dict, transforms ini file entries into variablesUDF: monitor_resolutions, returns resolutions of multiple monitorsReport Computer Problem, for your IT help deskProfile Fixer, fixes a 'missing' AD user profile
jftuga Posted June 25, 2005 Author Posted June 25, 2005 Larry, Wow, AnimateWindow is really cool! However, I think there is a bug in my code. In previous versions fading worked. But I refactored the code and cleaned it up a bit. Afterwards, it didn't work. :-( I wish I could get it working without having to use AnimateWindow, but if there is no other choice then I will use it. -John Admin_Popup, show computer info or launch shellRemote Manager, facilitates connecting to RDP / VNCProc_Watch, reprioritize cpu intensive processesUDF: _ini_to_dict, transforms ini file entries into variablesUDF: monitor_resolutions, returns resolutions of multiple monitorsReport Computer Problem, for your IT help deskProfile Fixer, fixes a 'missing' AD user profile
GaryFrost Posted June 25, 2005 Posted June 25, 2005 expandcollapse popupFunc FadeOut() ;MsgBox(0,"FadeOut","Active:"&$Active & " High:"&$High_Trans & " Default:"&$Default_Trans) for $i = Int($High_Trans) to Int($Default_Trans) step - 10 WinSetTrans($TopWin, "", $i) sleep(10) next endfunc Func FadeIn() ;MsgBox(0,"FadeIn","Active:"&$Active & " Default:"&$Default_Trans & " High:"&$High_Trans ) for $i = Int($Default_Trans) to Int($High_Trans) step + 10 WinSetTrans($TopWin, "", $i) sleep(10) next endfunc Func OnAdLib() ;MsgBox(0,"AdLib", "Active:"&$Active) Dim $pos ; going out of focus If $Active = 1 And Not WinActive($TopWin) Then $pos = MouseGetPos() if $pos[0] > $BoundingBox_A AND $pos[0] < $BoundingBox_X AND _ $pos[1] > $BoundingBox_B AND $pos[1] < $BoundingBox_Y Then return endif FadeOut() ; WinSetTrans($TopWin, "", $Default_Trans) $Active = 0 ; coming in to focus ElseIf $Active = 0 Then $pos = MouseGetPos() if $pos[0] > $BoundingBox_A AND $pos[0] < $BoundingBox_X AND _ $pos[1] > $BoundingBox_B AND $pos[1] < $BoundingBox_Y Then FadeIn() ; WinSetTrans($TopWin, "", $High_Trans) $Active = 1 return endif If WinActive($TopWin) Then FadeIn() ; WinSetTrans($TopWin, "", $High_Trans) $Active = 1 EndIf EndIf EndFunc Gary SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
jftuga Posted June 25, 2005 Author Posted June 25, 2005 Man that stumped me because I was using MsgBox() to debug it and the values looked right. I never considered that they may be strings and not ints. Thanks!! -John Admin_Popup, show computer info or launch shellRemote Manager, facilitates connecting to RDP / VNCProc_Watch, reprioritize cpu intensive processesUDF: _ini_to_dict, transforms ini file entries into variablesUDF: monitor_resolutions, returns resolutions of multiple monitorsReport Computer Problem, for your IT help deskProfile Fixer, fixes a 'missing' AD user profile
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