If you use MFC there is a CDC c++ class that will help you with that centering. There is also the win32 api function
TextOut() But you have to know where you want the text to start (x and y coordinates). That will depend on the font and font size being used. If you navigate through some of the links in MSDN you will probably find some example(s) you can use.