Hi, I'm new to windows programming, and I'm trying to make it draw lines to wherever the user clicks. Right now I have this, and it works, but I think there must be a better way to send the message to WM_PAINT than passing -1 as the wParam.
-----------
switch (message)
{
case WM_PAINT:
BeginPaint(hWnd, &ps);
hdc = GetDC(hWnd);
if(wParam == -1)
LineTo(hdc, LOWORD(lParam), HIWORD(lParam));
EndPaint(hWnd, &ps);
break;
case WM_LBUTTONDOWN:
PostMessage(hWnd,WM_PAINT,-1,lParam);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
-------
Thanks!