#NoTrayIcon
#include <WinAPI.au3>
If $CmdLine[0] < 2 Then Exit 0
Switch $CmdLine[1]
Case "setWindowOnTop"
If $CmdLine[0] < 3 Then Exit 0
If WinWait($CmdLine[2], "", 5000) = 0 Then Exit 0
If setPopUpAttributes($CmdLine[2], "") = True Then
Exit 1
Else
Exit 0
EndIf
EndSwitch
Exit 0
Func setPopUpAttributes($Title, $Text)
Local $sizeWindow, $sizeClient, $borderWidth, $titleHeight, $rgn
;Set on top:
WinSetOnTop($Title, $Text, 1)
;Crop to client area:
$sizeWindow = WinGetPos($Title, $Text)
If @error Then Return False
$sizeClient = WinGetClientSize($Title, $Text)
If @error Then Return False
$borderWidth = ($sizeWindow[2] - $sizeClient[0]) / 2
$titleHeight = ($sizeWindow[3] - $sizeClient[1]) - $borderWidth
$rgn = _WinAPI_CreateRectRgn($borderWidth, $titleHeight , $sizeClient[0] + $borderWidth, $sizeClient[1] + $titleHeight)
If $rgn = 0 Then Return False
_WinAPI_SetWindowRgn(WinGetHandle($Title), $rgn, True)
Return True
EndFunc