Jump to content

Transparent Bk but fully visible controls?


RomanK
 Share

Recommended Posts

I am wondering if there is a way to make the GUI Background semitransparent, while controls stay 100% opaque (not transparent).

With WinSetTrans, also the controls become transparent. I know this can be achieved with GDI+ , but I'm looking for a way that is not so resource-effective and takes less RAM.

My current project is kind of Quick Launch bar, but with outstanding features like drag-and-drop-reorder icons and large icons sizes from 32 up to 256 pixels.

And all that, at the cost of only 2.6MB RAM. I'm done about 70% with it.

[font="Courier New"]http://RomanK.hondadesigns.com[/font]
Link to comment
Share on other sites

I am wondering if there is a way to make the GUI Background semitransparent, while controls stay 100% opaque (not transparent).

With WinSetTrans, also the controls become transparent. I know this can be achieved with GDI+ , but I'm looking for a way that is not so resource-effective and takes less RAM.

My current project is kind of Quick Launch bar, but with outstanding features like drag-and-drop-reorder icons and large icons sizes from 32 up to 256 pixels.

And all that, at the cost of only 2.6MB RAM. I'm done about 70% with it.

I'm literally working on a script right now that dose something very similar to this.

Although this may not be the ideal method, my current thinking is to place each control in it's own window with the main window as the parent.

Here is what I have atm..

;## Control Framer
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

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

#Region Sample
    HotKeySet("{ESC}", "Terminate")
    ;$GUI = GUICreate("Test Gui")
    GUISetOnEvent($GUI_EVENT_RESIZED, "SpecialEvents")
    $Control = _GUICtrlCreateButton("Data", 400, 400)
    GUICtrlSetOnEvent($Control, "SpecialEvents")
    
    $Control = _GUICtrlCreateCombo("item1", 450, 400)
    
    GUICtrlSetData(-1, "item2|item3", "item3")
#EndRegion

While True
    Sleep(10)
WEnd

Func Terminate()
    Exit
EndFunc

Func SpecialEvents()
    MsgBox(0, "Resize Pressed", "ID=" & @GUI_CtrlId & " WinHandle=" & @GUI_WinHandle)
EndFunc

Func _GUICtrlCreateButton($Text, $Left, $Top, $Width = Default, $Height = Default, $Style = Default, $exStyle = Default)
    Local $GUI      = GUICreate($Text, $Left, $Top, $Width, $Height, BitOR($WS_POPUP, $WS_CLIPSIBLINGS))
    Local $Control  = GUICtrlCreateButton($Text, 0, 0, $Width, $Height, $Style, $exStyle)
    Local $Pos      = ControlGetPos($GUI, Default, $Control)

    GUICtrlSetResizing($Control, $GUI_DOCKALL)
    WinMove($GUI, Default, $Left, $Top, $Pos[2], $Pos[3])
    GUISetState(@SW_SHOWNOACTIVATE, $GUI)
    
    Return $Control
EndFunc

Func _GUICtrlCreateAvi($FileName, $Subfield, $Left, $Top, $Width = Default, $Height = Default, $Style = Default, $exStyle = Default)
    Local $GUI      = GUICreate($FileName, $Left, $Top, $Width, $Height, BitOR($WS_POPUP, $WS_CLIPSIBLINGS))
    Local $Control  = GUICtrlCreateAvi($FileName, $Subfield, 0, 0, $Width, $Height, $Style, $exStyle)
    Local $Pos      = ControlGetPos($GUI, Default, $Control)

    GUICtrlSetResizing($Control, $GUI_DOCKALL)
    WinMove($GUI, Default, $Left, $Top, $Pos[2], $Pos[3])
    GUISetState(@SW_SHOWNOACTIVATE, $GUI)
    
    Return $Control
EndFunc

Func _GUICtrlCreateCheckbox($Text, $Left, $Top, $Width = Default, $Height = Default, $Style = Default, $exStyle = Default)
    Local $GUI      = GUICreate($Text, $Left, $Top, $Width, $Height, BitOR($WS_POPUP, $WS_CLIPSIBLINGS))
    Local $Control  = GUICtrlCreateCheckbox($Text, 0, 0, $Width, $Height, $Style, $exStyle)
    Local $Pos      = ControlGetPos($GUI, Default, $Control)

    GUICtrlSetResizing($Control, $GUI_DOCKALL)  
    WinMove($GUI, Default, $Left, $Top, $Pos[2], $Pos[3])
    GUISetState(@SW_SHOWNOACTIVATE, $GUI)
    
    Return $Control
EndFunc

Func _GUICtrlCreateDate($Text, $Left, $Top, $Width = Default, $Height = Default, $Style = Default, $exStyle = Default)
    Local $GUI      = GUICreate($Text, $Left, $Top, $Width, $Height, BitOR($WS_POPUP, $WS_CLIPSIBLINGS))
    Local $Control  = GUICtrlCreateDate($Text, 0, 0, $Width, $Height, $Style, $exStyle)
    Local $Pos      = ControlGetPos($GUI, Default, $Control)

    GUICtrlSetResizing($Control, $GUI_DOCKALL)  
    WinMove($GUI, Default, $Left, $Top, $Pos[2], $Pos[3])
    GUISetState(@SW_SHOWNOACTIVATE, $GUI)
    
    Return $Control
EndFunc

Func _GUICtrlCreateEdit($Text, $Left, $Top, $Width = Default, $Height = Default, $Style = Default, $exStyle = Default)
    Local $GUI      = GUICreate($Text, $Left, $Top, $Width, $Height, BitOR($WS_POPUP, $WS_CLIPSIBLINGS))
    Local $Control  = GUICtrlCreateEdit($Text, 0, 0, $Width, $Height, $Style, $exStyle)
    Local $Pos      = ControlGetPos($GUI, Default, $Control)

    GUICtrlSetResizing($Control, $GUI_DOCKALL)  
    WinMove($GUI, Default, $Left, $Top, $Pos[2], $Pos[3])
    GUISetState(@SW_SHOWNOACTIVATE, $GUI)
    
    Return $Control
EndFunc

Func _GUICtrlCreateInput($Text, $Left, $Top, $Width = Default, $Height = Default, $Style = Default, $exStyle = Default)
    Local $GUI      = GUICreate($Text, $Left, $Top, $Width, $Height, BitOR($WS_POPUP, $WS_CLIPSIBLINGS))
    Local $Control  = GUICtrlCreateInput($Text, 0, 0, $Width, $Height, $Style, $exStyle)
    Local $Pos      = ControlGetPos($GUI, Default, $Control)

    GUICtrlSetResizing($Control, $GUI_DOCKALL)  
    WinMove($GUI, Default, $Left, $Top, $Pos[2], $Pos[3])
    GUISetState(@SW_SHOWNOACTIVATE, $GUI)
    
    Return $Control
EndFunc

Func _GUICtrlCreateCombo($Text, $Left, $Top, $Width = Default, $Height = Default, $Style = Default, $exStyle = Default)
    Local $GUI      = GUICreate($Text, $Left, $Top, $Width, $Height, BitOR($WS_POPUP, $WS_CLIPSIBLINGS))
    Local $Control  = GUICtrlCreateCombo($Text, 0, 0, $Width, $Height, $Style, $exStyle)
    Local $Pos      = ControlGetPos($GUI, Default, $Control)

    GUICtrlSetResizing($Control, $GUI_DOCKALL)  
    WinMove($GUI, Default, $Left, $Top, $Pos[2], $Pos[3])
    GUISetState(@SW_SHOWNOACTIVATE, $GUI)
    
    Return $Control
EndFunc

--- TTFN

Link to comment
Share on other sites

Another one here which does just what you asked for.

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

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