« Webページを丸ごとビットマップに | トップページ | WebBrowserコントロールのフォントサイズを変更する »

WebBrowserコントロールを制御する

WebBrowserコントロールには「画像を表示する・しない」や「BGMの再生をする・しない」等のプロパティはありません。これを設定するにはWebBrowserコントロールを貼り付けたコンテナのAmbientPropertyを設定する必要があります。

次のサンプルは画像の表示・非表示を切り替えます。

Imports System.Runtime.InteropServices

Public Class Form1

    Dim WebBrowerCtrl As WebBrowserControler
    Dim WebBrowser1 As New WebBrowser
    Dim WithEvents Button1 As New Button
    Dim WithEvents Button2 As New Button

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.WebBrowser1.Dock = DockStyle.Fill
        Me.Button1.Location = New Point(0, 0)
        Me.Button2.Location = New Point(Me.Button1.Size.Width, 0)
        Me.Button1.Text = "画像非表示"
        Me.Button2.Text = "画像表示"
        Me.Controls.Add(Me.Button1)
        Me.Controls.Add(Me.Button2)
        Me.Controls.Add(Me.WebBrowser1)
        WebBrowerCtrl = New WebBrowserControler(Me.WebBrowser1)
        Me.WebBrowser1.Navigate("http://www.yahoo.co.jp")
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.WebBrowerCtrl.DlControl = Me.WebBrowerCtrl.DlControl And Not DLCTL.DLIMAGES
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Me.WebBrowerCtrl.DlControl = Me.WebBrowerCtrl.DlControl Or DLCTL.DLIMAGES
    End Sub

End Class

<ComVisible(True)> _
Public Class WebBrowserControler
    Inherits Control
    Implements IOleClientSite

    Private Const DISPID_AMBIENT_DLCONTROL As Integer = -5512
    Private _WebBrowser As WebBrowser
    Private _DlControl As DLCTL = DLCTL.DLIMAGES Or DLCTL.BGSOUNDS Or DLCTL.VIDEOS

    Public Sub New(ByVal WebBrowser As WebBrowser)
        Me._WebBrowser = WebBrowser
        DirectCast(Me._WebBrowser.ActiveXInstance, IOleObject).SetClientSite(Me)
    End Sub

    <DispId(DISPID_AMBIENT_DLCONTROL)> _
    Public Function Didpid_Ambient_DlControl() As Integer
        Return Me._DlControl
    End Function

    Private Sub OnAmbientPropertyChange()
        DirectCast(Me._WebBrowser.ActiveXInstance.Application, IOleControl).OnAmbientPropertyChange(DISPID_AMBIENT_DLCONTROL)
    End Sub

    Public Property DlControl() As DLCTL
        Get
            Return Me._DlControl
        End Get
        Set(ByVal value As DLCTL)
            Me._DlControl = value
            Me.OnAmbientPropertyChange()
            Me._WebBrowser.Refresh()
        End Set
    End Property

    Public Sub GetContainer(ByRef ppContainer As Object) Implements IOleClientSite.GetContainer
    End Sub
    Public Sub GetMoniker(ByVal dwAssign As Integer, ByVal dwWhichMoniker As Integer, ByRef ppmk As Object) Implements IOleClientSite.GetMoniker
    End Sub
    Public Sub OnShowWindow(ByVal fShow As Boolean) Implements IOleClientSite.OnShowWindow
    End Sub
    Public Sub RequestNewObjectLayout() Implements IOleClientSite.RequestNewObjectLayout
    End Sub
    Public Sub SaveObject() Implements IOleClientSite.SaveObject
    End Sub
    Public Sub ShowObject() Implements IOleClientSite.ShowObject
    End Sub

End Class

Public Enum DLCTL As Integer
    BGSOUNDS = &H40 'BGMを再生する
    DLIMAGES = &H10 'サーバーから画像をダウンロードする
    DOWNLOADONLY = &H800 'コンポーネントをダウンロードするが表示しない
    FORCEOFFLINE = &H10000000 '常にオフラインモード
    NO_BEHAVIORS = &H8000
    NO_CLIENTPULL = &H20000000
    NO_DLACTIVEXCTLS = &H400 'ActiveXコントロールをダウンロードしない
    NO_FRAMEDOWNLOAD = &H1000 'フレームをダウンロードしない
    NO_JAVA = &H100 'JAVAアプレットを実行しない
    NO_METACHARSET = &H10000
    NO_RUNACTIVEXCTLS = &H200 'ActiveXコントロールを実行しない
    NO_SCRIPTS = &H80 'スクリプトを実行しない
    OFFLINE = &H80000000
    OFFLINEIFNOTCONNECTED = &H80000000
    PRAGMA_NO_CACHE = &H4000
    RESYNCHRONIZE = &H2000
    SILENT = &H40000000 'ダイアログを表示しない
    URL_ENCODING_DISABLE_UTF8 = &H20000
    URL_ENCODING_ENABLE_UTF8 = &H40000
    VIDEOS = &H20 'ビデオクリップを再生する
End Enum

<GuidAttribute("B196B288-BAB4-101A-B69C-00AA00341D07"), _
InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)> _
Public Interface IOleControl

    Sub GetControlInfo(ByRef pCI As Object)
    Sub OnMnemonic(ByRef pMsg As Object)
    Sub OnAmbientPropertyChange(ByVal dispID As Integer)
    Sub FreezeEvents(ByVal bFreeze As Boolean)

End Interface

<Guid("00000118-0000-0000-C000-000000000046"), _
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
Public Interface IOleClientSite

    Sub SaveObject()
    Sub GetMoniker(ByVal dwAssign As Integer, ByVal dwWhichMoniker As Integer, ByRef ppmk As Object)
    Sub GetContainer(ByRef ppContainer As Object)
    Sub ShowObject()
    Sub OnShowWindow(ByVal fShow As Boolean)
    Sub RequestNewObjectLayout()

End Interface

<Guid("00000112-0000-0000-C000-000000000046"), _
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
Public Interface IOleObject

    Sub SetClientSite(ByVal pClientSite As IOleClientSite)
    Sub GetClientSite(ByRef ppClientSite As IOleClientSite)
    Sub SetHostNames(ByVal szContainerApp As Object, ByVal szContainerObj As Object)
    Sub Close(ByVal dwSaveOption As Integer)
    Sub SetMoniker(ByVal dwWhichMoniker As Integer, ByVal pmk As Object)
    Sub GetMoniker(ByVal dwAssign As Integer, ByVal dwWhichMoniker As Integer, ByVal ppmk As Object)
    Sub InitFromData(ByVal pDataObject As IDataObject, ByVal fCreation As Boolean, ByVal dwReserved As Integer)
    Sub GetClipboardData(ByVal dwReserved As Integer, ByRef ppDataObject As IDataObject)
    Sub DoVerb(ByVal iVerb As Integer, ByVal lpmsg As Integer, ByVal pActiveSite As Object, ByVal lindex As Integer, ByVal hwndParent As Integer, ByVal lprcPosRect As Integer)
    Sub EnumVerbs(ByRef ppEnumOleVerb As Object)
    Sub Update()
    Sub IsUpToDate()
    Sub GetUserClassID(ByVal pClsid As Integer)
    Sub GetUserType(ByVal dwFormOfType As Integer, ByVal pszUserType As Integer)
    Sub SetExtent(ByVal dwDrawAspect As Integer, ByVal psizel As Integer)
    Sub GetExtent(ByVal dwDrawAspect As Integer, ByVal psizel As Integer)
    Sub Advise(ByVal pAdvSink As Object, ByVal pdwConnection As Integer)
    Sub Unadvise(ByVal dwConnection As Integer)
    Sub EnumAdvise(ByRef ppenumAdvise As Object)
    Sub GetMiscStatus(ByVal dwAspect As Integer, ByVal pdwStatus As Integer)
    Sub SetColorScheme(ByVal pLogpal As Object)

End Interface

|

« Webページを丸ごとビットマップに | トップページ | WebBrowserコントロールのフォントサイズを変更する »

コメント

Я не обещаю вам миллионы, но зарабатывать 50 000 руб в месяц - более , чем реально.
Получите доступ к 20-минутному видео в котором вы узнаете всю схему заработка в Интернете.
Нажмите на кнопку ниже
введите ваше имя и почту в форму, и получите доступ к видео прямо на ваш email
http://partglo.ru/affiliate/10506657

投稿: KellyOnecy | 2019年5月 3日 (金) 21時34分

What’s the time in washington * Video
<p>What’s the time in washington What’s the time in washington Best Time to Visit Washington DC Travel Tips Related Articles Over 20 million people visit Washington, D.C., every year. Most of them between March and June, with a break in visitation during the notoriously hot and humid summer months of July and August. Travelers return to the city briefly in late September through October, before the city goes quiet in winter when visits drop to approximately half what other months see. Each season introduces different adventures in the Capital City. Spring is synonymous with the National Cherry Blossom Festival. In ...</p>
<p>The post <a href="http://bathrooms.remmont.com/whats-the-time-in-washington-video/">What’s the time in washington * Video</a> appeared first on <a href="http://bathrooms.remmont.com">Bathrooms</a>.</p>


[url=http://law.remmont.com]Cameroon Business[/url]

投稿: REMONTdege | 2019年5月31日 (金) 09時18分

University of colorado main campus \ Video
<p>University of colorado main campus University of colorado main campus Campus Use of University Facilities This policy is adopted pursuant...</p>
<p>The post <a href="http://55.remmont.com/2019/05/15/university-of-colorado-main-campus-video/">University of colorado main campus \ Video</a> appeared first on <a href="http://55.remmont.com">Property News</a>.</p>


[url=http://finances.remmont.com]Sierra-leone Finance[/url]

投稿: REMONTdege | 2019年5月31日 (金) 17時35分

[url=http://remmont.com/]stock earnings dates
[/url]
State life insurance nz ^ Video
<p>#How #to #Compare #Life #Insurance [quote]&laquo; Web?????????????? | ?????? | WebBrowser??????????????????? &raquo;[/quote]s #Online, #Life, #Income #Protection #- #Compare #Now #- #The #smarter #way #to #insure State life insurance nz How to Compare Life Insurance Quotes Online It is always considered prudent to get several quotes before making a purchase. In the case of personal insurance there is more to just comparing...</p>
<p>The post [url=http://204.remmont.com/2019/07/18/state-life-insurance-nz-video/] State life insurance nz ^ Video[/url] appeared first on [url=http://204.remmont.com] Fort Worth Finance[/url].</p>
[url=http://kvartir.remmont.com]смета на отделочные работы [/url]
[b]BONUS 120 FREE DOFOLLOW LINK SITE[/b]
[url=http://credit.remmont.com/first-premier-credit-card-login-access-to-myfirstpremiercard-account-firestone-credit-card-firestone-credit-card/] myfirstpremiercard[/url]
[url=http://rentals.remmont.com/my-tritonlink-tools-ucsd-tritonlink/] tritonlink[/url]
[url=http://credit.remmont.com/first-premier-credit-card-login-access-to-myfirstpremiercard-account-firestone-credit-card-firestone-credit-card/] firstpremiercard login[/url]
[url=http://remmont.com/walmart-careers-submit-a-walmart-job-application-online-att-careers-att-careers/] walmartcareers[/url]
[url=http://credit.remmont.com/first-premier-credit-card-login-access-to-myfirstpremiercard-account-firestone-credit-card-firestone-credit-card/] first premier login[/url]
[url=http://rentals.remmont.com/my-tritonlink-tools-ucsd-tritonlink/] webreg ucsd[/url]
[url=http://credit.remmont.com/first-premier-credit-card-login-access-to-myfirstpremiercard-account-firestone-credit-card-firestone-credit-card/] firestone credit card login[/url]
[url=http://remmont.com/jail-view-2/] src jail view[/url]
[url=http://credit.remmont.com/first-premier-credit-card-login-access-to-myfirstpremiercard-account-firestone-credit-card-firestone-credit-card/]firstpremiercard login[/url]
[url=http://remmont.com/lasd-inmate-locator/]lasd inmate locator[/url]
[url=http://remmont.com/lasd-inmate-locator/]lasd inmate search[/url]
[url=http://credit.remmont.com/first-premier-credit-card-login-access-to-myfirstpremiercard-account-firestone-credit-card-firestone-credit-card/]first premier login[/url]
[url=http://remmont.com/walmart-careers-submit-a-walmart-job-application-online-att-careers-att-careers/]www walmartcareers com[/url]
[url=http://credits.remmont.com/first-premier-credit-card-login-access-to-myfirstpremiercard-account-firestone-credit-card-firestone-credit-card/]mypremiercreditcard[/url]
[url=http://credit.remmont.com/first-premier-credit-card-login-access-to-myfirstpremiercard-account-firestone-credit-card-firestone-credit-card/]firestone credit card login[/url]
[url=http://remmont.com/lasd-inmate-locator/]lasd inmate[/url]
[url=http://remmont.com/walmart-careers-submit-a-walmart-job-application-online-att-careers-att-careers/]walmart job application[/url]
[url=http://rentals.remmont.com/my-tritonlink-tools-ucsd-tritonlink/]ucsd tritonlink[/url]
[url=http://remmont.com/walmart-careers-submit-a-walmart-job-application-online-att-careers-att-careers/]home depot careers[/url]
[url=http://remmont.com/walmart-careers-submit-a-walmart-job-application-online-att-careers-att-careers/]homedepot com[/url]
[url=http://renta.remmont.com/rental-car-usa-bus-rentals/]walgreens topix[/url]
http://remmont.com/how-to-remove-credit-card-from-xbox-video/
http://remmont.com/best-value-auto-sales-used-cars-anchorage-ak-dealer-car-values-used/
http://remmont.com/estudio-de-abogados-abogado-laboral-abogado-laboralista-abogado-laboralista-lima-abogado-laboralista-peru-abogados-laboralistas-consulta-abogado-laboralista-laboral-abogado-laboral-en-linea/
http://remmont.com/14-top-rated-tourist-attractions-in-west-virginia-planetware-video-4/
http://remmont.com/2nd-hand-cas-video-2/
http://remmont.com/loan-calculator-free-download/
http://remmont.com/credit-report-credit-check-free-credit-score-experian-credit-re-credit-re-2/
http://remmont.com/apartmani-grad-pag-otok-pag-smjeеўtaj-apartmani-sobe-bungalovi-grad-pag-3-grad/
http://remmont.com/how-to-apply-for-a-student-credit-card-credit-expert-login/
http://remmont.com/bmw-mercedes-audi-porsche-used-cars-dealer-washington-dc-baltimore-md-i-want-to-sell-my-car/
http://remmont.com/all-new-latest-cars-video-8/
http://remmont.com/find-cheap-car-insurance-in-massachusetts-the-zebra-cheapest-car-insurance-massachusetts/
http://remmont.com/classic-car-insurance-collector-car-insurance-auto-computer/
http://remmont.com/gmc-auto-parts-online-body-parts-car-accessories-performance-parts-automotive-parts-wheels-etc-used-cars-by-owner/
http://remmont.com/how-to-buy-a-house-with-bad-credit-credit-reporting-bureaus/
http://remmont.com/sewage-ejector-pump-replacement-friedman-plumbing-express-plumbing-sump-pump/
http://remmont.com/discount-auto-body-parts-online-cheap-aftermarket-parts-auto-parts-wholesale-auto-parts-wholesale-3/
http://remmont.com/flСЊge-zum-besten-preis-buchen-gunstigste-versicherung/
http://remmont.com/affordable-arizona-group-health-insurance/
http://remmont.com/9-ways-to-detox-naturally-in-the-new-year-detox-naturally/
http://remmont.com/decoracion-de-banos-decoracion-cuartos-de-bano/
http://remmont.com/houston-bmw-auto-parts-store/
http://remmont.com/used-car-dealers-honda-auto-parts/
http://remmont.com/login-citizens-advice-buying-a-car-buying-a-car/
http://remmont.com/key-auto-mall-in-moline-including-address-phone-dealer-reviews-directions-a-map-inventory-and-more-key-auto-mall-key-auto-mall-2/
http://remmont.com/home-basf-s-care-creations-basf-careers-basf-careers/
http://remmont.com/indiana-univ-purdue-univ-video/
http://remmont.com/riversun-touristic-hotel-riosol-vacaciones-en-las-islas-canarias-vacaciones-en-gran-canaria-rio-apartments-rio-apartments/
http://remmont.com/get-credit-report-free-free-annual-credit-report-no-credit-card/
http://remmont.com/on-sale-nevada-cheap-cars-carquest-auto-parts/
http://remmont.com/home-7-eleven-careers-7-11-careers-7-11-careers/
http://remmont.com/autoprotect-monitorizare-gps-management-flota-auto-gps-tracking-buchanan-auto-park/
http://remmont.com/springfield-illinois-to-chicago-illinois-video-2/
http://remmont.com/kings-fiat-home-and-auto-insurance/
http://remmont.com/credit-reference-agencies-municipal-credit-union/
http://remmont.com/a-affordable-insurance-agency-inc-affordable-car-home-and-auto-insurance-quotes-ma-insurance-high-risk-auto-insurance-dui-insurance-massachusetts-brockton-framingham-leominster-north-attlebo/
http://remmont.com/all-disney-cars-characters-video-6/
http://remmont.com/cardonebanking-no-credit-checks-online-banking-prepaid-card-basic-bank-account-apply-for-a-credit-card-with-no-credit-apply-for-a-credit-card-with-no-credit/
http://remmont.com/auto-boat-and-rv-loans-auto-owners-insurance/
http://remmont.com/kia-salvage-parts-original-kia-parts-kia-auto-parts-kia-auto-parts/
http://remmont.com/auto-city-sales-service-serving-manchester-southern-nh-since-1989-auto-zone-com/
http://remmont.com/cheapest-car-insurance-in-florida-cheap-florida-auto-insurance/
http://remmont.com/air-force-careers-air-force-careers-air-force-careers-2/
http://remmont.com/search-apartments-for-rent-condos-and-rental-homes-mynewplace-find-an-apartment-find-an-apartment/
http://remmont.com/enterprise-mobile-applications-mobility-strategy-enterprise-mobility-services/
http://remmont.com/how-to-find-an-auto-paint-store-near-you-replacement-auto-parts/
http://remmont.com/coberturas-de-seguros-de-vehiculos-entiende-tu-seguro-de-auto-seguros-para-automoviles/
http://remmont.com/employment-practices-liability-insurance-epli-coverage-liability-insurance-for-doctors/
http://remmont.com/goodyear-auto-pros-used-car-dealer/
http://remmont.com/car-buying-services-research-purchase-and-save-on-a-new-car-suzuki-auto/
http://remmont.com/compare-cheap-life-insurance-quotes-moneysupermarket-inexpensive-term-life-insurance/
http://remmont.com/united-services-automobile-association-insurance-company-used-honda-accord/
http://remmont.com/all-vehicle-information-video-4/
http://remmont.com/car-insurance-quotes-maryland-maryland-auto-insurance-quotes-auto-insurance-in-maryland/
http://remmont.com/car-sales-rev-up-on-us-holiday-weekend-extended-auto-warranty/
http://remmont.com/career-ladder-healthcare-specialist-rec-2-rec-recruitment-here-to-help-career-ladder-career-ladder/
http://remmont.com/jeep-wrangler-is-cheapest-vehicle-to-insure-ranking-says-chicago-tribune-jeep-insurance-rates/
http://remmont.com/auto-usate-a-cantu-le-migliori-occasioni-migliori-occasioni-auto-usate-2/
http://remmont.com/audi-car-leasing-contract-hire-nationwide-vehicle-contracts-second-hand-car-parts/
http://remmont.com/jay-harrington-swat-4/
http://remmont.com/cars-for-sale-auto-loans-online/
http://remmont.com/amy-schumer-kavanaugh-8/
http://remmont.com/wie-viel-verdient-man-als-altenpflegerin-forum-von-medi-jobs-wie-viel-verdient-man-im-einzelhandel-ausbildung/
http://remmont.com/credit-loans-for-people-with-bad-credit-and-video/
http://remmont.com/hot-car-classified-buy-sell-trade-used-cars-murrays-auto-parts/
http://remmont.com/15-things-you-might-not-know-about-utah-mental-floss-video/
http://remmont.com/ofertas-de-viajes-baratos-hoteles-agencia-de-viajes-eroski-online-agencias-de-viajes-baratas/
http://remmont.com/localita-consigliate-per-vacanze-con-cani-nel-salento-bb-con-cani/
http://remmont.com/deutschland-borse-deutschland-borse/
http://remmont.com/basic-training-trends-in-learning-development-departments-pharmaceutical-executive-pharmaceutical-trends-pharmaceutical-trends/
http://remmont.com/addison-wesley-professional-web-development-major/
http://remmont.com/auto-web-expo-peters-auto-mall/
http://remmont.com/current-career-opportunities-novartis-oncology-novartis-careers-novartis-careers/
http://remmont.com/marazul-agencia-de-viajes-a-cuba-en-miami-agencias-de-viajes-a-cuba/
http://remmont.com/car-insurance-quotes-compare-car-insurance-liberty-insurance-ireland-get-car-insurance-online-2/
http://remmont.com/glenview-plumber-heating-air-conditioning-hvac-glenview-plumbers/
http://remmont.com/closest-police-station/
http://remmont.com/ohio-attorney-general-sues-5-pharmaceutical-companies-over-opioid-epidemic-abc-news-best-pharmaceutical-companies-best-pharmaceutical-companies/
http://remmont.com/after-bankruptcy-apply-for-credit-cards-three-free-credit-reports/
http://remmont.com/collision-insurance-and-comprehensive-insurance-explained-comprehensive-auto-insurance/
http://remmont.com/garage-door-repair-san-diego-video-2/
http://remmont.com/car-hire-from-easycar-compare-cheap-car-rental-deals-worldwide-auto-parts-usa/
http://remmont.com/fl-dept-of-insurance-video/
http://remmont.com/what-is-a-good-credit-score-experian-creditexpert-how-to-fix-your-credit-score/
http://remmont.com/chattanooga-personal-injury-lawyer-tennessee-personal-injury-lawyer/
http://remmont.com/casual-jobs-cotton-australia-cotton-on-careers-cotton-on-careers/
http://remmont.com/inside-the-tape-homicide-and-crime-scene-management-training-online-classes-for-crime-scene-investigation/
http://remmont.com/get-cheap-car-insurance-in-california-with-titan-insurance-affordable-auto-insurance-california-2/
http://remmont.com/doctor-of-business-administration-online-dba-programsdoctor-of-business-administration/
http://remmont.com/con-way-careers-con-way-careers-con-way-careers/
http://remmont.com/top-home-builder-software-2017-reviews-pricing-demos-builder-scheduling-software/
http://remmont.com/auto-repair-loan-car-used/
http://remmont.com/us-1-auto-sales-used-cars-graniteville-sc-dealer-us-auto-sales-us-auto-sales/
http://remmont.com/banks-that-make-the-most-money-and-the-least-on-credit-card-loans-credit-report-gov/
http://remmont.com/cap-rates-commercial-real-estate-capitalization-rates-mortage-rates-interest-rates-market-data-discount-rates-and-news-for-appraisers-assessors-brokers-builders-developers-lenders-and-inv/
http://remmont.com/how-to-find-car-auctions-used-honda-accord/
http://remmont.com/auto-loan-canadian-auto-dealer-software/
http://remmont.com/how-much-car-insurance-do-you-need-personal-finance-auto-finance-companies-auto-finance-companies-2/
http://remmont.com/american-auto-ii-mays-landing-nj-auto-parts-repair-car-detailing-american-auto-parts-american-auto-parts/
http://remmont.com/life-insurance-rates-compare-life-insurance-quotes-cheap-life-insurance/

投稿: Amarillodege | 2019年9月16日 (月) 10時36分

コメントを書く



(ウェブ上には掲載しません)




トラックバック


この記事へのトラックバック一覧です: WebBrowserコントロールを制御する:

« Webページを丸ごとビットマップに | トップページ | WebBrowserコントロールのフォントサイズを変更する »