Hi,
Sorry about the dumb question, but is there a way to draw a character at a random place on the screen without using any "heavy" graphics libraries?
Thanks, Li
Hi,
Sorry about the dumb question, but is there a way to draw a character at a random place on the screen without using any "heavy" graphics libraries?
Thanks, Li
HDC hdc = GetDC(NULL);
RECT rc;
rc.left = 0;
rc.right = 100;
rc.top = 0;
rc.bottom = 100;
DrawText(hdc, L"Bla", 3, &rc, 0);
Am I helping a virus programmer here?
Try writing directly to video RAM at address B800:0000 (see Bios Memory Map).
Assuming this is a console application:
#include "windows.h"
void gotoxy(int x, int y)
{
COORD coord;
coord.X = x; coord.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_H ANDLE), coord);
}
void PaintcharOnRandomLocation(const char c)
{
srand(0);
int x = rand(79);
int y = rand(24);
gotoxy(x,y);
putch(c);
}