Thema: Delphi Attachment im Mail D7

Einzelnen Beitrag anzeigen

Jick

Registriert seit: 12. Jun 2011
26 Beiträge
 
Delphi XE Starter
 
#3

AW: Attachment im Mail D7

  Alt 18. Jun 2016, 15:22
Für Thunderbird hatte ich das mal über CreateProcess gemacht und dann alle Parameter hinten angehängt.

Code:
procedure ExecNewProcess(ProgramName: string; Wait: Boolean);
var
  StartInfo: TStartupInfo;
  ProcInfo: TProcessInformation;
  CreateOK: Boolean;
begin
  { fill with known state }
  FillChar(StartInfo, SizeOf(TStartupInfo), #0);
  FillChar(ProcInfo, SizeOf(TProcessInformation), #0);
  StartInfo.cb := SizeOf(TStartupInfo);
  CreateOK := CreateProcess(nil, PChar(ProgramName), nil, nil, False,
    CREATE_NEW_PROCESS_GROUP + NORMAL_PRIORITY_CLASS,
    nil, nil, StartInfo, ProcInfo);
  { check to see if successful }
  if CreateOK then
  begin
    //may or may not be needed. Usually wait for child processes
    if Wait then
      WaitForSingleObject(ProcInfo.hProcess, INFINITE);
  end
  else
  begin
    ShowMessage('Unable to run ' + ProgramName);
  end;

  CloseHandle(ProcInfo.hProcess);
  CloseHandle(ProcInfo.hThread);
end;
  Mit Zitat antworten Zitat