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;
相关文档:
(一) 使用动态创建的方法
首先创建 Excel 对象,使用ComObj:
var ExcelApp: Variant;
ExcelApp := CreateOleObject( 'Excel.Application' );
1) 显示当前窗口:
ExcelApp.Visible := True;
2) 更改 Excel 标题栏:
ExcelApp.Caption := '应用程序调用 Microsoft Excel';
3) 添加新工作簿:
ExcelApp.WorkBooks.Add ......
很早做过的一个delphi项目,把里面用到的技术总结一下,主要是针对象我这样的delphi新手,技术上做个积累吧!
假设我们的数据库配置文件ServerInfo.ini内容如下:
[ServerInfo]
ServerIP=192.168.1.5
SQLDBName=Data
SQLUserID=sa
SQLPwd=
我们定义一个连接数据库的过 ......
procedure TfrmMain.FormCreate(Sender: TObject); //主窗体FormCreate事件
var FWidth:integer;
begin
if (screen.Width <> 1024) then //假设你设计程序时的分辨率为1024
begin
FWidth:=width;
scaled:=true;
& ......