home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / powergui / frame1 / minmax / minmax.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-29  |  1.2 KB  |  43 lines

  1. //*********************************************************
  2. // Frame Window Basics - Minimize/Maximize Handler Example
  3. //
  4. // Copyright (C) 1994, Law, Leong, Love, Olson, Tsuji.
  5. // Copyright (c) 1997 John Wiley & Sons, Inc. 
  6. // All Rights Reserved.
  7. //*********************************************************
  8. #include <iapp.hpp>
  9. #include <iframe.hpp>
  10. #include <icconst.h>
  11. #include "chdhider.hpp"
  12.  
  13. void main ( )
  14. {
  15.   // Create a frame window from a dialog.
  16.   IFrameWindow
  17.     frame( IC_DEFAULT_FRAME_ID );
  18.   frame
  19.    .setIcon( IC_DEFAULT_FRAME_ID );
  20.  
  21.   // Create and attach the ChildHider handler.
  22.   // This handler fixes the problem of dialogs not hiding
  23.   // their child controls when minimized on the OS/2
  24.   // desktop.  As a result, a dialog control can paint over
  25.   // the dialog's minimized icon.
  26.   // To see this problem, comment out the handleEventsFor
  27.   // function and rebuild the program.  Then run the program
  28.   // on the OS/2 operating system and minimize it to the
  29.   // desktop.
  30.   ChildHider
  31.     hider;
  32.   hider
  33.    .handleEventsFor( &frame );
  34.  
  35.   // Set the input focus and show the frame window.
  36.   frame
  37.    .setFocus()
  38.    .show();
  39.  
  40.   IApplication::current().run();
  41. }
  42.  
  43.