Title: How determine the number of mouse buttons
function GetNumberOfMouseButtons: Integer;
begin
Result := GetSysTemMetrics(SM_CMOUSEBUTTONS);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage('Your mouse has ' + IntToStr(GetNumberOfMouseButtons) + ' buttons.');
end;