Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///////////////////////////////////////////////////// Ðèñóåò ñòðîêó â îêíå ïðîãðàììû
- void xPrint(int x, int y, const char *pChar) //
- {
- HDC hdc = GetDC(hWnd);
- SetTextColor(hdc, RGB(66, 170, 255));
- SetBkColor (hdc, 0);
- TextOut(hdc, x, y, pChar, strlen(pChar));
- ReleaseDC(hWnd,hdc);
- }
- /////////////////////////////////////////////////////
- LPCSTR Rus(LPCTSTR pszIn) //
- {
- static char szBuffer[MAX_PATH];
- CharToOemBuff(pszIn, szBuffer, MAX_PATH);
- return szBuffer;
- }
- void ConsolePrint(const char* str, int Colour)
- {
- DWORD result;
- COORD coord;
- HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
- SetConsoleTextAttribute(hStdout, Colour); // Èçìåíèì öâåò òåêñòà
- WriteConsole(hStdout, Rus(str), strlen(str), &result, 0);
- }
- // Y - ýòî ñòðîêà, X - ýòî ïîçèöèÿ â ñòðîêå
- // ============================================
- void ConsolePrint(int Y, int X, const char* str, int Colour)
- {
- DWORD result;
- COORD coord;
- HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
- SetConsoleTextAttribute(hStdout, Colour);
- coord.X = X; // Âûáèðàåì ïîçèöèþ
- coord.Y = Y; // Âûáèðàåì ñòðîêó
- SetConsoleCursorPosition(hStdout, coord);
- WriteConsole(hStdout, Rus(str), strlen(str), &result, 0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement