Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.4 KiB

  1. //(C) COPYRIGHT MICROSOFT CORP., 1998-1999
  2. #ifndef _CLASSES_H_
  3. #define _CLASSES_H_
  4. /*****************************************************************************
  5. class CShellExt
  6. Implement our regular shell extensions.
  7. ******************************************************************************/
  8. class ATL_NO_VTABLE CShellExt :
  9. public CComObjectRootEx<CComSingleThreadModel>,
  10. public CComCoClass<CShellExt, &CLSID_TestShellExt>,
  11. public IShellExtInit, public IContextMenu, public IShellPropSheetExt
  12. {
  13. private:
  14. UINT_PTR m_idCmd;
  15. CComPtr<IWiaItem> m_pItem;
  16. static INT_PTR CALLBACK PropPageProc (HWND hwnd, UINT msg, WPARAM wp, LPARAM lp);
  17. HRESULT GetNewRootPath (HWND hwnd);
  18. public:
  19. BEGIN_COM_MAP(CShellExt)
  20. COM_INTERFACE_ENTRY(IShellExtInit)
  21. COM_INTERFACE_ENTRY(IContextMenu)
  22. COM_INTERFACE_ENTRY(IShellPropSheetExt)
  23. END_COM_MAP()
  24. DECLARE_NO_REGISTRY()
  25. // IShellExtInit
  26. STDMETHODIMP Initialize (LPCITEMIDLIST pidlFolder,LPDATAOBJECT lpdobj,HKEY hkeyProgID);
  27. // IShellPropSheetExt
  28. STDMETHODIMP AddPages (LPFNADDPROPSHEETPAGE lpfnAddPage,LPARAM lParam);
  29. STDMETHODIMP ReplacePage (UINT uPageID,LPFNADDPROPSHEETPAGE lpfnReplacePage,LPARAM lParam) {return E_NOTIMPL;};
  30. // IContextMenu
  31. STDMETHODIMP QueryContextMenu (HMENU hmenu,UINT indexMenu,UINT idCmdFirst,UINT idCmdLast,UINT uFlags);
  32. STDMETHODIMP InvokeCommand (LPCMINVOKECOMMANDINFO lpici);
  33. STDMETHODIMP GetCommandString (UINT_PTR idCmd, UINT uType,UINT* pwReserved,LPSTR pszName,UINT cchMax);
  34. ~CShellExt ();
  35. CShellExt ();
  36. };
  37. class ATL_NO_VTABLE CWiaUIExtension :
  38. public CComObjectRootEx<CComSingleThreadModel>,
  39. public CComCoClass<CWiaUIExtension, &CLSID_TestUIExtension>,
  40. public IWiaUIExtension
  41. {
  42. public:
  43. CWiaUIExtension ();
  44. ~CWiaUIExtension ();
  45. DECLARE_REGISTRY_RESOURCEID(IDR_VIEWREG)
  46. DECLARE_PROTECT_FINAL_CONSTRUCT()
  47. BEGIN_COM_MAP(CWiaUIExtension)
  48. COM_INTERFACE_ENTRY(IWiaUIExtension)
  49. END_COM_MAP()
  50. //
  51. // IWiaUIExtension
  52. //
  53. STDMETHODIMP DeviceDialog( PDEVICEDIALOGDATA pDeviceDialogData );
  54. STDMETHODIMP GetDeviceIcon( BSTR bstrDeviceId, HICON *phIcon, ULONG nSize );
  55. STDMETHODIMP GetDeviceBitmapLogo( BSTR bstrDeviceId, HBITMAP *phBitmap, ULONG nMaxWidth, ULONG nMaxHeight );
  56. };
  57. #endif