DrawTextW(hDC, msg, ARRAYSIZE(msg), &rect, DT_BOTTOM | DT_SINGLELINE);
这样写了后 在修改下参数 还是无法显示字符串
这样写了后 在修改下参数 还是无法显示字符串
梅尚程荀
马谭杨奚
HANDLE hConsole(GetStdHandle(STD_OUTPUT_HANDLE)); // 控制台句柄 const WCHAR msg[] = L"按<Enter>键结束程序"; RECT rect = { Border.left + 10, Border.top + 10, Border.left + 100, Border.top + 30 }; SetTextColor(hDC, RGB(255,255,255)); SetBkColor(hDC, TRANSPARENT); TextOut(hDC, Border.left + 10, Border.top + 10,msg, lstrlen(msg)); // DrawTextW(hDC, msg, ARRAYSIZE(msg), &rect, DT_BOTTOM | DT_SINGLELINE);
void Wait(void) { const WCHAR msg[] = L"按<Enter>键结束程序"; RECT rect = { Border.left, Border.bottom + 20, Border.right, Border.bottom + 50 }; SetTextColor(hDC, RGB(255,255,255)); SetBkColor(hDC, TRANSPARENT); DrawTextW(hDC, msg, ARRAYSIZE(msg), &rect, DT_SINGLELINE | DT_BOTTOM); HANDLE hConsole(GetStdHandle(STD_OUTPUT_HANDLE)); // 控制台句柄 CONSOLE_CURSOR_INFO CursorInfo; GetConsoleCursorInfo(hConsole, &CursorInfo); CursorInfo.bVisible = false; SetConsoleCursorInfo(hConsole, &CursorInfo); while (_getwch() != K_ENTER) { ; } CursorInfo.bVisible = true; SetConsoleCursorInfo(hConsole, &CursorInfo); }