PhoenixXL Posted June 30, 2012 Posted June 30, 2012 (edited) Hey every1 I always used to make the GUI appear through a transparency of 0 to 255 (Fading Effect) I wished i could have zoomed it while fading it when i try to zoom the GUI, the control flickers Is there a Possible solution Code: expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.8.1 Author: Abhishek Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- //#include-once //#include <WindowsConstants.au3> //#include <WinAPI.au3> //#include <GDIPlus.au3> //#include <GUIConstantsEx.au3> ; get height of window title and width of window frame - may be different when XP theme is ON/OFF Global $htit = _WinAPI_GetSystemMetrics($SM_CYCAPTION) Global $frame = _WinAPI_GetSystemMetrics($SM_CXDLGFRAME) ConsoleWrite('Height:'&$htit&' Frame:'&$frame&@CRLF&@CRLF) $gui=GUICreate('',100,100,-1,-1,-1,0) GUISetState() GUISetBkColor(0) Sleep(10) $hwnd=GUICtrlCreateLabel('Dust',10,10,80,80) GUICtrlSetBkColor(-1,0xffffff) GUICtrlSetResizing(-1, 102) $hwnd=GUICtrlGetHandle(-1) _Zoom($gui,300,200,-1) Sleep(3000) Func _Zoom($sHwnd,$iW=500,$iH=500,$nSpeed=-1) Local $Pos=WinGetPos($sHwnd) ConsoleWrite('X:'&$Pos[0]&' Y:'&$Pos[1]&' W:'&$Pos[2]&' H:'&$Pos[3]&@CRLF&@CRLF) Local $hOffset,$wOffset,$nTimes If $iH>$iW Then $wOffset=1 $hOffset=$iH/$iW $nTimes=$iW ElseIf $iH<$iW Then $wOffset=$iW/$iH $hOffset=1 $nTimes=$iH Else $hOffset=1 $wOffset=1 $nTimes=$iH EndIf $Pos=WinGetPos($sHwnd) $iH=0 $iW=0 For $i=1 To $nTimes $iH+=$hOffset $iW+=$wOffset WinMove($sHwnd,'',$iW/2+($Pos[0]-$iW),$iH/2+($Pos[1]-$iH),$iW,$iH,$nSpeed) Next $Pos=WinGetPos($sHwnd) ConsoleWrite('X:'&$Pos[0]&' Y:'&$Pos[1]&' W:'&$Pos[2]&' H:'&$Pos[3]&@CRLF&@CRLF) EndFunc Please guide me in the right direction Edited June 30, 2012 by PhoenixXL My code: Reveal hidden contents PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
Skitty Posted June 30, 2012 Posted June 30, 2012 (edited) Try using the clip children style on it like this expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.8.1 Author: Abhishek Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- #include-once #include <WindowsConstants.au3> #include <WinAPI.au3> #include <GDIPlus.au3> #include <GUIConstantsEx.au3> Global $MyStyle = BitOR($WS_CAPTION, $WS_SYSMENU, $WS_THICKFRAME, $WS_MINIMIZEBOX, $WS_MAXIMIZEBOX, $WS_CLIPCHILDREN) ; get height of window title and width of window frame - may be different when XP theme is ON/OFF Global $htit = _WinAPI_GetSystemMetrics($SM_CYCAPTION) Global $frame = _WinAPI_GetSystemMetrics($SM_CXDLGFRAME) ConsoleWrite('Height:' & $htit & ' Frame:' & $frame & @CRLF & @CRLF) $gui = GUICreate('', 100, 100, -1, -1, $MyStyle) GUISetState() GUISetBkColor(0) Sleep(10) $hwnd = GUICtrlCreateLabel('Dust', 10, 10, 80, 80) GUICtrlSetBkColor(-1, 0xffffff) GUICtrlSetResizing(-1, 102) $hwnd = GUICtrlGetHandle(-1) _Zoom($gui, 300, 200, -1) Sleep(3000) Func _Zoom($sHwnd, $iW = 500, $iH = 500, $nSpeed = -1) Local $Pos = WinGetPos($sHwnd) ConsoleWrite('X:' & $Pos[0] & ' Y:' & $Pos[1] & ' W:' & $Pos[2] & ' H:' & $Pos[3] & @CRLF & @CRLF) Local $hOffset, $wOffset, $nTimes If $iH > $iW Then $wOffset = 1 $hOffset = $iH / $iW $nTimes = $iW ElseIf $iH < $iW Then $wOffset = $iW / $iH $hOffset = 1 $nTimes = $iH Else $hOffset = 1 $wOffset = 1 $nTimes = $iH EndIf $Pos = WinGetPos($sHwnd) $iH = 0 $iW = 0 GUISetStyle($MyStyle, -1, $gui); Set back to normal For $i = 1 To $nTimes $iH += $hOffset $iW += $wOffset WinMove($sHwnd, '', $iW / 2 + ($Pos[0] - $iW), $iH / 2 + ($Pos[1] - $iH), $iW, $iH, $nSpeed) Next GUISetStyle(BitAND($MyStyle, BitNOT($WS_CLIPCHILDREN)), -1, $gui); remove the clip children style $Pos = WinGetPos($sHwnd) ConsoleWrite('X:' & $Pos[0] & ' Y:' & $Pos[1] & ' W:' & $Pos[2] & ' H:' & $Pos[3] & @CRLF & @CRLF) EndFunc ;==>_Zoom Edited July 6, 2012 by ApudAngelorum Parsix 1
PhoenixXL Posted July 1, 2012 Author Posted July 1, 2012 (edited) This code doesnt work the label is still flickering Code :expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.8.1 Author: Abhishek Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- #include-once #include <WindowsConstants.au3> #include <WinAPI.au3> #include <GDIPlus.au3> #include <GUIConstantsEx.au3> ; get height of window title and width of window frame - may be different when XP theme is ON/OFF Global $htit = _WinAPI_GetSystemMetrics($SM_CYCAPTION) Global $frame = _WinAPI_GetSystemMetrics($SM_CXDLGFRAME) ConsoleWrite('Height:'&$htit&' Frame:'&$frame&@CRLF&@CRLF) $gui=GUICreate('',100,100,-1,-1, BitOR($GUI_SS_DEFAULT_GUI,$WS_CLIPCHILDREN),0) GUISetState() GUISetBkColor(0) Sleep(10) $hwnd=GUICtrlCreateLabel('Dust',10,10,80,80) GUICtrlSetBkColor(-1,0xffffff) GUICtrlSetResizing(-1, 102) $hwnd=GUICtrlGetHandle(-1) _Zoom($gui,300,200,-1) Sleep(3000) Func _Zoom($sHwnd,$iW=500,$iH=500,$nSpeed=-1) Local $Pos=WinGetPos($sHwnd) ConsoleWrite('X:'&$Pos[0]&' Y:'&$Pos[1]&' W:'&$Pos[2]&' H:'&$Pos[3]&@CRLF&@CRLF) Local $hOffset,$wOffset,$nTimes If $iH>$iW Then $wOffset=1 $hOffset=$iH/$iW $nTimes=$iW ElseIf $iH<$iW Then $wOffset=$iW/$iH $hOffset=1 $nTimes=$iH Else $hOffset=1 $wOffset=1 $nTimes=$iH EndIf $Pos=WinGetPos($sHwnd) $iH=0 $iW=0 For $i=1 To $nTimes $iH+=$hOffset $iW+=$wOffset WinMove($sHwnd,'',$iW/2+($Pos[0]-$iW),$iH/2+($Pos[1]-$iH),$iW,$iH,$nSpeed) Next $Pos=WinGetPos($sHwnd) ConsoleWrite('X:'&$Pos[0]&' Y:'&$Pos[1]&' W:'&$Pos[2]&' H:'&$Pos[3]&@CRLF&@CRLF) EndFunc Edited July 7, 2012 by PhoenixXL My code: Reveal hidden contents PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
PhoenixXL Posted July 6, 2012 Author Posted July 6, 2012 anyone ? My code: Reveal hidden contents PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
Skitty Posted July 6, 2012 Posted July 6, 2012 (edited) On 7/6/2012 at 5:37 PM, 'PhoenixXL said: anyone ?What operating system are you using?Something tells me you're using vista 64bit right?And just to note this, the reply you made where you said "Your COde", that is not the code I had posted Edited July 6, 2012 by ApudAngelorum
czardas Posted July 6, 2012 Posted July 6, 2012 You may be able to stop it happening using the window style $WS_EX_COMPOSITED when creating the GUI. operator64 ArrayWorkshop
Skitty Posted July 6, 2012 Posted July 6, 2012 On 7/6/2012 at 6:11 PM, 'czardas said: You may be able to stop it happening using the window style $WS_EX_COMPOSITED when creating the GUI.Yes, that too, but I don't mention it since I've had trouble with that style, in example, if you have more than 3-10 windows in one ui, resizing causes some strange anomalies, I'm pretty sure you know what I mean, but in PhoenixXLs case, hopefully, it might not be a problem if using only a few controls.I think there is also a problem with that style and having a list view control in the ui as well.
czardas Posted July 6, 2012 Posted July 6, 2012 On 7/6/2012 at 6:14 PM, 'ApudAngelorum said: if you have more than 3-10 windows in one ui, resizing causes some strange anomalies, I'm pretty sure you know what I mean,I think there is also a problem with that style and having a list view control in the ui as well.I was not aware of these things. I'll bear it in mind if I come across issues. Thanks. operator64 ArrayWorkshop
Skitty Posted July 6, 2012 Posted July 6, 2012 Yes, I became aware of this when creating the SciTE clone script thing, I was using windows and controls left and right, until I resized the window and BOOM.100% CPU usage everywhere.And searching the style name on the forums brought up other users with that style. More n But it seems that if you're using that style for something frivolous and simple, then give it a go.
PhoenixXL Posted July 7, 2012 Author Posted July 7, 2012 thnx to both of u$WS_EX_COMPOSITED solved the problemmaybe there would be problems ahead Quote And just to note this, the reply you made where you said "Your COde", that is not the code I had posted My mistake edited that BTW I use win7 32bit My code: Reveal hidden contents PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
PhoenixXL Posted July 7, 2012 Author Posted July 7, 2012 (edited) Working code expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.8.1 Author: Abhishek Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- #include-once #include <WindowsConstants.au3> #include <WinAPI.au3> #include <GDIPlus.au3> #include <GUIConstantsEx.au3> ; get height of window title and width of window frame - may be different when XP theme is ON/OFF Global $htit = _WinAPI_GetSystemMetrics($SM_CYCAPTION) Global $frame = _WinAPI_GetSystemMetrics($SM_CXDLGFRAME) ConsoleWrite('Height:'&$htit&' Frame:'&$frame&@CRLF&@CRLF) $gui=GUICreate('',100,100,-1,-1, BitOR($GUI_SS_DEFAULT_GUI,$WS_CLIPCHILDREN),$WS_EX_COMPOSITED) GUISetState() GUISetBkColor(0) Sleep(10) $hwnd=GUICtrlCreateLabel('Dust',10,10,80,80) GUICtrlSetBkColor(-1,0xffffff) GUICtrlSetResizing(-1, 102) $hwnd=GUICtrlGetHandle(-1) _Zoom($gui,300,200,1) Sleep(3000) Func _Zoom($sHwnd,$iW=500,$iH=500,$nSpeed=-1) Local $Pos=WinGetPos($sHwnd) ConsoleWrite('X:'&$Pos[0]&' Y:'&$Pos[1]&' W:'&$Pos[2]&' H:'&$Pos[3]&@CRLF&@CRLF) Local $hOffset,$wOffset,$nTimes If $iH>$iW Then $wOffset=1 $hOffset=$iH/$iW $nTimes=$iW ElseIf $iH<$iW Then $wOffset=$iW/$iH $hOffset=1 $nTimes=$iH Else $hOffset=1 $wOffset=1 $nTimes=$iH EndIf $Pos=WinGetPos($sHwnd) $iH=0 $iW=0 For $i=1 To $nTimes $iH+=$hOffset $iW+=$wOffset WinMove($sHwnd,'',$iW/2+($Pos[0]-$iW),$iH/2+($Pos[1]-$iH),$iW,$iH,$nSpeed) Next $Pos=WinGetPos($sHwnd) ConsoleWrite('X:'&$Pos[0]&' Y:'&$Pos[1]&' W:'&$Pos[2]&' H:'&$Pos[3]&@CRLF&@CRLF) EndFunc Edited July 7, 2012 by PhoenixXL My code: Reveal hidden contents PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.
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