따로 Args로 빼지 말고 명령줄에 파일 이름까지 넣어주면 됩니다.
이런식으로 말이죠.
FCommandLine = FCommandLine + String(" ") + FArgs;
하두고 님이 쓰신 글 :
: var
: FCommandLine, FArgs : String;
:
: start: TStartupInfo;
: sec: TSecurityAttributes;
: pinfo: TProcessInformation;
: Begin
:
: FillChar(start, sizeof(STARTUPINFO), 0);
: start.cb := sizeof(start);
: start.wShowWindow := SW_SHOWDEFAULT;
: sec.nLength := sizeof(sec);
: sec.lpSecurityDescriptor := nil;
: sec.bInheritHandle := true;
:
: FCommandLine := 'C:\Windows\System32\Notepad.exe';
: FArgs := 'C:\a.txt';
: CreateProcess(PChar(FCommandLine), PChar(FArgs), @sec, @sec, true, 0, nil, nil, start, pinfo)
: End;
:
: 이렇게 했는데요.
:
: 노트패드는 실행되는데 노트패드에서 C:\a.txt를 불러오질 못합니다.
: 해결부탁드립니다.
|