Sign in to follow this  
Followers 0
Heiko3110

Transparent GUI - Click to DragnDrop

1 post in this topic

#1 ·  Posted (edited)

Hello,

Im testing a Little GUI with transparency, see the Code below. It just shows a text with a fake outlineborder. If I run the script and click on the TRANSPARENT Areas of the Text, I can still Drag and Drop the GUI, which is what I want. However *sometimes* if I run the script , I can NOT Drag and Drop the GUI when I click on the transparent Areas. Instead of Drag and Drop, my clicks are send to the Window under my GUI.

Same happens if I copy and Paste this Little Code to one of my other scripts, I have absolutely no clue what causes this behaviour,and I cant reproduce it. Maybe anyone of you guys can Point me in the right direction ? I would like to be able to drag and drop the GUI when I click "anywhere" , transparent Areas included.

 

Thank you in advance

 

$gui = GUICreate("VNC Overlay", 350, 50, -1, @DesktopHeight-150, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
GUISetBkColor(0xABCDEF)
$fontsize=30
$face=500


$mainlabel1=GUICtrlCreateLabel("", 42, 2, 350, 50,-1,$GUI_WS_EX_PARENTDRAG )
GUICtrlSetFont(-1,$fontsize, $face, -1, "" , 3)

$mainlabel2=GUICtrlCreateLabel("", 40, 0, 350, 50,-1,$GUI_WS_EX_PARENTDRAG )
GUICtrlSetFont(-1,$fontsize, $face, -1, "" , 3)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT )

$mainlabel3=GUICtrlCreateLabel("", 42, 0, 350, 50,-1,$GUI_WS_EX_PARENTDRAG )
GUICtrlSetFont(-1,$fontsize, $face, -1, "" , 3)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT )

$mainlabel4=GUICtrlCreateLabel("", 40, 2, 350, 50,-1,$GUI_WS_EX_PARENTDRAG )
GUICtrlSetFont(-1,$fontsize, $face, -1, "" , 3)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT )

$mainlabel5=GUICtrlCreateLabel("", 41, 1, 350, 50,-1,$GUI_WS_EX_PARENTDRAG )
GUICtrlSetFont(-1,$fontsize, $face, -1, "" , 3)
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT )

$text="Dummy"
GUICtrlSetData($mainlabel1,$text)
GUICtrlSetData($mainlabel2,$text)
GUICtrlSetData($mainlabel3,$text)
GUICtrlSetData($mainlabel4,$text)
GUICtrlSetData($mainlabel5,$text)

$logo=GUICtrlCreatePic("logo.jpg",0,5,35,35,-1,$GUI_WS_EX_PARENTDRAG)
$hLogo=GUICtrlGetHandle($logo)


_WinAPI_SetLayeredWindowAttributes($gui,0xABCDEF,255)
GUISetState(@SW_SHOW,$gui)

 

Edited by Heiko3110

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  
Followers 0