home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / nmoveh10.zip / NoMoveHandler.cpp < prev    next >
C/C++ Source or Header  |  1998-11-23  |  925b  |  38 lines

  1. /* This simple application serves as a test for the "no move"
  2.  * window handler.
  3.  *
  4.  * requires IBM VisualAge C++ version 3.0+ for OS/2 Warp v4.0+
  5.  *
  6.  * compile with:  icc.exe /Gm /B"/pm:pm" nomovehandler.cpp
  7.  */
  8.  
  9. #include <iapp.hpp>     // IApplication
  10. #include <iframe.hpp>   // IFrameWindow
  11.  
  12. // include the "no move" handler
  13. #include "NoMoveHandler.hpp"
  14.  
  15. int main()
  16. {
  17.    // create a simple frame window
  18.    IFrameWindow frame("No Move Test");
  19.  
  20.    // create an instance of the handler
  21.    NoMoveHandler handler;
  22.  
  23.    // tell the handler to handle events for our window
  24.    handler.handleEventsFor( &frame );
  25.  
  26.    // show the window -- now just try to move it!
  27.    frame.show().setFocus();
  28.  
  29.    // run the event processing until the window is closed
  30.    IApplication::current().run();
  31.  
  32.    // tell our handler to stop event processing
  33.    handler.stopHandlingEventsFor( &frame );
  34.  
  35.    return 0;
  36. }
  37.  
  38.