Wij ondertekenen ook bepaalde PDF d.m.v. een USB token. Daarvoor gebruik ik deze code;
Delphi Code:
procedure TMailreport.ExecuteAndWait(const aCommando: string);
var
tmpStartupInfo: TStartupInfo;
tmpProcessInformation: TProcessInformation;
tmpProgram: String;
begin
tmpProgram := trim(aCommando);
FillChar(tmpStartupInfo, SizeOf(tmpStartupInfo), 0);
with tmpStartupInfo do
begin
cb := SizeOf(TStartupInfo);
dwFlags := STARTF_USESHOWWINDOW; // <---- toegevoegd
wShowWindow := SW_SHOW; // <---- gewijzigd
end;
if CreateProcess(nil, pchar(tmpProgram), nil, nil, true, CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS,
nil, nil, tmpStartupInfo, tmpProcessInformation) then
begin
// loop every 10 ms
while WaitForSingleObject(tmpProcessInformation.hProcess, 10) > 0 do
sleep(1000);
CloseHandle(tmpProcessInformation.hProcess);
CloseHandle(tmpProcessInformation.hThread);
end
else
begin
RaiseLastOSError;
end;
end;
Deze start een batchbestand op, start het programma voor de hantekening en sla deze op met een andere naam. Die naam neem ik weer terug in mijn programma en stuur de pdf met de mail.
Bookmarks