WIN32画图窗口

// Graphic0617.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <WINDOWS.H>
int main(int argc, char* argv[])
{
    HWND hw = (HWND)NULL;

    HDC hdc = GetDC(hw);

    HPEN hpen = CreatePen(PS_SOLID,5,RGB(0xff,00,00));

    HBRUSH hbrush = (HBRUSH)GetStockObject(NULL_BRUSH);

    SelectObject(hdc,hpen);
    SelectObject(hdc,hbrush);

    //SetDCBrushColor(hdc,RGB(0xff,0xFF,00));
    //画线
//     MoveToEx(hdc,0,400,NULL);
//     LineTo(hdc,400,400);
    //矩形
    Rectangle(hdc,0,0,400,400);

    DeleteObject(hpen);
    DeleteObject(hbrush);
    ReleaseDC(hw,hdc);

    //printf("Hello World!\n");
    return 0;
}
原文地址:https://www.cnblogs.com/ganxiang/p/13155482.html