아래와 같이 메뉴에서 해당 프로그램을 클릭하면 dll로 작성된 프로그램을 호출하는 루틴입니다.
메뉴에서 같은 프로그램을 선택시 이미 실행된 프로그램을 자동 종료 하고 다시 같은 프로그램을
화면에 띄울려고 하는데 아래 소스를 어떻게 수정해야 그 기능이 가능할까?
var
H : THandle;
CreateChild : TCreateChild;
begin
programid := './dll/d_'+programid+'.dll';
H := LoadLibrary(PChar(programid));
if H < 32 then
begin
ShowMessage('No Dll');
Exit;
end;
@CreateChild := GetProcAddress(H, 'CreateChild');
if @CreateChild = nil then
begin
ShowMessage('No Dll Address');
Exit;
end
else
CreateChild( Application, Self, S1, S2, S3, S4, S5 );
|