home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ontophan.zip / OnTopHandler.cpp < prev    next >
Text File  |  1998-09-07  |  1KB  |  40 lines

  1. /* This simple application serves as a test for the "on top"
  2.  * window handler.  For more information, see the accompanying
  3.  * "OnTopHandler.hpp" file, or take a look at:
  4.  * http://people.netscape.com/law/samples/index.html
  5.  *
  6.  * requires IBM VisualAge C++ version 3.0+ for OS/2 Warp v4.0+
  7.  *
  8.  * compile with:  icc.exe /Gm /B"/pm:pm" ontophandler.cpp
  9.  */
  10.  
  11. #include <iapp.hpp>     // IApplication
  12. #include <iframe.hpp>   // IFrameWindow
  13.  
  14. // include the "on top" handler
  15. #include "OnTopHandler.hpp"
  16.  
  17. int main()
  18. {
  19.    // create a simple frame window
  20.    IFrameWindow frame("On Top Test");
  21.  
  22.    // create an instance of the handler
  23.    OnTopHandler handler;
  24.  
  25.    // tell the handler to handle events for our window
  26.    handler.handleEventsFor( &frame );
  27.  
  28.    // show the window -- now just try to get something on top!
  29.    frame.show().setFocus();
  30.  
  31.    // run the event processing until the window is closed
  32.    IApplication::current().run();
  33.  
  34.    // tell our handler to stop event processing
  35.    handler.stopHandlingEventsFor( &frame );
  36.  
  37.    return 0;
  38. }
  39.  
  40.