Click here to Skip to main content
12,444,790 members (52,587 online)
Click here to Skip to main content
Articles » Languages » C# » Windows Forms » Downloads

Stats

39.8K views
1.9K downloads
47 bookmarked
Posted

C# WinForms Application Full Integration with HTMLHelp ( .chm ) - Help Topics, Context Sensitive Help, and Tooltips

, 4 May 2011 CPOL
Use HTMLHelp (.chm) to display help topics, context sensitive help and tooltips in C# Winform application
using System;
using Microsoft.VisualStudio.OLE.Interop;


namespace WinHelpLib
{
    class IStorageEx
    {
        IStorage iStorage;

        public IStorageEx(IStorage iStr)
        {
            iStorage = iStr;
        }

        public IStorageEx OpenStorage(string sName)
        {
            IStorage iSt = null;
            iStorage.OpenStorage(sName, null, IDocFileEx.STGM_READ, new IntPtr(0), 0, out iSt);
            if (iSt != null)
            {
                return new IStorageEx(iSt);
            }
            return null;
        }

        public IStreamEx OpenStream(string sName)
        {
            IStream iStream = null;
            iStorage.OpenStream(sName, new IntPtr(0), IDocFileEx.STGM_READ, 0, out iStream);
            if (iStream != null)
            {
                return new IStreamEx(iStream);
            }
            return null;
        }


        IEnumSTATSTG iEnumData;
        public void EnumStart()
        {
            iStorage.EnumElements(0, new IntPtr(0), 0, out iEnumData);
        }

        public bool EnumNext(ref string sName,ref STGTY sType)
        {
            STATSTG[] stg = new STATSTG[1];

            UInt32 uiFetched = 0;

            if (iEnumData.Next(1, stg, out uiFetched) != IDocFileEx.S_OK)
                return false;

            if (uiFetched != 1)
                return false;

            sName = stg[0].pwcsName;
            sType = (STGTY)stg[0].type;

            return true;


        }



    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Veselin Tenev
Software Developer (Senior)
United Kingdom United Kingdom
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160811.3 | Last Updated 5 May 2011
Article Copyright 2011 by Veselin Tenev
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid