Detect a wheel of mouse

Posted in Manipulators

Use GetSystemMetrics function with SM_MOUSEWHEELPRESENT parameter. Note: for Windows NT only.

procedure TForm1.Button1Click(Sender: TObject);
begin
  if GetSystemMetrics(SM_MOUSEWHEELPRESENT)<>0 then
    Label1.Caption:='You have a wheel'
  else
    Label1.Caption:='You have not a wheel';
end;