1 g_hDesktopDC = GetDC(NULL);
2 SetBkMode(g_hDesktopDC, TRANSPARENT);
3 SetTextColor(g_hDesktopDC, RGB(196,196,196));
4 HFONT hFont = (HFONT)SendMessage(GetDesktopWindow(), WM_GETFONT, 0, 0);
5 SelectObject(g_hDesktopDC, hFont);
6 TextOut(g_hDesktopDC, 50, 50, _T("显示文字测试"), 6);
7 DeleteDC(g_hDesktopDC); // 不删除获取的桌面DC,将无法显示文字。