An Introduction to GDI

To paint the client area of your window, you use Windows’ Graphics Device Interface (GDI) functions. Windows provides several GDI functions for writing text strings to the client area of the window. We’ve already encountered the DrawText function in the last chapter, but the most commonly used text output function is undoubtedly TextOut. This function has the following format:

TextOut (hdc, x, y, psText, iLength) ;

TextOut writes a character string to the client area of the window. The psText argument is a pointer to the character string, and iLength is the length of the string in characters. The x and y arguments define the starting position of the character string in the client area. (More details soon on how these work.) ...

Get Programming Windows®, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.