资源描述:
《windows脚本编程核心技术精解chapter19new》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、4684-8ch19.f.qc3/3/009:42AMPage539Chapter19UsingtheWebBrowserControlInThisChapterDiscovertheversatileWebBrowsercontrol,andcreateyourowndialogboxesusingplainHTMLtemplatesEnumerateandaccessDHTMLelementsLinkscriptprocedurestoDHTMLbuttonsusingGetRef,andbypassInternetExplorersecu
2、ritydialogsControlyourWebBrowserformwindowthroughHTMLcommandsValidateHTMLforminput,andcolor-codemissingformfieldsLetyourCOMobjectrespondtoeventsfiredbytheWebBrowsercontrol,anddisablethecontextmenuthiswayUseradiobuttonsanddeterminewhichradiobuttonwasselectedCustomizeyourHTM
3、Ldialogcontainer,changecaptiontext,anddisablesizingTheWebBrowsercontrolistheheartofInternetExplorer.ItcandisplayHTMLdocumentsandisaveryversatiledesignelementyoucanincorporateintoyourowndialogboxes.Inthischapter,learnhowtousetheWebBrowsercontroltocreatefullyconfigurableHTML-base
4、dcustomdialogboxesandtransfertheresultsbackintoyourscripts.TheWebBrowserControl:MasteringReal-WorldTasksMicrosofthasstuffedallkindsofcontrolsintoWindows,andwhilemostsofthemarebusyworkingfortheoperatingsystem,yourscriptscanaccessthosecomponents,too.Oneofthemostversatilecontrolsi
5、stheWebBrowsercontrol.ItworksinsideofanyInternetExplorerwindow,andbecauseMicrosoftkeepsexpandingtheroleHTMLplays,you’llseethiscontrolinmanyWindows2000systemdialogboxes,too.TheWebBrowsercontrolisactuallyaminiatureWebbrowser.ItcontainseverythingnecessarytoloadanddisplayHTMLconten
6、t.4684-8ch19.f.qc3/3/009:43AMPage540540PartV:AccessingHiddenComponents■■Actually,InternetExplorerisjustawrappingaroundtheWebBrowsercontrol.TheInternetExplorerapplicationprovidesthetoolbarsandothergadgetshelpfultonavigatetheWeb,butthetruepowercomesfromtheWebBrowsercontrolembedde
7、dinInternetExplorer.TheWebBrowsercontrolisbynomeanslimitedtodisplayingWebpages.InChapter5,IshowedyouhowtouseInternetExplorerasaversatileScriptingHostoutputwindow.Nowit’stimetotakeacloselookattherealheartofInternetExplorer.TheWebBrowsercontrolistheperfectfoundationfortrulycustom
8、izabledialogboxes.ItmakesmuchmoresensetousetheWebBrows