home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ctlcpp.zip / MCTLEVT.HPP < prev    next >
C/C++ Source or Header  |  1994-06-06  |  2KB  |  63 lines

  1. #ifndef _MCTLEVT_
  2.    #define _MCTLEVT_
  3.  
  4. /***************************************************************/
  5. /* Filename: mctlevt.hpp                                       */
  6. /*                                                             */
  7. /* Purpose: The declaration of MControlEvent class. This class */
  8. /*          is an extension of the IControlEvent class. Event  */
  9. /*          classes which wrap WM_CONTROL messages should      */
  10. /*          inherit from this class as opposed to IControlEvent*/
  11. /*                                                             */
  12. /* Program name: cppctl.exe     Title: C++ PM Control Test App */
  13. /* OS/2 Developer Magazine, Issue: Sept. '94, page             */
  14. /* Article title: Writing OS/2 PM Controls in C++              */
  15. /* Authors: Eric Snell and Lori Ruffing                        */
  16. /*                                                             */
  17. /* Description: This example shows how to implement an OS/2 PM */
  18. /*              control window in C++.                         */
  19. /*                                                             */
  20. /* Program Requirements: This example requires the IBM C Set++ */
  21. /*                       compiler and libraries.               */
  22. /***************************************************************/
  23.  
  24. #ifndef _ICTLEVT_
  25.    #include <ictlevt.hpp>
  26. #endif
  27.  
  28. #ifndef _IHANDLE_
  29.    #include <ihandle.hpp>
  30. #endif
  31.  
  32. #ifndef _ISTRING_
  33.    #include <istring.hpp>
  34. #endif
  35.  
  36. // Align classes on 4 byte boundary
  37. #pragma pack(4)
  38.  
  39. //-------------------------------------------------------------------
  40. // We've extended IControlEvent to return the control window's
  41. // handle and class name. When we get a WM_CONTROL msg (wrapped
  42. // by MControlEvent) we need to distinguish what class sent the
  43. // event in the handler code. This way we won't mistakenly intercept
  44. // control messages in the wrong handler.
  45. //-------------------------------------------------------------------
  46. class MControlEvent : public IControlEvent
  47.    {
  48.    public:
  49.       MControlEvent(IEvent& evt);
  50.       virtual ~MControlEvent();
  51.  
  52.       virtual IWindowHandle controlHandle() const;
  53.       virtual IString controlClassName() const;
  54.    };
  55.  
  56. // Resume compiler default packing
  57. #pragma pack()
  58.  
  59.  
  60. #endif //#ifndef _MCTLEVT_
  61.  
  62.  
  63.