How to realize Web control's context menu by c#
-
:zzz:somebody tell me can use IDocHostUIHandler can relize this idea,but how can do this by c#? ok
-
:zzz:somebody tell me can use IDocHostUIHandler can relize this idea,but how can do this by c#? ok
IDocHostUIHandler
is defined in the MsHtmHst.idl file. Basic idea is you can write your own idl file and use the midl compiler to generate the type library. Following that you can use the .NET Framework's command line tooltlbimp
to generate a .NET assembly you can include within your application.[
uuid(47F05070-FD66-45cc-AD99-74260F94A16B)
]
library WebInterop
{
import "MsHtmHst.idl";
enum tagDOCHOSTUIDBLCLK;
enum tagDOCHOSTUIFLAG;
enum tagDOCHOSTUITYPE;
interface ICustomDoc;
interface IDocHostShowUI;
interface IDocHostUIHandler;
interface IDocHostUIHandler2;
interface IHostDialogHelper;
}Then create the type library:
midl WebInterop.idl /tlb bin\WebInterop.tlb
Then create the .NET assembly:
tlbimp bin\WebInterop.tlb /out:bin\WebInterop.dll
Now create a class that inherits from
IDocHostUIHandler
and of course implements the appropriate methods. - Nick Parker
My Blog | My Articles