本帖最后由 VisualEleven 于 2012-10-16 12:50:24 编辑

解决方案 »

  1.   

    For GUI processes, the first time ShowWindow is called, its nCmdShow parameter is ignored wShowWindow specifies the default value. In subsequent calls to ShowWindow, the wShowWindow member is used if the nCmdShow parameter of ShowWindow is set to SW_SHOWDEFAULT.好像是第一次无效,有人怎么能让它有效吗?
      

  2.   


    你的这个前半句是这么写的
    wShowWindow 
    Ignored unless dwFlags specifies STARTF_USESHOWWINDOW. 
    所以呢,dwFlags要指定为STARTF_USESHOWWINDOWMSDN中STARTF_USESHOWWINDOW写到:如果这个值没有被指定,wShowWindow 被忽视。
    If this value is not specified, the wShowWindow member is ignored.先设定dwFlags的值为STARTF_USESHOWWINDOW。
      

  3.   

    第五个参数要为1
    CreateProcess(NULL,       //   No   module   name   (use   command   line).   
    szCmdLine,   //   Command   line.   
    NULL,                           //   Process   handle   not   inheritable.   
    NULL,                           //   Thread   handle   not   inheritable.   
    TRUE,                         //   Set   handle   inheritance   to   FALSE.   
    1  ,                                 //   No   creation   flags.   
    NULL,                           //   Use   parent 's   environment   block.   
    NULL,//szCurDir,                           //   Use   parent 's   starting   directory.   
    &si,                             //   Pointer   to   STARTUPINFO   structure. 
    &pi   );  
      

  4.   

    http://blog.csdn.net/visualeleven/article/details/6025210