Click here to Skip to main content
Click here to Skip to main content
Articles » Languages » C# » Windows Forms » Downloads
 
Add your own
alternative version

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 System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.OLE.Interop;

namespace WinHelpLib
{

    enum STGTY
    {
        STGTY_STORAGE = 1,
        STGTY_STREAM = 2,
        STGTY_LOCKBYTES = 3,
        STGTY_PROPERTY = 4
    };

    enum STREAM_SEEK
    {
        STREAM_SEEK_SET = 0,
        STREAM_SEEK_CUR = 1,
        STREAM_SEEK_END = 2
    };


    enum STATFLAG
    {
        STATFLAG_DEFAULT = 0,
        STATFLAG_NONAME = 1,
        STATFLAG_NOOPEN = 2
    };

    class IDocFileEx
    {
        public const int S_OK = 0x00000000;
        public const int S_FALSE = 0x00000001;

        public const int STGM_READ = 0x00000000;
        public const int STGM_WRITE = 0x00000001;
        public const int STGM_READWRITE = 0x00000002;
        public const int STGM_SHARE_DENY_NONE = 0x00000040;
        public const int STGM_SHARE_DENY_READ = 0x00000030;
        public const int STGM_SHARE_DENY_WRITE = 0x00000020;
        public const int STGM_SHARE_EXCLUSIVE = 0x00000010;
        public const int STGM_PRIORITY = 0x00040000;
        public const int STGM_CREATE = 0x00001000;
        public const int STGM_CONVERT = 0x00020000;
        public const int STGM_FAILIFTHERE = 0x00000000;
        public const int STGM_DIRECT = 0x00000000;
        public const int STGM_TRANSACTED = 0x00010000;
        public const int STGM_NOSCRATCH = 0x00100000;
        public const int STGM_NOSNAPSHOT = 0x00200000;
        public const int STGM_SIMPLE = 0x08000000;
        public const int STGM_DIRECT_SWMR = 0x00400000;
        public const int STGM_DELETEONRELEASE = 0x04000000;


        public static IStorageEx Open(string sName)
        {
            try
            {
                ITStorage itss = (ITStorage)(new ITStorageCoClass());
                IStorage iSt = itss.StgOpenStorage(sName, new IntPtr(0), STGM_READ, new IntPtr(0), 0);
                if (iSt != null)
                {
                    return new IStorageEx(iSt);
                }
            }
            catch
            {
            }
            return null;
        
        }

    }
}

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

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