Ok, I don't know exactly why, with a few changes it actually works without using WinAPI, all it needs is the extended style $WS_EX_TRANSPARENT in the GUI creation. Why didn't it work in previous versions? I haven't got he slightest clue. Now it's usable, thanks a lot Surya for help. The only final improvement that would make it perfect is having totally transparent background (for Graphic controls mainly), I can set only overall transparency at the moment, $GUI_BKCOLOR_TRANSPARENT seems to be ignored even for labels (while other colours can be set). #include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $trans = 200
HotKeySet("{ESC}","esc")
Global $hgui = GUICreate("Click-through topmost GUI", 250, 250,350, 350,$WS_POPUP,$WS_EX_TRANSPARENT)
GuiCtrlCreateLabel("Label",60,60)
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
GUICtrlCreateGraphic(0,0,21,21)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR,0xff0000)
GUICtrlSetGraphic(-1,$GUI_GR_PIXEL,10,10)
GUICtrlSetGraphic(-1,$GUI_GR_COLOR,0x33ff22)
GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE,0,0,21,21)
WinSetOnTop($hgui, "", 1)
WinSetTrans($hgui,"",$trans)
GUISetControlsVisible($hgui)
GUISetState()
While 1
Sleep(100)
WEnd
Func GUISetControlsVisible($hWnd) ;thanks to the author of the function
Local $aM_Mask, $aCtrlPos, $aMask
$aM_Mask = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", 0, "long", 0, "long", 0, "long", 0)
$aLastID = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", GUICtrlGetHandle(-1))
For $i = 3 To $aLastID[0]
$aCtrlPos = ControlGetPos($hWnd, '', $i)
If Not IsArray($aCtrlPos) Then ContinueLoop
$aMask = DllCall("gdi32.dll", "long", "CreateRectRgn", _
"long", $aCtrlPos[0], _
"long", $aCtrlPos[1], _
"long", $aCtrlPos[0] + $aCtrlPos[2], _
"long", $aCtrlPos[1] + $aCtrlPos[3])
DllCall("gdi32.dll", "long", "CombineRgn", "long", $aM_Mask[0], "long", $aMask[0], "long", $aM_Mask[0], "int", 2)
Next
DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $hWnd, "long", $aM_Mask[0], "int", 1)
EndFunc
Func esc() ;ESC to quit
Exit
EndFunc