WinXDrawText


hElement = WinXDrawText (hWnd, hFont, STRING text, x, y, backCol, forCol)

Draws some text on the specified window using the specified font and colours

Parameter Description
hWnd The handle to the window to draw the text on
hFont The handle to the font to draw the text with
STRING text The text to draw
x The x coordinate where the upper left hand corner of the text will be drawn
y The y coordinate where the upper left hand corner of the text will be drawn
backCol The background colour for the text, -1 for none
forCol The foreground colour for the text

Returns

The id of the text or -1 on fail

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

'First, get a logical font from the user
WinXDraw_GetFontDialog (#hMain, @logFont, @colour)

'Turn the logical font into a font object
hFont = CreateFontIndirectA (logFont)

'Now print some text
WinXDrawText (#hMain, hFont, "Hello World!", 0, 0, -1, colour)

Related Links

WinXDraw_MakeLogFont
WinXDraw_GetFontDialog
WinXDraw_GetTextWidth