Mega Code Archive

 
Categories / Delphi / Hardware
 

Detect a mouse in the system

Title: Detect a mouse in the system Use GetSystemMetrics function with SM_MOUSEPRESENT parameter. procedure TForm1.Button1Click(Sender: TObject); begin if GetSystemMetrics(SM_MOUSEPRESENT)&lt&gt0 then Label1.Caption:='You have a mouse' else Label1.Caption:='You have not a mouse'; end;