Code:

type

              TForm1 = class(TForm)

                Button1: TButton;

              private

                { Private declarations }

                procedure WMDeviceChange(var Message: TMessage);

                  message WM_DEVICECHANGE;

              public

                { Public declarations }

              end;

 

            var

              Form1: TForm1;

 

            implementation

 

            {$R *.DFM}

 

            const DBT_DEVICEARRIVAL = $8000;

            const DBT_DEVICEQUERYREMOVE = $8001;

            const DBT_DEVICEQUERYREMOVEFAILED = $8002;

            const DBT_DEVICEREMOVEPENDING = $8003;

            const DBT_DEVICEREMOVECOMPLETE = $8004;

            const DBT_DEVICETYPESPECIFIC = $8005;

            const DBT_CONFIGCHANGED = $0018;

 

            procedure TForm1.WMDeviceChange(var Message: TMessage);

            var

              s : string;

            begin

            {Do Something here}

              case Message.wParam of

                DBT_DEVICEARRIVAL :

                  s := 'A device has been inserted and is now available';

                DBT_DEVICEQUERYREMOVE: begin

                  s := 'Permission to remove a device is requested';

                  ShowMessage(s);

                 {True grants premission}

                  Message.Result := integer(true);

                  exit;

                end;

                DBT_DEVICEQUERYREMOVEFAILED :

                  s := 'Request to remove a device has been canceled';

                DBT_DEVICEREMOVEPENDING :

                  s := 'Device is about to be removed';

                DBT_DEVICEREMOVECOMPLETE :

                  s := 'Device has been removed';

                DBT_DEVICETYPESPECIFIC :

                  s := 'Device-specific event';

                DBT_CONFIGCHANGED :

                  s:= 'Current configuration has changed'

                else s := 'Unknown Device Message';

              end;

              ShowMessage(s);

              inherited;

            end;

 

Структура SYSTEM_INFO содержит сведения о текущем компьютере система. Это включает в себя архитектуру и Тип процессора, количество процессоры в системе, размер страницы, и другая такая информация.

Эта функция может использоваться для определения того, работает ли программа с виртуального компьютера

 Офигенский компонент.

Описание от авторов:

 Product: MiTeC System Information Component

 

Delphi 7, Delphi 2006-2007, Delphi 2010, Delphi XExx

Simple VMware check on i386

Note: There are plenty ways to detect VMware. This short version bases on the fact that VMware intercepts IN instructions to port 0x5658 with

an magic value of 0x564D5868 in EAX. However, this is *NOT* officially  documented (used by VMware tools to communicate with the host via VM).

Because this might change in future versions - you should look out for additional checks (e.g. hardware device IDs, BIOS informations, etc.).

Newer VMware BIOS has valid SMBIOS informations (you might use my BIOS Helper unit to dump the ROM-BIOS (https://www.bendlins.de/nico/delphi).

Code:

{Зависимости: Windows

Автор:       Gua, , Simferopol Copyright:   Gua

********************************************** }

 

function GetDisplayDevice: string;

var

lpDisplayDevice: TDisplayDevice;

begin

lpDisplayDevice.cb := sizeof(lpDisplayDevice);

EnumDisplayDevices(nil, 0, lpDisplayDevice , 0);

Result:=lpDisplayDevice.DeviceString;

end;

 

Есть 2 файла драйвера - Sys и Ini как установить драйвер?

Автор: Rouse_

 

Code:

function GettingHWProfileName: string//Win95OSR2 or later and NT4.0 or later

var

pInfo:  tagHW_PROFILE_INFOA;

begin

GetCurrentHwProfile(pInfo);

Result:=pInfo.szHwProfileName;

end;