I am creating an Bezier curve in WinApi with C++ and my problem is that my right Button is not working. This is my code:
if (wParam & MK_LBUTTON)
{
HGDIOBJ original = NULL;
//Saving the original object
original = SelectObject(hdc,GetStockObject(DC_PEN));
hdc = GetDC (hwnd) ;
SelectObject(hdc, GetStockObject(DC_PEN));
SetDCPenColor(hdc, RGB(246, 245, 243));
myBezier.DrawBezier (hdc, apt) ;
if (wParam & MK_LBUTTON)
{
apt[1].x = LOWORD (lParam) ;
apt[1].y = HIWORD (lParam) ;
}
else if (wParam & MK_RBUTTON)
{
apt[2].x = LOWORD (lParam) ;
apt[2].y = HIWORD (lParam) ;
}
SelectObject (hdc, GetStockObject(BLACK_PEN)) ;
myBezier.DrawBezier (hdc, apt) ;
ReleaseDC (hwnd, hdc) ;
DeleteObject(original);
}
Left Button is perfectly working but I don't know why RightButton and other keys or even MidButton are not working as well. Any idea?
With the left button I am able to adjust the left line, with the right button the right line. But in this case the right button is never got.