ShellExecute(this->m_hWnd,"open",filename,"","", SW_SHOW);
我想问下SW_SHOW是不是调用显示方式还有如果一个应用程序本身在编写的时候规定了不显示窗口
那么用上面的函数进行调用是否会显示窗口呢

解决方案 »

  1.   

    Flags that specify how an application is to be displayed when it is opened. If lpFile specifies a document file, the flag is simply passed to the associated application. It is up to the application to decide how to handle it. SW_SHOW说明当应用程序开始执行时的特点
      

  2.   

    当打开的filename是一个文档类的文件时(比如word文档),会找到相关的应用程序(word)打开它打开的特点就那几种,比如最大化、最小化、隐藏等
      

  3.   

    SW_SHOW是调用显示方式,不过这个显示方式只是初始化的显示方式,
    如果一个应用程序本身在编写的时候规定了不显示窗口
    那么用上面的函数进行调用是不会显示窗口!
      

  4.   

    nShowCmd 
    If lpFile specifies an executable file, nShowCmd specifies how the application is to be shown when it is opened. This parameter can be one of the following values: 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 theSTARTUPINFO structure passed to theCreateProcess function by the program that started the application. An application should callShowWindow 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. If lpFile specifies a document file, nShowCmd should be zero. 
      

  5.   

    它只是作为参数传递到exe启动, 至于exe是不是用这个参数来 SHOW 窗口, 那就是另一回事.