HexShellMenu.h
上传用户:aiweisk
上传日期:2007-05-01
资源大小:85k
文件大小:2k
源码类别:

编辑器/阅读器

开发平台:

DOS

  1. //---------------------------------------------------------------------------------------
  2. // Quick Hex Shell extension
  3. // Copyright (c) 2000 by Shanker.C
  4. // All rights reserved
  5. // Author's consent required if this program is to be used for commercial purposes
  6. // No warranty of any kind, expressed or implied, is included with this
  7. // software; use at your own risk, responsibility for damages (if any) to
  8. // anyone resulting from the use of this software rests entirely with the user.
  9. // Please send comments/suggestions/criticisms to: Shanker@xlprint.com
  10. // March 7, 2000
  11. //---------------------------------------------------------------------------------------
  12. // HexShellMenu.h : Declaration of the CHexShellMenu
  13. #ifndef __HEXSHELLMENU_H_
  14. #define __HEXSHELLMENU_H_
  15. //---------------------------------------------------------------------------------------
  16. #include "resource.h"       // main symbols
  17. #include "IContextMenuImpl.h"
  18. #include "IShellExtInitImpl.h"
  19. #include "hexdlg.h"
  20. #include <comdef.h>
  21. //---------------------------------------------------------------------------------------
  22. // CHexShellMenu
  23. class ATL_NO_VTABLE CHexShellMenu : 
  24. public CComObjectRootEx<CComSingleThreadModel>,
  25. public CComCoClass<CHexShellMenu, &CLSID_HexShellMenu>,
  26. public IShellExtInitImpl, 
  27. public IContextMenuImpl,
  28. public IDispatchImpl<IHexShellMenu, &IID_IHexShellMenu, &LIBID_HEXSHELLLib>
  29. {
  30. public:
  31. CHexShellMenu()
  32. {
  33. m_bOSNT = FALSE;
  34. if((GetVersion() & 0x80000000) == 0)
  35. m_bOSNT = TRUE;
  36. }
  37. // IContextMenu methods
  38. STDMETHOD(GetCommandString)(UINT, UINT, UINT*, LPSTR, UINT);
  39. STDMETHOD(InvokeCommand)(LPCMINVOKECOMMANDINFO);
  40. STDMETHOD(QueryContextMenu)(HMENU, UINT, UINT, UINT, UINT);
  41. // IShellExtInit methods 
  42. STDMETHOD(Initialize)(LPCITEMIDLIST, LPDATAOBJECT, HKEY);
  43. char m_szPath[MAX_PATH];
  44. CHexDlg* m_pHexDlg;
  45. BOOL m_bOSNT;
  46. DECLARE_REGISTRY_RESOURCEID(IDR_HEXSHELLMENU)
  47. DECLARE_PROTECT_FINAL_CONSTRUCT()
  48. BEGIN_COM_MAP(CHexShellMenu)
  49. COM_INTERFACE_ENTRY(IHexShellMenu)
  50. COM_INTERFACE_ENTRY(IDispatch)
  51. COM_INTERFACE_ENTRY(IShellExtInit)
  52. COM_INTERFACE_ENTRY(IContextMenu)
  53. END_COM_MAP()
  54. // IHexShellMenu
  55. public:
  56. };
  57. //---------------------------------------------------------------------------------------
  58. #endif //__HEXSHELLMENU_H_
  59. //---------------------------------------------------------------------------------------