#include <WindowsConstants.au3>
$hWnd = WinGetHandle("Безымянный - Блокнот")
$nStyle = _WinGetStyle($hWnd, 0)
$nExStyle = _WinGetStyle($hWnd, 1)
_WinSetStyle($hWnd, -1,BitOr($nExStyle, BitOr($WS_EX_TRANSPARENT, $WS_EX_TOPMOST)))
WinSetTrans($hWnd,"",150)
WinSetOnTop($hWnd,"",1)
Func _WinSetStyle($hWnd, $nStyle = -1, $nExStyle = 0)
Local Const $GWL_STYLE = -16, $GWL_EXSTYLE = -20
Local Const $SWP_NOMOVE = 0x2, $SWP_NOSIZE = 0x1, $SWP_SHOWWINDOW = 0x40, $SWP_NOZORDER = 0x4
Local $iFlags = BitOR($SWP_SHOWWINDOW, $SWP_NOSIZE, $SWP_NOZORDER)
If $nStyle = -1 Then
$nStyle = BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU)
EndIf
$Pos = WinGetpos($hWnd)
$x = $Pos[0]
$y = $Pos[1]
DllCall("User32.dll", "int", "SetWindowLong", "hwnd", $hWnd, "int", $GWL_STYLE, "int", $nStyle)
DllCall("User32.dll", "int", "SetWindowLong", "hwnd", $hWnd, "int", $GWL_EXSTYLE, "int", $nExStyle)
DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hWnd, "hwnd", 0, "int", $x + 1, "int", $y + 1 , "int", 0, "int", 0, "int", $iFlags)
EndFunc
Func _WinGetStyle($hWnd, $iIndex = 0)
Local Const $GWL_STYLE = -16, $GWL_EXSTYLE = -20
Local $iGWL_Index = $GWL_STYLE
If $iIndex > 0 Then
$iGWL_Index = $GWL_EXSTYLE
EndIf
Local $aStyles = DllCall('User32.dll', 'long', 'GetWindowLong', 'hwnd', $hWnd, 'int', $iGWL_Index)
Return $aStyles[0]
EndFunc