关闭

如何调用ShowModelessHTMLDialog函数

1864人阅读 评论(0) 收藏 举报
ShowModelessHTMLDialog 函数创建一个非模态的HTML对话框。
HRESULT ShowModelessHTMLDialog(      
    HWND hwndParent,
    IMoniker *pMk,
    VARIANT *pvarArgIn,
    WCHAR *pchOptions,
    IHTMLWindow2 **ppWindow
);
 Exmaple:
#include "mshtmhst.h"
  ::CoInitialize(0) ;
  HINSTANCE hinstMSHTML = LoadLibrary(TEXT("MSHTML.DLL"));

   if (hinstMSHTML == NULL)
   {
       return;
   }

    SHOWMODELESSHTMLDIALOGFN* pfnShowModelessHTMLDialog;
    pfnShowModelessHTMLDialog =
    (SHOWMODELESSHTMLDIALOGFN*)GetProcAddress(hinstMSHTML,
    TEXT("ShowModelessHTMLDialog"));
    if (pfnShowModelessHTMLDialog)
    {
        IMoniker *pURLMoniker;
        BSTR bstrURL =
        SysAllocString(Lhttp://www.example.com/dialogsource.htm); // URL需要带 http 前缀!
        CreateURLMoniker(NULL, bstrURL, &pURLMoniker);

        if (pURLMoniker)
        {
            (*pfnShowModelessHTMLDialog)(NULL, pURLMoniker, NULL,
            NULL, NULL);

            pURLMoniker->Release();
        }

        SysFreeString(bstrURL);
    }

    FreeLibrary(hinstMSHTML);

    ::CoUninitialize();
from:http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/mshtml/reference/functions/showmodelesshtmldialog.asp

相关的函数还有ShowHTMLDialog和ShowHTMLDialogEx,这两个函数用来创建模态的HTML对话框。

其它HTML函数参考:http://msdn.microsoft.com/library/default.aspurl=/workshop/browser/mshtml/reference/functions/functions.asp

 

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:211612次
    • 积分:564
    • 等级:
    • 排名:千里之外
    • 原创:58篇
    • 转载:29篇
    • 译文:0篇
    • 评论:28条
    最新评论