WinXDrawRect


hElement = WinXDrawRect (hWnd, hPen, x1, y1, x2, y2)

Draws a rectangle

Parameter Description
hWnd The handle to the window to draw on
hPen The handle to the pen to draw with
x1, y1 The upper left corner of the rectangle
x2, y2 The lower right corner of the rectangle

Returns

The id of the rectangle or -1 on error

Remarks

If you register the onPaint callback, this function has no effect. This line will not be visible untill you call the WinXUpdate function. You can use the id returned by this function to undo the ellipse with the WinXUndo function.

Examples

'create a pen
hPen = CreatePen ($$PS_SOLID, 3, 0x00FF0000)

'Draw the rectangle
WinXDrawRect(#hMain, hPen, 0, 0, 60, 60)

Related Links

WinXDrawFilledRect
onPaint
WinXUpdate
WinXUndo