Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Hiding output from batch file


3 replies to this topic

Al Newton

Al Newton
  • Members
  • 1 posts

Posted 18 February 2002 - 21:58

I want to use LaunchAppAndWait() to run a batch program. This creates an ugly black window that mars the appearance of the screen.  Does anyone know of a way to hide this window.  Yes, I know there's a script on this site called LaunchAppEx() that's supposed to do the job, but it's not compatible with Developer 7.0.  I really need help with this issue right away because our app ships this week. Thanks!

Perotin

Perotin
  • Full Members
  • 407 posts

Posted 19 February 2002 - 13:07

Can you create  .pif file which set the appearance of the batch file to hidden?
1. Right click on the bacth file on your pc.
2. Select Properties.
3. Look for minimized/symbol appearance on the program tab ...
4. Edit the .pif file to have just the bacth file name and no path information
5. Copy the .pif file to the same directory as the bacth file and run the .pif instead of the .bat.
ps: this may not be working with WinNT ...

(Edited by Perotin at 1:08 pm on Feb. 19, 2002)


Marie Tupps

Marie Tupps
  • Members
  • 22 posts

Posted 19 February 2002 - 14:36

I am using Win2k and there doesn't seem to be any .pif files.   I follow your instructions I do not see the minimized/symbol .  This would be such a great thing to have available, seeing as how I launch several batch files during my install.  Any suggestions or tips are very much welcome.

AlNewton1

AlNewton1
  • Members
  • 1 posts

Posted 21 February 2002 - 22:07

I'm using Win2K and the suggested method doesn't work.  I finally figured out one that does:


  HWND nHwnd;    // Put before Begin in your script
   
  // Open the batch file.
  if (LaunchApp( "C:\\Test.bat", "" ) < 0 ) then
      MessageBox ("Unable to launch C:\\Test.bat.", SEVERE);
      abort;
  endif;

  // Wait five seconds so we can view the window before
  // it's minimized.
  Delay( 5 );

  // Retrieve the handle of the window.  The first parameter
  // is the window class.  A null string in the second parameter
  // specifies the topmost window of that class.
  nHwnd = FindWindow( "ConsoleWindowClass", "" );

  if ( nHwnd = NULL ) then
      MessageBox( "Unable to find the window.", SEVERE );
  else
      // Send system command to minimize the window.
      SendMessage( nHwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0 );

      // Keep it minimized for five seconds.
      Delay( 5 );

      // Send system command to maximize the window.
      SendMessage( nHwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0 );
  endif;