Leaked source code of windows server 2003
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.

87 lines
3.1 KiB

  1. // MSInfo4Category.h: interface for the CMSInfo4Category class.
  2. //
  3. //=============================================================================
  4. // This include file contains definitions of structures and classes used to
  5. // load and display MSInfo 4.x files, which are OLE Compound Document files.
  6. // This code requires that the MSInfo 4.x ocxs (eyedog.ocx, msisys.ocx, and others)
  7. // be registered on the system before the code will execute
  8. //=============================================================================
  9. #if !defined(AFX_MSINFO4CATEGORY_H__B47023B3_6038_4168_86A2_475C4986CEAF__INCLUDED_)
  10. #define AFX_MSINFO4CATEGORY_H__B47023B3_6038_4168_86A2_475C4986CEAF__INCLUDED_
  11. #if _MSC_VER > 1000
  12. #pragma once
  13. #endif // _MSC_VER > 1000
  14. //structure used as a header in a 4.x NFO file to
  15. //indicate which ocx can serialize the stream
  16. typedef struct
  17. {
  18. char szCLSID[40];
  19. char szStreamName[12];
  20. char szName[_MAX_PATH];
  21. char szVersion[20];
  22. DWORD dwSize;
  23. } SAVED_CONTROL_INFO;
  24. #include "msictrl.h"
  25. class CMSInfo4Category : public CMSInfoCategory
  26. {
  27. public:
  28. BOOL IsDisplayableCategory();
  29. HRESULT RefreshAllForPrint(HWND hWnd, CRect rctList);
  30. HRESULT ShowControl(HWND hWnd, CRect rctList, BOOL fShow = TRUE);
  31. CMSInfo4Category();
  32. virtual ~CMSInfo4Category();
  33. HRESULT CreateControl(HWND hWnd,CRect& rct);
  34. static HRESULT ReadMSI4NFO(CString strFileName/*HANDLE hFile*/,CMSInfo4Category** ppRootCat);
  35. static HRESULT RecurseLoad410Tree(CMSInfo4Category** ppRoot, CComPtr<IStream> pStream,CComPtr<IStorage> pStorage,CMapStringToString& mapStreams);
  36. HRESULT LoadFromStream(CComPtr<IStream> pStream,CComPtr<IStorage> pStorage);
  37. HRESULT Refresh();
  38. BOOL GetColumnInfo(int iColumn, CString * pstrCaption, UINT * puiWidth, BOOL * pfSorts, BOOL * pfLexical)
  39. {
  40. Refresh();
  41. return TRUE;
  42. }
  43. CLSID GetClsid(){return m_clsid;};
  44. void static SetDataSource(CNFO4DataSource* pnfo4DataSource){s_pNfo4DataSource = pnfo4DataSource;};
  45. void ResizeControl(const CRect & rect)
  46. {
  47. CMSIControl * p4Ctrl = NULL;
  48. //CString strCLSID(m_bstrCLSID);
  49. if (CMSInfo4Category::s_pNfo4DataSource->GetControlFromCLSID(m_strCLSID, p4Ctrl) && p4Ctrl)
  50. p4Ctrl->MoveWindow(&rect);
  51. }
  52. virtual void Print(CMSInfoPrintHelper* pPrintHelper, BOOL bRecursive);
  53. static CNFO4DataSource* s_pNfo4DataSource;
  54. protected:
  55. virtual BOOL SaveAsText(CMSInfoTextFile* pTxtFile, BOOL bRecursive);
  56. virtual void Print(HDC hDC, BOOL bRecursive,int nStartPage = 0, int nEndPage = 0);
  57. BOOL GetDISPID(IDispatch * pDispatch, LPOLESTR szMember, DISPID *pID);
  58. CString m_strStream; //used when creating the control from IStream
  59. CLSID m_clsid;
  60. DWORD m_dwView;
  61. //CComBSTR m_bstrCLSID;
  62. public:
  63. CString m_strCLSID;
  64. //a-kjaw
  65. static BOOL m_bIsControlInstalled;
  66. //a-kjaw
  67. protected:
  68. CComPtr<IStorage> m_pStorage;
  69. CComPtr<IUnknown> m_pUnknown;
  70. DataSourceType GetDataSourceType()
  71. {
  72. return NFO_410;
  73. };
  74. };
  75. #endif // !defined(AFX_MSINFO4CATEGORY_H__B47023B3_6038_4168_86A2_475C4986CEAF__INCLUDED_)