Hi, this script rocks.
I´m trying to see a picture under those controls, but when I add my picture, I can't use the original controls (I can see them but the button or the edit box doesn´t work). Any idea? Thanks.
Here is the code, I have added two new lines:
CODE#include <GuiConstants.au3>
HotKeySet("{ESC}", "QuitApp")
$main_Gui = GUICreate("",400,400,20,20,$WS_POPUP, $WS_EX_TOOLWINDOW+$WS_EX_TOPMOST)
$Pic1 = GUICtrlCreatePic("mypicture.jpg", 0, 0, 300, 350)
$but1 = GUICtrlCreateButton(" Exit ", 100, 100,80,21)
$Info_Edit = GUICtrlCreateEdit("A few words to start off with", 80, 150, 300, 220)
$masterMask = CreateMasterMask();
AddToMask($masterMask,$main_Gui,$Pic1);add picture to mask
AddToMask($masterMask,$main_Gui,$but1);add button to mask
AddToMask($masterMask,$main_Gui,$Info_Edit);add the edit
FitMask($masterMask,$main_gui);apply the mask to the window
GUISetState()
While 1
if GUIGetMsg() = $but1 then exit
WEnd
Func CreateMasterMask()
return DllCall("gdi32.dll", "long", "CreateRectRgn", "long", 0, "long", 0, "long", 0, "long", 0)
EndFunc
Func FitMask($aMask,$hWnd)
DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $hWnd, "long", $aMask[0], "int", 1)
endfunc
Func AddToMask(ByRef $MM, $hWnd, $ID)
$pp = ControlGetPos($hWnd,'',$ID)
Local $Mask1 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $pp[0], "long", $pp[1], "long", $pp[0] + $pp[2], "long",$pp[1] + $pp[3])
DllCall("gdi32.dll", "long", "CombineRgn", "long", $MM[0], "long", $Mask1[0], "long", $MM[0],"int",2)
EndFunc
Func QuitApp()
Exit
EndFunc