komalo Posted October 19, 2008 Share Posted October 19, 2008 (edited) hi my probelm is when i use WS_EX_LAYERED and use ControlMove as in this code the picture get flushed just run the script and drag the pic and you will see it . #include <misc.au3> #include <GuiConstants.au3> #include <WindowsConstants.au3> $gui = GUICreate("aaaa",500,400,100,100,-1,$WS_EX_LAYERED) $ip = GUICtrlCreatePic(@WindowsDir & "\Web\Wallpaper\Bliss.bmp", 0, 0, @DesktopWidth, @DesktopHeight, -1) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_PRIMARYDOWN $nc = GUIGetCursorInfo() If $nc[4] = $ip Then $mp = MouseGetPos() $cp = ControlGetPos($gui, "", $ip) While _IsPressed(1) $nm = MouseGetPos() ControlMove($gui, "", $ip, $cp[0] - $mp[0] + $nm[0], $cp[1] - $mp[1] + $nm[1]) WEnd EndIf EndSwitch WEnd Edited October 20, 2008 by komalo [font="Palatino Linotype"][size="3"]AutoIt Script Examples :[/size][/font][font="Palatino Linotype"][size="3"]_CaptureBehindWindowGlass CMD for Windows Vista/Seven[/size][/font][left][/left][font="Palatino Linotype"][size="3"]Non AutoIt Script programs : Border Skin - Aero Glass On XP[/size][/font] Link to comment Share on other sites More sharing options...
ResNullius Posted October 19, 2008 Share Posted October 19, 2008 I believe you need $WS_CLIPCHILDREN $gui = GUICreate("aaaa",500,400,100,100,$WS_CLIPCHILDREN,$WS_EX_LAYERED) Link to comment Share on other sites More sharing options...
komalo Posted October 19, 2008 Author Share Posted October 19, 2008 (edited) thank you very much it worked fine with your style but because i am making image over an image a flushing happen . see updated example of the problem updated : #include <misc.au3> #include <GuiConstants.au3> #include <WindowsConstants.au3> $gui = GUICreate("aaaa",500,400,100,100,$WS_CLIPCHILDREN,$WS_EX_LAYERED) $ip = GUICtrlCreatePic(@WindowsDir & "\Web\Wallpaper\Bliss.bmp", 0, 0, @DesktopWidth, @DesktopHeight, -1) GUICtrlCreatePic(@WindowsDir & "\Web\Wallpaper\Bliss.bmp", 0, 0, @DesktopWidth/10, @DesktopHeight/10, -1) GUISetState() While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_PRIMARYDOWN $nc = GUIGetCursorInfo() If $nc[4] = $ip Then $mp = MouseGetPos() $cp = ControlGetPos($gui, "", $ip) While _IsPressed(1) $nm = MouseGetPos() ControlMove($gui, "", $ip, $cp[0] - $mp[0] + $nm[0], $cp[1] - $mp[1] + $nm[1]) WEnd EndIf EndSwitch WEnd Edited October 19, 2008 by komalo [font="Palatino Linotype"][size="3"]AutoIt Script Examples :[/size][/font][font="Palatino Linotype"][size="3"]_CaptureBehindWindowGlass CMD for Windows Vista/Seven[/size][/font][left][/left][font="Palatino Linotype"][size="3"]Non AutoIt Script programs : Border Skin - Aero Glass On XP[/size][/font] Link to comment Share on other sites More sharing options...
martin Posted October 19, 2008 Share Posted October 19, 2008 thank you very much it worked fine with your stylebut because i am making image over an imagea flushing happen .see updated example of the problemupdated :Create the little pic before the big one, and give the big one ($ip) the style $WS_CLIPSIBLINGS. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
komalo Posted October 19, 2008 Author Share Posted October 19, 2008 (edited) i can't use this style because i am using a BMP with alpha channel (32-Bit) which will not apply its transparency on the picture when $WS_CLIPSIBLINGS style exists , is there another way to stop that flushing ? Edited October 19, 2008 by komalo [font="Palatino Linotype"][size="3"]AutoIt Script Examples :[/size][/font][font="Palatino Linotype"][size="3"]_CaptureBehindWindowGlass CMD for Windows Vista/Seven[/size][/font][left][/left][font="Palatino Linotype"][size="3"]Non AutoIt Script programs : Border Skin - Aero Glass On XP[/size][/font] Link to comment Share on other sites More sharing options...
martin Posted October 19, 2008 Share Posted October 19, 2008 i can't use this style because i am using a BMP with alpha channel (32-Bit) which will not apply its transparency on the picture when $WS_CLIPSIBLINGS style exists , is there another way to stop that flushing ?Various ways but if this next idea doesn't work then they get more complicated. Instead of giving the pic the style $WS_CLIPSIBLINGS, give the window the extended style $WS_EX_COMPOSITED. Global Const $WS_EX_COMPOSITED = 0x2000000 $gui = GUICreate("aaaa",500,400,100,100,$WS_CLIPCHILDREN, BitOr($WS_EX_COMPOSITED,$WS_EX_LAYERED)) Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
komalo Posted October 20, 2008 Author Share Posted October 20, 2008 (edited) you are the man , really , thank you so much it worked perfectly , that flushing was soooo annoying i don't know why i didn't 't find it when i was searching in msdni understand that you used WS_EX_COMPOSITED because Windows XP: With WS_EX_COMPOSITED set, all descendants of a window get bottom-to-top painting order using double-buffering. Bottom-to-top painting order allows a descendent window to have translucency (alpha) and transparency (color-key) effects, but only if the descendent window also has the WS_EX_TRANSPARENT bit set. Double-buffering allows the window and its descendents to be painted without flicker. Edited October 20, 2008 by komalo [font="Palatino Linotype"][size="3"]AutoIt Script Examples :[/size][/font][font="Palatino Linotype"][size="3"]_CaptureBehindWindowGlass CMD for Windows Vista/Seven[/size][/font][left][/left][font="Palatino Linotype"][size="3"]Non AutoIt Script programs : Border Skin - Aero Glass On XP[/size][/font] Link to comment Share on other sites More sharing options...
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