Text output has always been a commonly used method. Since the text was invented, the text display should be missing. In the past, books were written on white paper to help others understand it. Now in the information age, it is certainly displayed on the screen. Even if you do not understand calligraphy, you can also display amazing calligraphy words. You can use textout to display text in the window. Function Of course, not only this API function can display Character . The textout function uses the properties of the current device to display text. For example, the property of a device has a font. Type The font color, the color of the font background, and so on.
The textout function declaration is as follows:
Wingdiapi bool winapi textouta (_ in HDC, _ in int X, _ in int y,
_ In_ecount (c) lpcstr lpstring, _ in int C );
Wingdiapi bool winapi textoutw (_ in HDC, _ in int X, _ in int y,
_ In_ecount (c) lpcwstr lpstring, _ in int C );
# Ifdef Unicode
# Define textout textoutw
# Else
# Define textout textouta
HDCIs the current device'sHandle.
XIs the X axis coordinate of the character.
YIs the Y axis coordinate of the character.
LpstringIs to display stringsPointer.
CIs the length of the display string.
An example of calling this function is as follows:
#001 void ccaiwinmsg: ondraw (HDC)
#002 {
#003 //
#004 STD: wstring strshow (_ T ("Implementation of the C ++ window class, 2007-08-13 "));
#005 textout (HDC, 10, 10, strshow. c_str (), (INT) strshow. Length ());
#006}