NoHAX Posted December 31, 2010 Share Posted December 31, 2010 #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WINAPI.au3> $gui = GUICreate("trans", 300, 400, -1, -1, $WS_POPUP, $WS_EX_LAYERED) 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") GUISetBkColor(0xABCDEF) _WinAPI_SetLayeredWindowAttributes($gui, 0x010101, 100) GUISetState() While 1 Sleep(1000) WEnd I want to make $gui invisible, but WITHOUT invisible button etc. I need a "invisible gui" to place buttons Thx for help Link to comment Share on other sites More sharing options...
UEZ Posted December 31, 2010 Share Posted December 31, 2010 This is working for me on Win7 x64: #include <GuiConstantsEx.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> $hGUI = GUICreate("Test", 600, 400, -1 , -1, $WS_POPUP, $WS_EX_LAYERED) GUISetBkColor(0xABCDEF, $hGUI) GUISetState(@SW_SHOW, $hGUI) _WinAPI_SetLayeredWindowAttributes($hGUI, 0xABCDEF) $button = GUICtrlCreateButton("Exit", 200, 200, 100, 100) GUICtrlCreateLabel("This is text on a transparent Layered GUI", 10, 100, 200, 20, -1, $GUI_WS_EX_PARENTDRAG) GUICtrlSetTip(-1, "Click label to drag layered window") Do Until GUIGetMsg() = -3 Exit Br, UEZ 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 More sharing options...
Zedna Posted December 31, 2010 Share Posted December 31, 2010 You can achieve this also without _WinAPI_SetLayeredWindowAttributes() Look at my example in helpfile at _WinAPI_SetWindowRgn() Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
NoHAX Posted January 2, 2011 Author Share Posted January 2, 2011 @UEZ its cool but i needed Zedna's example, check thisexpandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> ; get height of window title and width of window frame - may be different when XP theme is ON/OFF Global $htit = _WinAPI_GetSystemMetrics($SM_CYCAPTION) Global $frame = _WinAPI_GetSystemMetrics($SM_CXDLGFRAME) $gui = GUICreate("Test Windows regions", 350, 210) $btn_transparent = GUICtrlCreateButton("Transparent region", 100, 120, 150) GUISetState(@SW_SHOW) $pos = WinGetPos($gui) Global $width = $pos[2] ; width Global $height = $pos[3] ; height While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $btn_transparent _GuiHole($gui, 10, 1, 260, 17) EndSelect WEnd ; make inner transparent area but add controls Func _GuiHole($h_win, $i_x, $i_y, $i_sizew, $i_sizeh); _GUIHole($GUI, $left, $top, $width, $height) Local $outer_rgn, $inner_rgn, $combined_rgn $outer_rgn = _WinAPI_CreateRectRgn(0, 0, $width, $height) $inner_rgn = _WinAPI_CreateRectRgn($i_x, $i_y, $i_x + $i_sizew, $i_y + $i_sizeh) $combined_rgn = _WinAPI_CreateRectRgn(0, 0, 0, 0) _WinAPI_CombineRgn($combined_rgn, $outer_rgn, $inner_rgn, $RGN_DIFF) _WinAPI_DeleteObject($outer_rgn) _WinAPI_DeleteObject($inner_rgn) _AddCtrlRegion($combined_rgn, $btn_transparent) _WinAPI_SetWindowRgn($h_win, $combined_rgn) EndFunc ;==>_GuiHole ; add control's area to given region ; respecting also window title/frame sizes Func _AddCtrlRegion($full_rgn, $ctrl_id) Local $ctrl_pos, $ctrl_rgn $ctrl_pos = ControlGetPos($gui, "", $ctrl_id) $ctrl_rgn = _WinAPI_CreateRectRgn($ctrl_pos[0] + $frame, $ctrl_pos[1] + $htit + $frame, _ $ctrl_pos[0] + $ctrl_pos[2] + $frame, $ctrl_pos[1] + $ctrl_pos[3] + $htit + $frame) _WinAPI_CombineRgn($full_rgn, $full_rgn, $ctrl_rgn, $RGN_OR) _WinAPI_DeleteObject($ctrl_rgn) EndFunc ;==>_AddCtrlRegionnow i must do sth to make it "on top" alwaysAny ideas? Link to comment Share on other sites More sharing options...
Zedna Posted January 2, 2011 Share Posted January 2, 2011 now i must do sth to make it "on top" alwaysAny ideas?WinSetOnTop() Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
NoHAX Posted January 2, 2011 Author Share Posted January 2, 2011 (edited) WinSetOnTop() Best Idea Ouch why this wont show all elements? expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> ; get height of window title and width of window frame - may be different when XP theme is ON/OFF Global $htit = _WinAPI_GetSystemMetrics($SM_CYCAPTION) Global $frame = _WinAPI_GetSystemMetrics($SM_CXDLGFRAME) $c_pos = WinGetPos("PVP.net Client") $c_x = $c_pos[0] $c_y = $c_pos[1] $c_width = $c_pos[2] $c_height = $c_pos[3] $title = "Auto Master v1.0" $gui = GUICreate($title, $c_width, $c_height, $c_x, $c_y) $btn_transparent = GUICtrlCreateButton("Transparent region", 100, 120, 150) $List1 = GUICtrlCreateList("", 100, 160, 217, 318) GUISetState(@SW_SHOW) $pos = WinGetPos($gui) Global $width = $pos[2] ; width Global $height = $pos[3] ; height MsgBox(0, "x", "x") WinSetOnTop($title, "", 1) _GuiHole($gui, 0, 0, $c_width, $c_height) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd ; make inner transparent area but add controls Func _GuiHole($h_win, $i_x, $i_y, $i_sizew, $i_sizeh); _GUIHole($GUI, $left, $top, $width, $height) Local $outer_rgn, $inner_rgn, $combined_rgn $outer_rgn = _WinAPI_CreateRectRgn(0, 0, $width, $height) $inner_rgn = _WinAPI_CreateRectRgn($i_x, $i_y, $i_x + $i_sizew, $i_y + $i_sizeh) $combined_rgn = _WinAPI_CreateRectRgn(0, 0, 0, 0) _WinAPI_CombineRgn($combined_rgn, $outer_rgn, $inner_rgn, $RGN_DIFF) _WinAPI_DeleteObject($outer_rgn) _WinAPI_DeleteObject($inner_rgn) _AddCtrlRegion($combined_rgn, $btn_transparent) _WinAPI_SetWindowRgn($h_win, $combined_rgn) EndFunc ;==>_GuiHole ; add control's area to given region ; respecting also window title/frame sizes Func _AddCtrlRegion($full_rgn, $ctrl_id) Local $ctrl_pos, $ctrl_rgn $ctrl_pos = ControlGetPos($gui, "", $ctrl_id) $ctrl_rgn = _WinAPI_CreateRectRgn($ctrl_pos[0] + $frame, $ctrl_pos[1] + $htit + $frame, _ $ctrl_pos[0] + $ctrl_pos[2] + $frame, $ctrl_pos[1] + $ctrl_pos[3] + $htit + $frame) _WinAPI_CombineRgn($full_rgn, $full_rgn, $ctrl_rgn, $RGN_OR) _WinAPI_DeleteObject($ctrl_rgn) EndFunc ;==>_AddCtrlRegion Edit: Ahh ok i get it _AddCtrlRegion($combined_rgn, $List1) Edited January 2, 2011 by NoHAX Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now