home *** CD-ROM | disk | FTP | other *** search
/ Inside Multimedia 1995 July / IMM0795.ISO / share / tools / freeman / disk1 / userwnd.h_ / userwnd
Text File  |  1995-02-01  |  847b  |  60 lines

  1. #define __USERWND_H
  2.  
  3.  
  4. #ifndef __AWNDOBJ_H
  5. #include "awndobj.h"
  6. #endif
  7. #ifndef __WNDIDATA_H
  8. #include "wndidata.h"
  9. #endif
  10.  
  11.  
  12. class usercls
  13. {
  14.    public:
  15.  
  16.    usercls();
  17.  
  18.    char *cname;
  19.    char *mname;
  20.    DWORD style;
  21.    HICON icon;
  22.    HBRUSH bkbrush;
  23.    HCURSOR cursor;
  24.  
  25.    int reg();
  26. };
  27.  
  28. class userwnd:public abswndobj
  29. {
  30.    public:
  31.  
  32.    userwnd();
  33.   ~userwnd();
  34.  
  35.    HWND wnd;
  36.  
  37.    virtual LRESULT onmsg(UINT msg, WPARAM wp, LPARAM lp) = 0;
  38.  
  39.    HWND getwnd()
  40.    {
  41.       return wnd;
  42.    }
  43.    void del()
  44.    {
  45.       if (wnd != 0)
  46.       {
  47.          DestroyWindow(wnd);             /* wnd will be set to 0 in WM_DESTROY */
  48.       }
  49.    }
  50.    int create(usercls &c, wndinitdata &d)
  51.    {
  52.       d.p = this;
  53.  
  54.       return (wnd = d.create(c.cname)) != 0;
  55.    } 
  56.    void detach();
  57.    void attach(HWND wnd);
  58. };
  59.  
  60.