Einzelnen Beitrag anzeigen

HolgerX

Registriert seit: 10. Apr 2006
Ort: Leverkusen
961 Beiträge
 
Delphi 6 Professional
 
#21

AW: Aufruf von Windows Snipping Tool und Remotehilfe

  Alt 31. Jan 2018, 04:31
Hmm..


Das funktioniert:

Eventuell so:

  ShellExecute(Application.Handle, 'open', pchar(ExpandEnvStr('%windir%\sysnative\SnippingTool.exe')), nil, nil, sw_show); Siehe hier:

Delphi-Quellcode:
uses
  ShellApi;


// https://stackoverflow.com/questions/2833021/how-to-get-absolute-path-from-path-with-system-path-variables
function ExpandEnvStr(const szInput: string): string;
  const
    MAXSIZE = 32768;
  begin
    SetLength(Result,MAXSIZE);
    SetLength(Result,ExpandEnvironmentStrings(pchar(szInput),
      @Result[1],length(Result)) - 1);
  end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ShellExecute(Application.Handle, 'open', pchar(ExpandEnvStr('%windir%\sysnative\SnippingTool.exe')), nil, nil, sw_show);
end;

Getestet mit Delphi 6 (somit 32 bit).

SnippingTool wird gestartet...


Ein 'System64' hab ich nicht unter meinem 64Bit W8.1, nur das bekannte 'SysWOW64'...
  Mit Zitat antworten Zitat