unit Update;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Borland.Vcl.Db, Borland.Vcl.DBTables,
Borland.Vcl.StdCtrls,baseeditShare,
System.ComponentModel,shellapi,
Borland.Vcl.ExtCtrls,System.IO, Borland.Vcl.ComCtrls,uUpdateThread,
Borland.Vcl.Buttons;type TForm1 = class(TForm).....
procedure TForm1.Button3Click(Sender: TObject);
var ShellExInfo : ShellExecuteInfo;
begin
FillChar(ShellExInfo,SizeOf(ShellExInfo),0);
with ShellExInfo do //填充外部命令执行信息
begin
cbSize := SizeOf(ShellExInfo);
fMask := See_Mask_NoCloseProcess;
Wnd := 0;
lpFile := PChar('c:\windows\regedit.exe');
nShow := SW_ShowNormal;
end;
ShellExecuteEx(@ShellExInfo);
WaitForSingleObject(ShellExInfo.hProcess,INFINITE);//阻塞等待进程结束
Form1.Button2.Click; //这里写入外部调用的进程执行结束后要做的事情
end;....end.編譯時出錯如下:
[Pascal Error] Update.pas(1704): E2003 Undeclared identifier: 'FillChar'
不知道為什麽!?
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Borland.Vcl.Db, Borland.Vcl.DBTables,
Borland.Vcl.StdCtrls,baseeditShare,
System.ComponentModel,shellapi,
Borland.Vcl.ExtCtrls,System.IO, Borland.Vcl.ComCtrls,uUpdateThread,
Borland.Vcl.Buttons;type TForm1 = class(TForm).....
procedure TForm1.Button3Click(Sender: TObject);
var ShellExInfo : ShellExecuteInfo;
begin
FillChar(ShellExInfo,SizeOf(ShellExInfo),0);
with ShellExInfo do //填充外部命令执行信息
begin
cbSize := SizeOf(ShellExInfo);
fMask := See_Mask_NoCloseProcess;
Wnd := 0;
lpFile := PChar('c:\windows\regedit.exe');
nShow := SW_ShowNormal;
end;
ShellExecuteEx(@ShellExInfo);
WaitForSingleObject(ShellExInfo.hProcess,INFINITE);//阻塞等待进程结束
Form1.Button2.Click; //这里写入外部调用的进程执行结束后要做的事情
end;....end.編譯時出錯如下:
[Pascal Error] Update.pas(1704): E2003 Undeclared identifier: 'FillChar'
不知道為什麽!?
不过这个 FillChar 在原 d7 System.pas 单元, 要在 uses 中加上