C ++ directly calls IE dialog form display page

xiaoxiao2021-03-06  58

#include #include #include

/ ************************************************** *******************************

WinMain ()

*********************************************************** *********************** /

int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {HINSTANCE hinstMSHTML = LoadLibrary (TEXT ( "MSHTML.DLL")); // load the dynamic link library WCHAR url [] = L "http: // blog .9cbs.net / zlyperson "; // This address name can be replaced directly with the HTML file name

IF (hinstmshtml) // loaded dynamic connection library success {Showhtmldialogfn * pfnshowhtmldialog;

PfnShowhtmldialog = (Showhtmldialogfn *) getProcaddress (HinstMSHTML, Text ("Showhtmldialog");

IF (pfnshowhtmldialog) {iMoniker * Moniker = NULL;

// if (Failed (Createurlmoniker)) {freeelibrary (hinstmshtml); return 0;}

VARIANT varArgs; VARIANT varOut; VariantInit (& varOut); varArgs.vt = VT_BSTR; varArgs.bstrVal = SysAllocString (L "RookIE Browser"); TCHAR * tcFeatures = "dialogWidth: 100px; dialogHeight: 100px; dialogLeft: 0px; dialogTop: 0px "

Pfnshowhtmldialog (Null, Moniker, & Vargs, TcFeatures, & Varout);

VariantClear (& VARARGS);

IF (Moniker! = NULL) Moniker-> Release ();

// Show success, return True Return 0;

} Else // getProcessAddress failed Return 0;

Freelibrary (hinstmshtml);} else // loaded dynamic connection library failed RETURN 0;

Return 0;

}

转载请注明原文地址:https://www.9cbs.com/read-82478.html

New Post(0)