Microsoft KB Archive/93661

{|
 * width="100%"|

Automatically Closing QuickWin Exec Window at Completion

 * }

Q93661

-

The information in this article applies to:


 * Microsoft Visual C++, versions 1.0, 1.5, 1.51, 1.52

-

In Visual C++, when a QuickWin program completes execution, its window remains open by default so the user can view its output or any other messages that the program displays.

To automatically close the window for a QuickWin program upon completion, call two Windows functions. The first function retrieves the window handle and the second function destroys the window. The following code example demonstrates this technique.

Sample Code
/* * Compiler options required: None */ void main {  int hWnd; int nChar; printf(&quot;Generic&quot;); nChar = getchar; if (toupper(nChar) == (int)'C') {     // GetActiveWindow works only when // the QuickWin Exec window is active hWnd = GetActiveWindow; // Other option: Use FindWindow. &quot;TEST&quot; is the default // QuickWin Exec application name, which is used as the // window title. // hWnd = FindWindow(NULL, &quot;TEST&quot;); DestroyWindow(hWnd) ; }  exit(1); } Additional query words: kbinf 1.00 1.50 1.51 1.52
 * 1) include 
 * 2) include 
 * 3) include 

Keywords : kb16bitonly

Issue type :

Technology : kbVCsearch kbAudDeveloper kbvc150 kbvc100 kbVC151 kbVC152