使用CreateProcess呼出一个命令行程序,但是程序执行时总要把xp的cmd窗口也显示出来。可不可以不让他显示,或者隐藏起来用户看不到

解决方案 »

  1.   

    CreateProcess可以指定STARTUPINFO,STARTUPINFO中的wShowWindow成员可以指定显不显示
      

  2.   

    bcpl(Relax):修改wShowWindow可能只是改那个exe的属性吧,但是他还是要在cmd的平台下运行阿
      

  3.   

    BOOL CreateProcess(
      LPCTSTR lpApplicationName,                 // name of executable module
      LPTSTR lpCommandLine,                      // command line string
      LPSECURITY_ATTRIBUTES lpProcessAttributes, // SD
      LPSECURITY_ATTRIBUTES lpThreadAttributes,  // SD
      BOOL bInheritHandles,                      // handle inheritance option
      DWORD dwCreationFlags,                     // creation flags
      LPVOID lpEnvironment,                      // new environment block
      LPCTSTR lpCurrentDirectory,                // current directory name
      LPSTARTUPINFO lpStartupInfo,               // startup information
      LPPROCESS_INFORMATION lpProcessInformation // process information
    );
    dwCreationFlags 参数:
    CREATE_NO_WINDOW Windows NT/2000/XP: This flag is valid only when starting a console application. If set, the console application is run without a console window. 
    This flag cannot be used with MS-DOS-based applications.
      

  4.   

    not MSDOS-Based applications??