I was looking around the help file and I came across _GDIPlus_GraphicsDrawRect and _WinAPI_DrawLine and I seem to be having the same "problem" where every time it draws into a window and you lose or gain focus it has to redraw itself. Is there anyway around this?
$hWnd = WinWait("Untitled")
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
$Color = 0xFFFF0000
$hPen = _GDIPlus_PenCreate($Color, 2)
For $i = 1 To 10
_GDIPlus_GraphicsDrawRect($hGraphic, 200, 200, 25 ,25, $hPen)
_WinAPI_RedrawWindow($hWnd, 0, 0, $RDW_INVALIDATE + $RDW_ALLCHILDREN)