hElement = WinXDrawLine (hWnd, hPen, x1, y1, x2, y2)
Draws a line on a window.
Parameter | Description |
---|---|
hWnd | The handle of the window to draw on |
hPen | The handle of the pen to draw with. This is a standard GDI pen object, create it with CreatePen or use a stock pen. If this parameter is 0, the pen from the last drawing function is used. |
x1 | The x coordinate of the first endpoint |
y1 | The y coordinate of the first endpoint |
x2 | The x coordinate of the second endpoint |
y2 | The y coordinate of the second endpoint |
The id of the line or -1 on fail.
This function doesn't work if you have registered an onPaint callback function for the window. The line will not be visible until you call WinXUpdate. You can use the id returned by this function to undo the drawing of the line with the WinXUndo function.
'first, create a pen hPen = CreatePen ($$PS_SOLID, 3, 0x00FF0000) 'the draw the line WinXDrawLine (#hMain, hPen, 0, 0, 60, 60) |