#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
$hGUI = GUICreate("Text Region", @DesktopWidth, @DesktopHeight, 200, (@DesktopHeight / 2) - 60, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW))
GUISetBkColor(0xFF0000)
$hRegion = _WinAPI_CreateTextRgn($hGUI, "Текст на мониторе без Gui", 80, "Arial", 800)
_WinAPI_SetWindowRgn($hGUI, $hRegion)
GUISetState()
Sleep(5000)
GUIDelete($hGUI)
Func _WinAPI_CreateTextRgn(ByRef $hWnd, $sText, $iHeight, $sFont = "Microsoft Sans Serif", $iWeight = 1000)
Local Const $ANSI_CHARSET = 0, $OUT_CHARACTER_PRECIS = 2, $CLIP_DEFAULT_PRECIS = 0
Local Const $PROOF_QUALITY = 2, $FIXED_PITCH = 1, $hRgn_XOR = 3
Local $hGDI_DLL, $hDC, $hFont, $hOldFont, $hRgn1, $hRgn2, $tRC, $pRC
If $sFont = "" Then
$sFont = "Microsoft Sans Serif"
EndIf
If $iWeight = -1 Then
$iWeight = 1000
EndIf
$hGDI_DLL = DllOpen("gdi32.dll")
$hDC = DllCall("user32.dll", "int", "GetDC", "hwnd", $hWnd)
$hFont = DllCall($hGDI_DLL, "hwnd", "CreateFont", "int", $iHeight, "int", 0, "int", 0, "int", 0, _
"int", $iWeight, "int", 0, "int", 0, "int", 0, "int", $ANSI_CHARSET, "int", $OUT_CHARACTER_PRECIS, _
"int", $CLIP_DEFAULT_PRECIS, "int", $PROOF_QUALITY, "int", $FIXED_PITCH, "str", $sFont)
$hOldFont = DllCall($hGDI_DLL, "hwnd", "SelectObject", "int", $hDC[0], "hwnd", $hFont[0])
DllCall($hGDI_DLL, "int", "BeginPath", "int", $hDC[0])
DllCall($hGDI_DLL, "int", "TextOut", "int", $hDC[0], "int", 0, "int", 0, "str", $sText, "int", StringLen($sText))
DllCall($hGDI_DLL, "int", "EndPath", "int", $hDC[0])
$hRgn1 = DllCall($hGDI_DLL, "hwnd", "PathToRegion", "int", $hDC[0])
$tRC = DllStructCreate("int;int;int;int")
$pRC = DllStructGetPtr($tRC)
DllCall($hGDI_DLL, "int", "GetRgnBox", "hwnd", $hRgn1[0], "ptr", $pRC)
$hRgn2 = DllCall($hGDI_DLL, "hwnd", "CreateRectRgnIndirect", "ptr", $pRC)
DllCall($hGDI_DLL, "int", "CombineRgn", "hwnd", $hRgn2[0], "hwnd", $hRgn2[0], "hwnd", $hRgn1[0], "int", $hRgn_XOR)
DllCall($hGDI_DLL, "int", "DeleteObject", "hwnd", $hRgn1[0])
DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $hWnd, "int", $hDC[0])
DllCall($hGDI_DLL, "int", "SelectObject", "int", $hDC[0], "hwnd", $hOldFont[0])
DllClose($hGDI_DLL)
Return $hRgn2[0]
EndFunc