Q&A

  • DOS 프로그램 실행시에 창을 안보이게 하는거......
안녕하세여?

전에 글을 올렸다가 많은 도움을 받았었는데여....근데 좀 이상한게 있어서여...

CreateProcess를 이용해서 DOS 프로그램을 실행시키는데..

StartUpInfomation 구조체에 윈도우 실행히 보이지 않게하는 값을 세팅을

했는데두 불구 하구 도스창에 계속 보이는데 이유가 뭘까여??



궁금...이상....



안보이게 해야 하는데....



갈켜줘여.....



그럼 즐푸....



3  COMMENTS
  • Profile
    전진운 2001.05.29 02:39
    안녕하세요

    제가 잘 몰라서 질문의 요지를 잘 모르겠군요

    제가 가지고 있는 자료에 이런게 있어서 올립니다.

    도움이 되실려나 모르겠습니다.

    확인도 해보지 않은 function 입니다.



    Function Exec(Path,Params,WorkPath:string; Wait:Boolean; Runmode:integer):boolean;

    {Path Full path to the executable

    Params Parameters

    WorkPath Default directory, '' if same path as executable

    Wait TRUE if execution of current program waits until new program finishes

    RUNMODE How the application is executed (0 for default SHOWNORMAL):



    Value Meaning

    SW_HIDE Hides the window and activates another window.

    SW_MAXIMIZE Maximizes the specified window.

    SW_MINIMIZE Minimizes the specified window and activates the

    next top-level window in the Z order.

    SW_RESTORE Activates and displays the window. If the window

    is minimized or maximized, Windows restores it to

    its original size and position. An application

    should specify this flag when restoring a minimized

    window.

    SW_SHOW Activates the window and displays it in its current

    size and position.

    SW_SHOWDEFAULT Sets the show state based on the SW_ flag specified

    in the STARTUPINFO structure passed to the CreateProcess

    function by the program that started the application. An

    application should call ShowWindow with this flag to set

    the initial show state of its main window.

    SW_SHOWMAXIMIZED Activates the window and displays it as a maximized window.

    SW_SHOWMINIMIZED Activates the window and displays it as a minimized window.

    SW_SHOWMINNOACTIVE Displays the window as a minimized window. The active

    window remains active.

    SW_SHOWNA Displays the window in its current state. The active

    window remains active.

    SW_SHOWNOACTIVATE Displays a window in its most recent size and position.

    The active window remains active.

    SW_SHOWNORMAL Activates and displays a window. If the window is minimized

    or maximized, Windows restores it to its original size and

    position. An application should specify this flag when

    displaying the window for the first time.}



    var name:string;

    handle:integer;

    startUpInfo : TStartupInfo;

    processInfo : TProcessInformation;

    exeCmd : string;

    begin

    if Runmode=0 then Runmode:=SW_SHOWNORMAL;

    if WorkPath='' then WorkPath:=extractfilepath(path);



    if wait

    then begin // wait for the process to end...

    // Check to make{ If the execution file does not exist, then try

    // adding the path, if that fails then you're stuffed }

    if not FileExists(path) then begin

    result := false;

    exit;

    end;



    // Concat in the parameters

    exeCmd := path + ' ' + params;



    // Initialise the StartUpInfo record, which handles the creation of



    // a new main window for a process

    FillChar(startUpInfo, SizeOf(startUpInfo), Chr(0));

    StartUpInfo.cb := SizeOf( StartUpInfo );

    StartUpInfo.dwFlags := STARTF_USESHOWWINDOW;

    StartUpInfo.wShowWindow := runmode;



    // Spawn the process out.

    if not CreateProcess(





    nil, PChar(exeCmd), nil, nil, false,

    CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS, nil,

    PChar(ExtractFilePath(path)), startUpInfo, processInfo

    ) then begin

    result := false;

    end;



    // Wait for ze old process to finish.

    WaitForSingleObject(processInfo.hProcess, INFINITE);

    end

    else begin

    handle:=ShellExecute(Application.Handle,'open',pchar(path),pchar(params),

    pchar(WorkPath),RunMode);

    end;

    end;





    Function ExecDOS(Path,Params,WorkPath,Title:String; Wait:Boolean; Minimized:Boolean):Boolean;

    {Just for DOS programs, creates a PIF file then executes it, deleting it afterward.

    Path Full path to the executable

    Params Parameters

    WorkPath Default directory, '' if same path as executable

    Title Title to display at top of window

    Wait TRUE if execution of current program waits until new program finishes

    Minimized TRUE if program is to run minimized.}

    var f:file;

    pifpath:string;

    a:string;

    ierr:integer;

    begin

    if WorkPath='' then WorkPath:=extractfilepath(path);



    // this is a generic PIF image that we've hacked to pieces...settings:

    // Idle sensitivity set lowest

    // Default window

    // Exit on terminate

    // All memory resources used if needed

    // Allow screen saver

    // Not dynamic allocation

    a:=#0#120#84#69#83#84#68#79#126#49#32#32#32#32#32#32#32#32#32#32+

    #32#32#32#32#32#32#32#32#32#32#32#32#128#2#0#0#68#58#92#116#101+

    #115#116#100#111#115#112#114#111#103#114#97#109#116#104#105#110+

    #103#46#101#120#101#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#16#0#101#58#92#116#101#109#112+

    #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#45#101#120+

    #32#100#58#92#116#101#115#116#32#100#58#92#42#46#42#0#0#0#0#0+

    #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    #0#0#0#0#0#0#0#0#0#0#0#1#0#255#25#80#0#0#7#0#0#0#0#0#0#0#0#0#0+

    #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#77#73+

    #67#82#79#83#79#70#84#32#80#73#70#69#88#0#135#1#0#0#113#1#87#73+

    #78#68#79#87#83#32#51#56#54#32#51#46#48#0#5#2#157#1#104#0#128+

    #2#0#0#100#0#50#0#255#255#0#0#255#255#0#0#2#0#2#0#159#0#0#0#0+

    #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#45#101#120#32#100#58#92#116#101+

    #115#116#32#100#58#92#42#46#42#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#87+

    #73#78#68#79#87#83#32#86#77#77#32#52#46#48#0#255#255#27#2#172+

    #1#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#80#73#70+

    #77#71#82#46#68#76#76#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#2#0#0#0#0#0#0#0#0#0+

    #0#0#0#0#129#0#0#0#0#0#0#0#0#0#0#0#1#0#0#0#5#0#25#0#3#0#200#0+

    #232#3#2#0#10#0#1#0#0#0#0#0#0#0#28#0#0#0#0#0#0#0#8#0#12#0#84#101+

    #114#109#105#110#97#108#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    #0#0#0#0#0#76#117#99#105#100#97#32#67#111#110#115#111#108#101+

    #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#3#0#0#0#80#0#25#0#128+

    #2#44#1#0#0#0#0#22#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#1#0;

    title:=spaces(title,30);

    move(title[1],a[$02+1],30);



    if length(path)>63 then path:=copy(path,1,63);

    path:=path+#0;

    move(path[1],a[$24+1],length(path));



    if length(params)>63 then params:=copy(params,1,63);

    params:=params+#0;

    move(params[1],a[$a5+1],length(params));

    move(params[1],a[$1c5+1],length(params));



    if length(workpath)>63 then workpath:=copy(workpath,1,63);

    workpath:=workpath+#0;

    move(workpath[1],a[$65+1],length(workpath));



    if minimized

    then a[$1af+1]:=#$12

    else a[$1af+1]:=#$2;



    result:=false; // default unsuccessful

    pifpath:=newfilename(temppath+'00000000.pif',false);

    assignfile(f,pifpath);

    rewrite(f,1);

    ierr:=ioresult;

    blockwrite(f,a[1],length(a),ierr);

    closefile(f);

    if ierr<>length(a) then exit;

    result:=exec(pifpath,'','',wait,0);

    application.processmessages;

    if not wait then delay(1000); // we must wait one second for Windows to read file

    deletefile(pifpath);

    end;





    오은미 wrote:

    > 안녕하세여?

    > 전에 글을 올렸다가 많은 도움을 받았었는데여....근데 좀 이상한게 있어서여...

    > CreateProcess를 이용해서 DOS 프로그램을 실행시키는데..

    > StartUpInfomation 구조체에 윈도우 실행히 보이지 않게하는 값을 세팅을

    > 했는데두 불구 하구 도스창에 계속 보이는데 이유가 뭘까여??

    >

    > 궁금...이상....

    >

    > 안보이게 해야 하는데....

    >

    > 갈켜줘여.....

    >

    > 그럼 즐푸....

    >

  • Profile
    오은미 2001.05.29 05:21
    음 제가 짠 코드는....



    위 생략...

    try

    Screen.Cursor := crHourglass;

    { STARTUPINFO를 설정한다. }

    FillChar(SI, SizeOf(SI), 0);

    SI.cb := SizeOf(TStartUpInfo);

    SI.wShowWindow := SW_HIDE; ===> 요부분....

    SI.dwFlags := STARTF_USESHOWWINDOW;

    { STARTF_USESTDHANDLES 를 빼면 PIPE로 입출력이 Redirect 되지 않는다. }

    SI.dwFlags := SI.dwFlags or STARTF_USESTDHANDLES;

    SI.hStdOutput := hWritePipe;

    SI.hStdError := hWritePipe;

    StrPCopy(CmdLine, Command);



    { Process를 생성한다. }

    if CreateProcess(nil, CmdLine, nil, nil, True, NORMAL_PRIORITY_CLASS, nil, nil, SI, PI) then



    ......중간 생략....



    컴파일 실행 모두 잘 됩니다...다만 도스창이 뜨는것이 문제지여....

    SI.wShowWindow := SW_HIDE; ==> 요렇게 값을 주면 원래는 안떠야 하는거 아닌가여?

    음....왜 그런지 모르겠네여....





    전진운 wrote:

    > 안녕하세요

    > 제가 잘 몰라서 질문의 요지를 잘 모르겠군요

    > 제가 가지고 있는 자료에 이런게 있어서 올립니다.

    > 도움이 되실려나 모르겠습니다.

    > 확인도 해보지 않은 function 입니다.

    >

    > Function Exec(Path,Params,WorkPath:string; Wait:Boolean; Runmode:integer):boolean;

    > {Path Full path to the executable

    > Params Parameters

    > WorkPath Default directory, '' if same path as executable

    > Wait TRUE if execution of current program waits until new program finishes

    > RUNMODE How the application is executed (0 for default SHOWNORMAL):

    >

    > Value Meaning

    > SW_HIDE Hides the window and activates another window.

    > SW_MAXIMIZE Maximizes the specified window.

    > SW_MINIMIZE Minimizes the specified window and activates the

    > next top-level window in the Z order.

    > SW_RESTORE Activates and displays the window. If the window

    > is minimized or maximized, Windows restores it to

    > its original size and position. An application

    > should specify this flag when restoring a minimized

    > window.

    > SW_SHOW Activates the window and displays it in its current

    > size and position.

    > SW_SHOWDEFAULT Sets the show state based on the SW_ flag specified

    > in the STARTUPINFO structure passed to the CreateProcess

    > function by the program that started the application. An

    > application should call ShowWindow with this flag to set

    > the initial show state of its main window.

    > SW_SHOWMAXIMIZED Activates the window and displays it as a maximized window.

    > SW_SHOWMINIMIZED Activates the window and displays it as a minimized window.

    > SW_SHOWMINNOACTIVE Displays the window as a minimized window. The active

    > window remains active.

    > SW_SHOWNA Displays the window in its current state. The active

    > window remains active.

    > SW_SHOWNOACTIVATE Displays a window in its most recent size and position.

    > The active window remains active.

    > SW_SHOWNORMAL Activates and displays a window. If the window is minimized

    > or maximized, Windows restores it to its original size and

    > position. An application should specify this flag when

    > displaying the window for the first time.}

    >

    > var name:string;

    > handle:integer;

    > startUpInfo : TStartupInfo;

    > processInfo : TProcessInformation;

    > exeCmd : string;

    > begin

    > if Runmode=0 then Runmode:=SW_SHOWNORMAL;

    > if WorkPath='' then WorkPath:=extractfilepath(path);

    >

    > if wait

    > then begin // wait for the process to end...

    > // Check to make{ If the execution file does not exist, then try

    > // adding the path, if that fails then you're stuffed }

    > if not FileExists(path) then begin

    > result := false;

    > exit;

    > end;

    >

    > // Concat in the parameters

    > exeCmd := path + ' ' + params;

    >

    > // Initialise the StartUpInfo record, which handles the creation of

    >

    > // a new main window for a process

    > FillChar(startUpInfo, SizeOf(startUpInfo), Chr(0));

    > StartUpInfo.cb := SizeOf( StartUpInfo );

    > StartUpInfo.dwFlags := STARTF_USESHOWWINDOW;

    > StartUpInfo.wShowWindow := runmode;

    >

    > // Spawn the process out.

    > if not CreateProcess(

    >

    >

    > nil, PChar(exeCmd), nil, nil, false,

    > CREATE_NEW_CONSOLE or NORMAL_PRIORITY_CLASS, nil,

    > PChar(ExtractFilePath(path)), startUpInfo, processInfo

    > ) then begin

    > result := false;

    > end;

    >

    > // Wait for ze old process to finish.

    > WaitForSingleObject(processInfo.hProcess, INFINITE);

    > end

    > else begin

    > handle:=ShellExecute(Application.Handle,'open',pchar(path),pchar(params),

    > pchar(WorkPath),RunMode);

    > end;

    > end;

    >

    >

    > Function ExecDOS(Path,Params,WorkPath,Title:String; Wait:Boolean; Minimized:Boolean):Boolean;

    > {Just for DOS programs, creates a PIF file then executes it, deleting it afterward.

    > Path Full path to the executable

    > Params Parameters

    > WorkPath Default directory, '' if same path as executable

    > Title Title to display at top of window

    > Wait TRUE if execution of current program waits until new program finishes

    > Minimized TRUE if program is to run minimized.}

    > var f:file;

    > pifpath:string;

    > a:string;

    > ierr:integer;

    > begin

    > if WorkPath='' then WorkPath:=extractfilepath(path);

    >

    > // this is a generic PIF image that we've hacked to pieces...settings:

    > // Idle sensitivity set lowest

    > // Default window

    > // Exit on terminate

    > // All memory resources used if needed

    > // Allow screen saver

    > // Not dynamic allocation

    > a:=#0#120#84#69#83#84#68#79#126#49#32#32#32#32#32#32#32#32#32#32+

    > #32#32#32#32#32#32#32#32#32#32#32#32#128#2#0#0#68#58#92#116#101+

    > #115#116#100#111#115#112#114#111#103#114#97#109#116#104#105#110+

    > #103#46#101#120#101#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    > #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#16#0#101#58#92#116#101#109#112+

    > #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    > #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#45#101#120+

    > #32#100#58#92#116#101#115#116#32#100#58#92#42#46#42#0#0#0#0#0+

    > #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    > #0#0#0#0#0#0#0#0#0#0#0#1#0#255#25#80#0#0#7#0#0#0#0#0#0#0#0#0#0+

    > #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    > #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    > #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    > #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#77#73+

    > #67#82#79#83#79#70#84#32#80#73#70#69#88#0#135#1#0#0#113#1#87#73+

    > #78#68#79#87#83#32#51#56#54#32#51#46#48#0#5#2#157#1#104#0#128+

    > #2#0#0#100#0#50#0#255#255#0#0#255#255#0#0#2#0#2#0#159#0#0#0#0+

    > #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#45#101#120#32#100#58#92#116#101+

    > #115#116#32#100#58#92#42#46#42#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    > #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#87+

    > #73#78#68#79#87#83#32#86#77#77#32#52#46#48#0#255#255#27#2#172+

    > #1#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    > #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    > #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#80#73#70+

    > #77#71#82#46#68#76#76#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    > #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    > #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#2#0#0#0#0#0#0#0#0#0+

    > #0#0#0#0#129#0#0#0#0#0#0#0#0#0#0#0#1#0#0#0#5#0#25#0#3#0#200#0+

    > #232#3#2#0#10#0#1#0#0#0#0#0#0#0#28#0#0#0#0#0#0#0#8#0#12#0#84#101+

    > #114#109#105#110#97#108#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    > #0#0#0#0#0#76#117#99#105#100#97#32#67#111#110#115#111#108#101+

    > #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#3#0#0#0#80#0#25#0#128+

    > #2#44#1#0#0#0#0#22#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    > #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    > #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0+

    > #0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#1#0;

    > title:=spaces(title,30);

    > move(title[1],a[$02+1],30);

    >

    > if length(path)>63 then path:=copy(path,1,63);

    > path:=path+#0;

    > move(path[1],a[$24+1],length(path));

    >

    > if length(params)>63 then params:=copy(params,1,63);

    > params:=params+#0;

    > move(params[1],a[$a5+1],length(params));

    > move(params[1],a[$1c5+1],length(params));

    >

    > if length(workpath)>63 then workpath:=copy(workpath,1,63);

    > workpath:=workpath+#0;

    > move(workpath[1],a[$65+1],length(workpath));

    >

    > if minimized

    > then a[$1af+1]:=#$12

    > else a[$1af+1]:=#$2;

    >

    > result:=false; // default unsuccessful

    > pifpath:=newfilename(temppath+'00000000.pif',false);

    > assignfile(f,pifpath);

    > rewrite(f,1);

    > ierr:=ioresult;

    > blockwrite(f,a[1],length(a),ierr);

    > closefile(f);

    > if ierr<>length(a) then exit;

    > result:=exec(pifpath,'','',wait,0);

    > application.processmessages;

    > if not wait then delay(1000); // we must wait one second for Windows to read file

    > deletefile(pifpath);

    > end;

    >

    >

    > 오은미 wrote:

    > > 안녕하세여?

    > > 전에 글을 올렸다가 많은 도움을 받았었는데여....근데 좀 이상한게 있어서여...

    > > CreateProcess를 이용해서 DOS 프로그램을 실행시키는데..

    > > StartUpInfomation 구조체에 윈도우 실행히 보이지 않게하는 값을 세팅을

    > > 했는데두 불구 하구 도스창에 계속 보이는데 이유가 뭘까여??

    > >

    > > 궁금...이상....

    > >

    > > 안보이게 해야 하는데....

    > >

    > > 갈켜줘여.....

    > >

    > > 그럼 즐푸....

    > >

  • Profile
    ^^ 2001.05.29 11:39
    오은미 wrote:

    > 음 제가 짠 코드는....

    >

    > 위 생략...

    > try

    > Screen.Cursor := crHourglass;

    > { STARTUPINFO를 설정한다. }

    > FillChar(SI, SizeOf(SI), 0);

    > SI.cb := SizeOf(TStartUpInfo);

    > SI.wShowWindow := SW_HIDE; ===> 요부분....

    > SI.dwFlags := STARTF_USESHOWWINDOW;

    > { STARTF_USESTDHANDLES 를 빼면 PIPE로 입출력이 Redirect 되지 않는다. }

    > SI.dwFlags := SI.dwFlags or STARTF_USESTDHANDLES;

    > SI.hStdOutput := hWritePipe;

    > SI.hStdError := hWritePipe;

    > StrPCopy(CmdLine, Command);

    >

    > { Process를 생성한다. }

    > if CreateProcess(nil, CmdLine, nil, nil, True, NORMAL_PRIORITY_CLASS, nil, nil, SI, PI) then

    >

    > ......중간 생략....

    >

    > 컴파일 실행 모두 잘 됩니다...다만 도스창이 뜨는것이 문제지여....

    > SI.wShowWindow := SW_HIDE; ==> 요렇게 값을 주면 원래는 안떠야 하는거 아닌가여?

    > 음....왜 그런지 모르겠네여....

    >



    FillChar(SI, SizeOf(SI), 0);

    SI.cb := SizeOf(TStartUpInfo);

    SI.wShowWindow := SW_HIDE;

    SI.dwFlags := SI.dwFlags or STARTF_USESHOWWINDOW; ---- > 요렇게 써주세여

    SI.hStdInput := 0;

    SI.hStdOutput := 1;



    CreateProcess(nil,nCmd, nil, nil, True, NORMAL_PRIORITY_CLASS, nil, nil, SI, PI);