Jump to content
Sign in to follow this  
jennico

Winsettrans with $WS_CHILD not possible ?

Recommended Posts

jennico

$parent=GUICreate("")

GUISetState()

$child=GUICreate("",100,100,10,10 , 0x40000000, -1, $parent);$WS_CHILD

GUISetBkColor(0xF20000)

GUISetState()

Sleep(2000)

MsgBox(0,"setting trans",WinSetTrans($child,"",20))

MsgBox(0,"","does not work")

no trans for a child or wrong code ?

thx j.

Edited by jennico

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites
wraithdu

Seems to be tied to the transparency of the parent window.

Share this post


Link to post
Share on other sites
jennico
:mellow: not mentioned in help file

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites
rasim

:mellow: not mentioned in help file

Hmm... like this?

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>

Global Const $SPI_GETWORKAREA = 48

$parent = GUICreate("Test", 300, 200)

GUICtrlCreateLabel("Hello world!", 100, 50, 100, 15)

$child = GUICreate("", 100, 100, -1, -1, BitOR($WS_VISIBLE, $WS_POPUP), -1, $parent)
GUISetState(@SW_DISABLE)
GUISetBkColor(0xF20000)
WinSetTrans($child, "", 20)

GUISetState(@SW_SHOW, $parent)

GUIRegisterMsg($WM_WINDOWPOSCHANGING, "_WndProc")
GUIRegisterMsg($WM_ACTIVATE, "_WndProc")

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Func _WndProc($hWnd, $Msg, $wParam, $lParam)
    Switch $hWnd
        Case $parent
            Switch $Msg
                Case $WM_ACTIVATE
                    Local $wActive = BitAND($wParam, 0x0000FFFF)
                    If $wActive Then
                        Local $aPos = WinGetPos($parent)
                        WinMove($child, "", $aPos[0] + 100, $aPos[1] + 65)
                    EndIf
                Case $WM_WINDOWPOSCHANGING
                    Local $WINDOWPOS = DllStructCreate("hwnd hWnd;hwnd hwndInsertAfter;int x;int y;int cx;int cy;uint flags", $lParam)
                    Local $iX = DllStructGetData($WINDOWPOS, "x")
                    Local $iY = DllStructGetData($WINDOWPOS, "y")
                    ;Local $iWidth = DllStructGetData($WINDOWPOS, "cx")
                    ;Local $iHeight = DllStructGetData($WINDOWPOS, "cy")
                    
                    WinMove($child, "", $iX + 100, $iY + 65)
            EndSwitch
    EndSwitch           
    
    Return $GUI_RUNDEFMSG
EndFunc

Share this post


Link to post
Share on other sites
jennico

yes that's what it should look like. but with WS_Child style. this does not work it seems.

thx j.


Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
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
Sign in to follow this  

×