home *** CD-ROM | disk | FTP | other *** search
/ Troubleshooting Netware Systems / CSTRIAL0196.BIN / attach / msj / v10n10 / vb40.exe / SHELLOCX.EXE / SHELLCTL.H < prev    next >
C/C++ Source or Header  |  1995-10-01  |  2KB  |  80 lines

  1. // shellctl.h : Declaration of the CShellinkCtrl OLE control class.
  2.  
  3. /////////////////////////////////////////////////////////////////////////////
  4. // CShellinkCtrl : See shellctl.cpp for implementation.
  5.  
  6. class CShellinkCtrl : public COleControl
  7. {
  8.     DECLARE_DYNCREATE(CShellinkCtrl)
  9.  
  10. // Constructor
  11. public:
  12.     CShellinkCtrl();
  13.  
  14. // Overrides
  15.  
  16.     // Drawing function
  17.     virtual void OnDraw(
  18.                 CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
  19.  
  20.     // Persistence
  21.     virtual void DoPropExchange(CPropExchange* pPX);
  22.  
  23.     // Reset control state
  24.     virtual void OnResetState();
  25.  
  26. // Implementation
  27. protected:
  28.     ~CShellinkCtrl();
  29.  
  30.     DECLARE_OLECREATE_EX(CShellinkCtrl)    // Class factory and guid
  31.     DECLARE_OLETYPELIB(CShellinkCtrl)      // GetTypeInfo
  32.     DECLARE_PROPPAGEIDS(CShellinkCtrl)     // Property page IDs
  33.     DECLARE_OLECTLTYPE(CShellinkCtrl)        // Type name and misc status
  34.  
  35. // Message maps
  36.     //{{AFX_MSG(CShellinkCtrl)
  37.         // NOTE - ClassWizard will add and remove member functions here.
  38.         //    DO NOT EDIT what you see in these blocks of generated code !
  39.     //}}AFX_MSG
  40.     DECLARE_MESSAGE_MAP()
  41.  
  42. // Dispatch maps
  43.     //{{AFX_DISPATCH(CShellinkCtrl)
  44.     afx_msg LPUNKNOWN GetShellLink();
  45.     afx_msg void SetShellLink(LPUNKNOWN newValue);
  46.     afx_msg BSTR CreateLink(LPCTSTR Path, LPCTSTR Description, BOOL OnDesk);
  47.     afx_msg BSTR ResolveLink(long hWnd, LPCTSTR Shortcut);
  48.     //}}AFX_DISPATCH
  49.     DECLARE_DISPATCH_MAP()
  50.  
  51. // Event maps
  52.     //{{AFX_EVENT(CShellinkCtrl)
  53.     //}}AFX_EVENT
  54.     DECLARE_EVENT_MAP()
  55.  
  56. // Internal stuff to track the IShellLink
  57.     IShellLink *m_link;
  58.     CString     m_path;
  59.     CString     m_shortcut;
  60.     CString     m_description;
  61.     BOOL        m_ondesk;
  62.  
  63.     IShellLink *CreateShellLink();
  64.     void ReleaseShellLink();
  65.  
  66.     void CreateShortcutName();
  67.  
  68.     LPSTR Stupid(LPCSTR pszShortcutFile, LPSTR pszLink, LPSTR pszDesc);
  69.  
  70. // Dispatch and event IDs
  71. public:
  72.     enum {
  73.     //{{AFX_DISP_ID(CShellinkCtrl)
  74.     dispidShellLink = 1L,
  75.     dispidCreateLink = 2L,
  76.     dispidResolveLink = 3L,
  77.     //}}AFX_DISP_ID
  78.     };
  79. };
  80.