#include
#include
#include
#include
#include
extern "C"
{
WINBASEAPI HWND WINAPI GetConsoleWindow();
}
int main(int argc, char *argv[]) //主线程运行结束,辅助线程也结束。
{
HWND hwnd;
HDC hdc;
printf("There are some words in console window!\n在控制台窗口中绘图!\n");
system("Color 3D");
hwnd = GetConsoleWindow();
hdc = GetDC(hwnd);
LineTo(hdc, 200, 300);
Rectangle(hdc, 10, 30, 300, 50);
TextOut(hdc, 10, 10, _TEXT("Hello World\nYesNoConcel!"), 20);
ReleaseDC(hwnd, hdc);
_getch();
printf("After drawing!\n");
return 0;
}
没看懂你这是控制台程序,怎么还有win32窗口画图?你在哪里找的例子?还是自己琢磨的?
什么系统下的?