INF: MS-DOS Application Characteristics Under Windows

ID Number: Q73668

3.00 3.10

WINDOWS

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 application runs has a Windows

application to act as its agent. When the MS-DOS application is

running in a window under enhanced mode Windows, and the MS-DOS

application makes a call to the display hardware, the agent intercepts

the call and places the character into its window. To the MS-DOS

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 application's display into a window.

To determine if an application is a MS-DOS application, check the

application's name to see if it matches the name of the MS-DOS

application agent. The module name of the MS-DOS 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 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