くだすれVisual C++(超初心者用)
■ このスレッドは過去ログ倉庫に格納されています
0147デフォルトの名無しさん
2006/03/13(月) 10:52:00#include <windows.h>
BOOL IsWindows9x() { return (GetVersion() >= 0x80000000); }
int main(int argc, char *argv[])
{
HWND hWnd;
HDC hdc;
char szOldText[80], szId[32], szTemp[32];
int x, y;
GetConsoleTitle(szOldText, sizeof(szOldText));
do {
wsprintf(szId, "grph%08X", GetTickCount());
SetConsoleTitle(szId);
do {
Sleep(100);
GetConsoleTitle(szTemp, sizeof(szTemp));
} while (lstrcmp(szId, szTemp));
if (IsWindows9x())
hWnd = FindWindowEx(NULL, NULL, "tty", szId);
else
hWnd = FindWindowEx(NULL, NULL, "ConsoleWindowClass", szId);
} while (hWnd == NULL);
SetConsoleTitle(szOldText);
if (IsWindows9x())
hWnd = FindWindowEx(hWnd, NULL, "ttyGrab", NULL);
hdc = GetDC(hWnd);
for(y = 0; y < 256; y++)
for(x = 0; x < 256; x++)
SetPixelV(hdc, x, y, RGB(x, y, (510 - x - y) / 2));
ReleaseDC(hWnd, hdc);
return 0;
}
■ このスレッドは過去ログ倉庫に格納されています