uses shellapi;
...
function ExecAndWait(const ExecuteFile, ParamString : string): boolean;
var
SEInfo: TShellExecuteInfo;
ExitCode: DWORD;
begin
FillChar(SEInfo, SizeOf(SEInfo), 0);
SEInfo.cbSize := SizeOf(TShellExecuteInfo);
with SEInfo do begin
fMask := SEE_MASK_NOCLOSEPROCESS;
Wnd := Application.Handle;
lpFile := PChar(ExecuteFile);
lpParameters := PChar(ParamString);
nShow := SW_HIDE;
end;
if ShellExecuteEx(@SEInfo) then
begin
repeat
Application.ProcessMessages;
GetExitCodeProcess(SEInfo.hProcess, ExitCode);
until (ExitCode <> STILL_ACTIVE) or Application.Terminated;
Result:=True;
end
else Result:=False;
end;
도 추가해서 쓰세요. -.,-;;
civilian 님이 쓰신 글 :
:
: procedure RegisterOCX;
: type
: TRegFunc = function : HResult; stdcall;
: var
: ARegFunc : TRegFunc;
: aHandle : THandle;
: ocxPath : string;
: begin
: try
: ocxPath := ExtractFilePath(Application.ExeName) + 'Flash.ocx';
: aHandle := LoadLibrary(PChar(ocxPath));
: if aHandle <> 0 then
: begin
: ARegFunc := GetProcAddress(aHandle,'DllRegisterServer');
: if Assigned(ARegFunc) then
: begin
: ExecAndWait('regsvr32','/s ' + ocxPath);
: end;
: FreeLibrary(aHandle);
: end;
: except
: ShowMessage(Format('Unable to register %s', [ocxPath]));
: end;
: end;
:
:
:
: 박귀정 님이 쓰신 글 :
: : 프로그램 개발하는 과정에서는 package등으로 만들어서 인스톨 하면 ActiveX가 등록이 되는거 같습니다.
: : 그렇게 개발을 해서 제 컴퓨터에서는 잘 실행이 됩니다.
: : 그런데 이것을 배포하는데 문제가 있어서
: : App를 배포하면서 어떻게 하면 ActiveX를 등록할 수 있는지 알려주셨으면 합니다.
: : Q&A 게시판에서 찾아본것은 DLL등을 동적으로 등록할 때 사용하거나 하는 것에 대하여
: : 답변들을 해 놓으신것 같습니다.
: : 프그램에서 등록을 해볼려고 했는데 실행하자마자 OleSysError가 발생하니 방법을 모르겠습니다.
: :
: : 질문
: : 1. App에서 ActiveX를 등록해 줄 수 있는 방법이 있는지? 있다면 어떻게 하는지.
: : 2. 인스톨시에 등록해 주는 방법 뿐이 없는지?
: : 인스톨 프로그램은 InnoSetup을 사용합니다.
: :
: : 오늘도 즐거운 하루 되십시오.