现在画出来是一条从左上角到右下角的直线,我如何能让它只画从左上角到中点?
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{ static int cxClient, cyClient;
HDC hdc;
PAINTSTRUCT ps; switch (message) {
case WM_SIZE:
 cxClient = LOWORD (lParam);
 cyClient = HIWORD (lParam);
 return 0; case WM_PAINT:
 hdc = BeginPaint(hwnd,&ps);  MoveToEx(hdc, 0, 0, NULL);
 LineTo(hdc, cxClient, cyClient);
 EndPaint(hwnd, &ps);
 return 0; case WM_DESTROY:
 PostQuitMessage(0);
 return 0; }