Jump to content

Working with layered window and background gif


qsek
 Share

Recommended Posts

Hi,

I tried several cominations of styles but not get it to work to remove that heavy flickering, if you resize the GUI.

Just run the code and try resizing the 2 GUI's and you see what i mean. (you have to see the desktop)

Only happens when the GUI is a Child to the Desktop. Its oviously a matter of the right Window Styles.

Who can help?

PS: You need grey.gif : post-23419-1185734417_thumb.gif

#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)  ; Change to OnEvent mode

$hWnd = ControlGetHandle("Program Manager", "", "SysListView321")

; -------------------GUI 1 (Strange Drawing effect)--------------------

$style   = BitOR($WS_CLIPCHILDREN, $WS_SIZEBOX,$WS_THICKFRAME,$WS_DLGFRAME) ; thin toolbar, just Close Button
$exstyle = BitOR($WS_EX_LAYERED,$WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE)

$controlGUI = GUICreate("ControlGUI", 400, 200, 100, 50, $style, $exstyle)

Opt("WinTitleMatchMode", 4)
DllCall("user32.dll", "int", "SetParent", "hwnd", $controlGui, "hwnd", WinGetHandle("classname=Progman")) ; Set Window as Destop Child

$pic = GUICtrlCreatePic(@ScriptDir & "\grey.gif",0,0,2000,2000,$SS_CENTERIMAGE)
GuiCtrlSetState(-1,$GUI_DISABLE)

$button = GUICtrlCreateButton("test1234567",10,10)

$label = GUICtrlCreateLabel("Strange Drawing effect",110,12,140,50)
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1,0xFFFFFF)

GUISetState()
GUISetOnEvent($GUI_EVENT_CLOSE, "ExitScript")
GUICtrlSetOnEvent($button, "msg")
; -------------------GUI 2 (Extreme Flicker)--------------------
$style   = BitOR($WS_SIZEBOX,$WS_THICKFRAME,$WS_DLGFRAME) ; $WS_CLIPCHILDREN makes the flicker
$exstyle = BitOR($WS_EX_LAYERED,$WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE)

$controlGUI = GUICreate("ControlGUI", 400, 200, 650, 50, $style, $exstyle)

Opt("WinTitleMatchMode", 4)
DllCall("user32.dll", "int", "SetParent", "hwnd", $controlGui, "hwnd", WinGetHandle("classname=Progman")) ; Set Window as Destop Child

$pic = GUICtrlCreatePic(@ScriptDir & "\grey.gif",0,0,2000,2000,$SS_CENTERIMAGE)
GuiCtrlSetState(-1,$GUI_DISABLE)

$button = GUICtrlCreateButton("test1234567",10,10)

$label = GUICtrlCreateLabel("Extreme Flicker",110,12,140,50)
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1,0xFFFFFF)

GUISetState()
GUISetOnEvent($GUI_EVENT_CLOSE, "ExitScript")
GUICtrlSetOnEvent($button, "msg")

; -------------------GUI 3 (Smooth resize but not Desktopchild)--------------------

$style   = BitOR($WS_CLIPCHILDREN, $WS_SIZEBOX,$WS_THICKFRAME,$WS_DLGFRAME)
$exstyle = BitOR($WS_EX_LAYERED,$WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE)

$controlGUI = GUICreate("ControlGUI", 400, 200, 100, 350, $style, $exstyle)

$pic = GUICtrlCreatePic(@ScriptDir & "\grey.gif",0,0,2000,2000,$SS_CENTERIMAGE)
GuiCtrlSetState(-1,$GUI_DISABLE)

$button = GUICtrlCreateButton("test1234567",10,10)

$label = GUICtrlCreateLabel("Smooth resize but not Desktopchild",110,12,140,50)
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1,0xFFFFFF)

GUISetState()
GUISetOnEvent($GUI_EVENT_CLOSE, "ExitScript")
GUICtrlSetOnEvent($button, "msg")





While 1
    Sleep(100)
WEnd

Func msg()
    MsgBox(0,0,"buh")
EndFunc

Func ExitScript()
    Exit
EndFunc
Edited by qsek
Teamspeak 3 User Viewer - Quick and functional TS3 Query script, which shows online users.Cached Screenshot Deleter - Deletes older Fraps Screenshots if they exceed a specified limit.Unresolved Topics:Intercept and modify dragdrop text behaviour in scite
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...