Champak Posted January 17, 2017 Share Posted January 17, 2017 I have two GUIs, my main GUI and a clock GUI which has a transparent background so all you see is the actual time. My main sits behind the clock. On my main, right behind the clock, there is a region where if I click in it a function activates. The problem is I can't click on top of the numbers being displayed by the clock, I'm only able to click around the numbers in the transparent area of the clock. Is there a way to make it possible to click the main GUI through the numbers being displayed on the clock like I'm able to click through the other parts of the clock that's transparent? Link to comment Share on other sites More sharing options...
mikell Posted January 17, 2017 Share Posted January 17, 2017 A solution could be : catch the mouse cursor position when clicking and then click the main gui at the same location Link to comment Share on other sites More sharing options...
UEZ Posted January 17, 2017 Share Posted January 17, 2017 Use the $WS_EX_TRANSPARENT style for your clock to click through. 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...
Malkey Posted January 17, 2017 Share Posted January 17, 2017 Click through a hole in the GUI in this example. #include <WinAPI.au3> #include <WindowsConstants.au3> ; Modified from http://www.autoitscript.com/forum/index.php?showtopic=12476&view=findpost&p=784783 ; Also see:- AutoIt Help file > _WinAPI_CreateRoundRectRgn Function > Example Local $hGui = GUICreate("", 500, 500, -1, -1, -1, $WS_EX_TOPMOST) GUISetBkColor(0x008080) _GuiHole($hGui, 50, 50, 100, 100) GUISetState() While 1 $msg = GUIGetMsg() If $msg = -3 Then ExitLoop WEnd Func _GuiHole($hWin, $iX, $iY, $iW, $iH) Local $pos, $outer_rgn, $inner_rgn, $combined_rgn $pos = WinGetPos($hWin) $outer_rgn = _WinAPI_CreateRectRgn(0, 0, $pos[2], $pos[3]) $inner_rgn = _WinAPI_CreateRectRgn($iX, $iY, $iX + $iW, $iY + $iH) $combined_rgn = _WinAPI_CreateRectRgn(0, 0, 0, 0) _WinAPI_CombineRgn($combined_rgn, $outer_rgn, $inner_rgn, $RGN_DIFF) ; $RGN_DIFF constant in WindowsConstants.au3 _WinAPI_SetWindowRgn($hWin, $combined_rgn) EndFunc ;==>_GuiHole Link to comment Share on other sites More sharing options...
Champak Posted January 24, 2017 Author Share Posted January 24, 2017 UEZ, that worked. Thanks all. 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