PRB: ShellExecute() Succeeds But App Window Doesn't Appear

Last reviewed: December 21, 1994
Article ID: Q124133
The information in this article applies to:
  • Microsoft Win32s, versions 1.15, 1.15a, and 1.2

SYMPTOMS

The following call to ShellExecute() succeeds and the file association is set in File Manager, but the application does not appear to execute (the window is not shown):

   hShell = ShellExecute( hWnd,
                          NULL,
                          lpszFile,
                          NULL,
                          lpszDir,
                          SW_SHOWDEFAULT );

CAUSE

ShellExecute() is directly thunked to 16-bit Windows. Windows-based applications do not support the SW_SHOWDEFAULT flag.

RESOLUTION

Under Win32s, use SW_NORMAL instead of SW_SHOWDEFAULT when using ShellExecute() with a 16-bit Windows-based application. You can use SW_SHOWDEFAULT if the application specified is a Win32-based application.

STATUS

This behavior is by design.


Additional reference words: 1.20
KBCategory: kbprg kbprb
KBSubcategory: W32s


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 21, 1994
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.