#include <GDIPlus.au3>
Opt('MustDeclareVars', 1)
Global $hGraphic
_Main()
Func _Main()
Local $hGUI, $hWnd
; 创建界面
$hGUI = GUICreate("GDI+", 400, 300)
$hWnd = WinGetHandle("GDI+")
; 绘制椭圆
_GDIPlus_Startup()
GUIRegisterMsg(0x0f, "WM_PAINT")
GUISetState()
; 循环至用户退出
Do
Until GUIGetMsg() = -3
; 清除资源
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
EndFunc ;==>_Main
Func WM_PAINT($hWnd, $Msg, $wParam, $lParam)
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
_GDIPlus_GraphicsDrawEllipse($hGraphic, 130, 100, 140, 70)
Return 'GUI_RUNDEFMSG'
EndFunc ;==>WM_PAINT
|