HOWTO: Activate a Full Screen MS-DOS or Console Application

ID: Q196103

The information in this article applies to:

SUMMARY

A full screen MS-DOS application or a full screen Win32 console application can be activated from a Win32 application by using the Platform SDK's APIs SetForegroundWindow() and ShowWindow().

MORE INFORMATION

Assuming the caption of the MS-DOS application or the Win32 console application is Test.exe, the following sample code activates the minimized MS-DOS or Win32 console application:

   HWND hwndConsole = NULL;
   hwndConsole = FindWindow(NULL, "Test.exe");
   if(NULL != hwndConsole)
   {
      SetForegroundWindow(hwndConsole);
      ShowWindow(hwndConsole, SW_MAXIMIZE);
   }

Additional query words: SetFocus
Keywords          : kbNTOS kbSDKPlatform kbWinOS95 kbWinOS98 kbWndw kbWndwProp 
Version           : WINDOWS:
Platform          : WINDOWS
Issue type        : kbhowto

Last Reviewed: November 21, 1998