MS-DOS-Based Application Characteristics Under Windows

Last reviewed: July 22, 1997
Article ID: Q73668
3.00 3.10 WINDOWS kbprg

The information in this article applies to:

  • Microsoft Windows Software Development Kit (SDK) for Windows versions 3.1 and 3.0

SUMMARY

This article discusses the mechanism that the Microsoft Windows graphical environment uses to run an MS-DOS (non-Windows) application.

MORE INFORMATION

In the Window environment, each MS-DOS-based application runs has a Windows-based application to act as its agent. When the MS-DOS-based application is running in a window under enhanced mode Windows, and the MS- DOS-based application makes a call to the display hardware, the agent intercepts the call and places the character into its window. To the MS-DOS-based application, the agent acts as a virtual copy of the display hardware.

NOTE: The Windows agent does not manage the display; it simply renders the MS-DOS-based application's display into a window.

To determine if an application is an MS-DOS-based application, check the application's name to see if it matches the name of the MS-DOS-based application agent. The module name of the MS-DOS-based application agent is WINOLDAP. The following code fragment performs this check:

   BOOL IsThisWOAWindow(HWND hWnd)
   {
      BOOL IsWOA;
      HANDLE hModWOA;

      IsWOA = FALSE;
      if (hModWOA = GetModuleHandle("WINOLDAP"))
         {
         if (hModWOA == (HANDLE)(GetClassWord(hWnd, GCW_HMODULE)))
            {
            IsWOA = TRUE;
            }
         }
      return IsWOA;
   }

To determine how many MS-DOS-based applications are running at any given time, call the code above from an loop that enumerates the handles of all windows in the system.


Additional reference words: 3.00 3.10
KBCategory: kbprg
KBSubcategory: KrWoa
Keywords : kb16bitonly


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: July 22, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.