#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <WinAPISysWin.au3>
Global Const $MK_LBUTTON = 0x1
Local $sData ="кликни меня"
_GDIPlus_Startup()
Local $hGUI = GUICreate("кликни меня", 500, 500)
GUISetState()
update_and_draw()
GUIRegisterMsg(0x0201, "WM_LBUTTONDOWN")
While 1
$msg = GUIGetMsg()
if $msg = $GUI_EVENT_CLOSE then
ExitLoop
endif
WEnd
Func WM_LBUTTONDOWN($hWnd, $MsgId, $wParam, $lParam)
If $wParam = $MK_LBUTTON Then
$sData = ClipGet()
update_and_draw()
EndIf
EndFunc
func update_and_draw()
_WinAPI_UpdateWindow($hGUI)
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
_GDIPlus_GraphicsClear($hGraphic,0xFFFFFFFF)
$hBrush = _GDIPlus_BrushCreateSolid(0xFF00007F)
$hFormat = _GDIPlus_StringFormatCreate()
$hFamily = _GDIPlus_FontFamilyCreate("Arial")
$hFont = _GDIPlus_FontCreate($hFamily, 12, 2)
$tLayout = _GDIPlus_RectFCreate(0, 0, 0, 0)
$aInfo = _GDIPlus_GraphicsMeasureString($hGraphic,$sData, $hFont, $tLayout, $hFormat)
_GDIPlus_GraphicsDrawStringEx($hGraphic, $sData , $hFont, $aInfo[0], $hFormat, $hBrush)
EndFunc
|