unit Unit0; interface uses Forms, Dialogs, Controls, StdCtrls, Classes; type TForm0 = class(TForm) CheckButton: TButton; procedure CheckButtonClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form0: TForm0; function GetTabletMode(hwnd: THandle): Integer cdecl; external 'TabletUtils.dll'; implementation {$R *.dfm} procedure TForm0.CheckButtonClick(Sender: TObject); var TabletModeStr: String; begin case GetTabletMode(Self.Handle) of 0 : TabletModeStr := 'OFF'; 1 : TabletModeStr := 'ON'; else TabletModeStr := 'ERROR'; end; MessageDlg('Tablet Mode: ' + TabletModeStr, mtInformation, [mbOK], 0); end; end.