728x90
반응형

case WM_PAINT()

선그리기 예제

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)
    {

    case WM_PAINT:
    {
        PAINTSTRUCT ps;
        HDC hdc = BeginPaint(hWnd, &ps);

        MoveToEx(hdc, 100, 100, NULL);
        LineTo(hdc, 200, 100);
        LineTo(hdc, 200, 200);
        LineTo(hdc, 100, 200);
        LineTo(hdc, 50, 150);
        LineTo(hdc, 100, 100);

        EndPaint(hWnd, &ps);
    }
    break;

    case WM_DESTROY:
        PostQuitMessage(0);
        break;
    default:
        return DefWindowProc(hWnd, message, wParam, lParam);
    }
    return 0;
}

728x90
반응형

+ Recent posts