Jump to content

How to make ex_layer transparency have foggy color filter


Recommended Posts

I have a long code which makes a transparent child_gui background have foggy color ,after a bunch of key strokes,

such as a screen filter so that you can process window below as colored.

I don't see how code does it. Is there a straight way to do this? 

Link to comment
Share on other sites

Quote
13 hours ago, UEZ said:

Maybe you are looking for $WS_EX_TRANSPARENT extented style.

Master, It is already $WS_EX_TRANSPARENT exstyle, can you give an example that style uses transparent colors. pls/

My code does colorful ex_transparency, i dont know how it does. sry, found it $WS_EX_TOPMOST+$WS_EX_LAYERED+$WS_EX_TRANSPARENT does.. :)

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>

#region GUI
    Local $hGui = GUICreate("trans", 300, 100, -1, -1, -1, $WS_EX_TOPMOST+$WS_EX_LAYERED+$WS_EX_TRANSPARENT)
    GUICtrlCreateLabel("This is text on a transparent Layered GUI", 10, 10, 200, 20, -1, $GUI_WS_EX_PARENTDRAG)
    GUICtrlSetTip(-1, "Click label to drag layered window")
    Local $idLayButt = GUICtrlCreateButton("Button", 10, 40, 40)
    GUISetBkColor(0xABCDEF)
    _WinAPI_SetLayeredWindowAttributes($hGui, 0x010101)
    GUISetState(@SW_SHOW)

    Local $hGuicontrol = GUICreate("ControlGUI", 300, 100, 100, 100, -1, $WS_EX_TOPMOST)
    Local $idCheckTrans = GUICtrlCreateCheckbox("Transparent color 0xABCDEF (Checked) Or 0x010101", 10, 10)
    Local $idCheckBorder = GUICtrlCreateCheckbox("POPUP-Style", 10, 30)
    GUICtrlCreateLabel("Transparency for Layered GUI", 10, 50)
    Local $idSlTrans = GUICtrlCreateSlider(10, 70, 200, 30)
    GUICtrlSetLimit($idSlTrans, 255, 0)
    GUICtrlSetData(-1, 255)
    GUISetState(@SW_SHOW)
#endregion

While 1
    Local $aExtMsg = GUIGetMsg(1)
    Local $iMsg = $aExtMsg[0]
    Switch $aExtMsg[1]
        Case $hGuicontrol
            Select
                Case $iMsg = $GUI_EVENT_CLOSE
                    Exit
                Case $iMsg = $idCheckTrans Or $iMsg = $idSlTrans; Change Attributes of Trans-Color and Window Transparency
                    If BitAND(GUICtrlRead($idCheckTrans), $GUI_CHECKED) = $GUI_CHECKED Then
                        _WinAPI_SetLayeredWindowAttributes($hGui, 0xABCDEF, GUICtrlRead($idSlTrans))
                    Else
                        _WinAPI_SetLayeredWindowAttributes($hGui, 0x010101, GUICtrlRead($idSlTrans))
                    EndIf
                Case $iMsg = $idCheckBorder
                    If BitAND(GUICtrlRead($idCheckBorder), $GUI_CHECKED) = $GUI_CHECKED Then
                        GUISetStyle($WS_POPUP, -1, $hGui)
                    Else
                        GUISetStyle($GUI_SS_DEFAULT_GUI, -1, $hGui)
                    EndIf
            EndSelect
        Case $hGui
            Select
                Case $iMsg = $idLayButt
                    Local $iTransColor, $iAlpha
                    Local $iInfo = _WinAPI_GetLayeredWindowAttributes($hGui, $iTransColor, $iAlpha)
                    MsgBox($MB_SYSTEMMODAL, 'Layered GUI', "Button on layered Window Clicked" & @CRLF & "Information about this window: " & @CRLF & _
                            "Transparent Color: " & $iTransColor & @CRLF & _
                            "Alpha Value: " & $iAlpha & @CRLF & _
                            "LWA_COLORKEY: " & (BitAND($iInfo, $LWA_COLORKEY) = $LWA_COLORKEY) & @CRLF & _
                            "LWA_ALPHA: " & (BitAND($iInfo, $LWA_ALPHA) = $LWA_ALPHA))
                Case $iMsg = $GUI_EVENT_CLOSE
                    Exit MsgBox($MB_SYSTEMMODAL, '', "Close from Layered GUI")
            EndSelect
    EndSwitch
WEnd

 

Edited by guiltyking
Link to comment
Share on other sites

Well, you have to describe what you want. Writing only fragments of your project is not the way we can help you.

 

Ok, great you have provide a peace of code but I still don't understand your problem!

 

Regarding $WS_EX_TRANSPARENT -> my understanding of this style is that you see the window but can click through - some kind of visible but untouchable.

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

you have help great. it is my understanding ex layer versus ex transparency, i thought it was only ex layer creating transparency, tks alot, 

i am trying to code an instant screen blocker and a RayBAN filter supresses colors behind while you can keep your access normally under that rayban filter now,

Edited by guiltyking
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...