Jump to content

WS_EX_LAYERED and ControlMove [SOVLED]


komalo
 Share

Recommended Posts

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 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

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 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

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 :

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

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 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

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

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 msdn

i 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 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...