I'm using the following winapi-code to change the right-button clicks with left-button clicks.
LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam)
{
if (wParam == WM_RBUTTONDOWN)
{
return CallNextHookEx(NULL, nCode, WM_LBUTTONDOWN, lParam);
}
else if (wParam == WM_RBUTTONUP)
{
return CallNextHookEx(NULL, nCode, WM_LBUTTONUP, lParam);
}
else if (wParam == WM_RBUTTONDBLCLK)
{
return CallNextHookEx(NULL, nCode, WM_LBUTTONDBLCLK, lParam);
}
return CallNextHookEx(NULL, nCode, wParam, lParam);
}
The hook works very good, but it seems that this technique is read-only (I read this in some other stackoverflow question). This is what I want to do:
Left click -> Press left button. Right click -> Press left button.
Any ideas how can I achieve this?
Thanks in advance.