Delphi中实现加载INF驱动程序!

帮助页在http://delphi.about.com/cs/adptips2003/a/bltip0203_2.htm

自己在实现的过程中的具体过程如下:

function InstallInf(const PathName: string; hParent: HWND): Boolean;

var

  instance: HINST;

begin

  instance := ShellExecute(hParent,

      PChar('open'),

      PChar('rundll32.exe'),

      PChar('setupapi,InstallHinfSection DefaultInstall 132 ' + PathName),

      nil,

      SW_HIDE) ;

   Result := instance > 32;

end;

procedure TForm1.btn1Click(Sender: TObject);

begin

  if InstallInf('F:/abc/arusb_lh.inf', 0) then

    ShowMessage('OK');

end;

猜你喜欢

转载自blog.csdn.net/wildangel817/article/details/5531499
今日推荐