把 RECT 结构的地址传递给 FillRect(), 这个结构表示需要临时描绘为红色的屏幕区域.
; 结构的例子: 把 RECT 结构的地址传递给 FillRect(), 这个 ; 结构表示需要临时描绘为红色的屏幕区域. VarSetCapacity(Rect, 16, 0) ; 设置容量为 4 个的 4 字节整型并把它们都初始化为零. NumPut(A_ScreenWidth//2, Rect, 8, "Int") ; 结构中的第三个整数是 "rect.right". NumPut(A_ScreenHeight//2, Rect, 12, "Int") ; 结构中的第四个整数是 "rect.bottom". hDC := DllCall("GetDC", "Ptr", 0, "Ptr") ; 传递零来获取桌面的设备上下文. hBrush := DllCall("CreateSolidBrush", "UInt", 0x0000FF, "Ptr") ; 创建红色画刷 (0x0000FF 是 BGR 格式). DllCall("FillRect", "Ptr", hDC, "Ptr", &Rect, "Ptr", hBrush) ; 使用上面的画刷填充指定的矩形. DllCall("ReleaseDC", "Ptr", 0, "Ptr", hDC) ; 清理. DllCall("DeleteObject", "Ptr", hBrush) ; 清理.