Suppose your window name is "hwnd" and the text you want to write in this window at the x, y coordinate is stored in the "message", where
LPCWSTR message=L"My First Window"; then
RECT rect; HDC wdc = GetWindowDC(hwnd); GetClientRect (bgHandle, &rect) ; SetTextColor(wdc, 0x00000000); SetBkMode(wdc,TRANSPARENT); rect.left=40; rect.top=10; DrawText( wdc, message, -1, &rect, DT_SINGLELINE | DT_NOCLIP ) ; DeleteDC(wdc);
Here it is .. remember that this is just one example.
source share