Announcement

Collapse

Forum Guidelines

This forum is for finished source code that is working properly. If you have questions about this or any other source code, please post it in one of the Discussion Forums, not here.
See more
See less

Web Browser

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Web Browser

    This samples demonstrates how to embed a web browser in a PowerBASIC application.

    Download files here.

    Files:
    Code:
    WebBrowser.bas
    WebBrowser.inc
    WebBrowser.bas:
    Code:
    '==============================================================================
    '
    '  WebBrowser.bas example for PowerBASIC Console Compiler
    '  Copyright (c) 2008-2011 PowerBASIC, Inc.
    '  All Rights Reserved.
    '
    '  A small example of opening Internet Explorer and navigating to a
    '  specific URL.
    '
    '==============================================================================
    
    #Compiler PBCC 6
    #Compile Exe
    #Dim All
    
    ' The WebBrowser.inc file contains the interface defintions for the
    ' Microsoft WebBrowser Object and was created with the PowerBASIC COM Browser
    #Include Once "WebBrowser.inc"
    
    Function PBMain () As Long
      Local ie  As IWebBrowser2     ' Microsoft WebBrowser Object
    
      ' Create an object reference to the IWebBrowser2 Interface that
      ' exposes the methods and properties of the MS WebBrowser Object
      ie = NewCom $PROGID_InternetExplorer
    
      ' Was the object refrence succesful?
      If IsFalse(IsObject(ie)) Then
        ' Could not create an object refrence, exit the application
        Print "Unable to create an object refrence to the IWebBrowser2 Interface."
        Print "Press any key to exit..."
        WaitKey$
        Exit Function
      End If
    
      ' Set the browser to a visible state
      ie.visible = 1
    
      ' Navigate to a URL
      ie.Navigate("http://www.powerbasic.com"$$)
    
      Print "Press any key to exit..."
      WaitKey$
    
      ' Close the browser and destroy the IWebBrowser2 object
      ie.Quit
      ie = Nothing
    
    End Function
    WebBrowser.inc:
    Code:
    ' Generated by: PowerBASIC COM Browser v.2.00.0086
    ' Date & Time : 03/08/11 at 9:38 AM
    ' Options:
    ' Always use an Interface Prefix : Off
    ' Interface Prefix               : MSIC
    ' Prefix ProgIDs, ClassIDs...    : Off
    ' Use ANSI Strings               : Off
    ' Use Singular Enumerations      : Off
    ' Generate Dispatch Interfaces   : Off
    ' Include Parameter Names        : On
    ' Use Property Get/Set statements: On
    ' ------------------------------------------------
    ' Library Name: SHDocVw
    ' Library File: C:\WINDOWS\system32\ieframe.dll
    ' Description : Microsoft Internet Controls
    ' GUID : {EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}
    ' LCID : 0
    ' Version : 1.1
    
    ' Version Dependent ProgIDs
    $PROGID_WebBrowser_V11 = "Shell.Explorer.1"
    $PROGID_WebBrowser2 = "Shell.Explorer.2"
    $PROGID_InternetExplorer1 = "InternetExplorer.Application.1"
    $PROGID_ShellUIHelper1 = "Shell.UIHelper.1"
    $PROGID_ShellNameSpace1 = "ShellNameSpace.ShellNameSpace.1"
    $PROGID_ShellShellNameSpace1 = "ShellNameSpace.ShellNameSpace.1"
    
    ' Version Independent ProgIDs
    $PROGID_WebBrowser_V1 = "Shell.Explorer"
    $PROGID_WebBrowser = "Shell.Explorer"
    $PROGID_InternetExplorer = "InternetExplorer.Application"
    $PROGID_ShellNameSpace = "ShellNameSpace.ShellNameSpace"
    $PROGID_ShellShellNameSpace = "ShellNameSpace.ShellNameSpace"
    
    ' Class Identifiers
    $CLSID_WebBrowser_V1 = Guid$("{EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B}")
    $CLSID_Event_DWebBrowserEvents2 = Guid$("{A6B379B1-B97C-4A39-9F58-962BC8ABFC38}")
    $CLSID_Event_DWebBrowserEvents = Guid$("{C7E0C74C-C397-4779-AAC3-888003B5BF81}")
    $CLSID_WebBrowser = Guid$("{8856F961-340A-11D0-A96B-00C04FD705A2}")
    $CLSID_InternetExplorer = Guid$("{0002DF01-0000-0000-C000-000000000046}")
    $CLSID_InternetExplorerMedium = Guid$("{D5E8041D-920F-45E9-B8FB-B1DEB82C6E5E}")
    $CLSID_ShellBrowserWindow = Guid$("{C08AFD90-F2A1-11D1-8455-00A0C91F3880}")
    $CLSID_ShellWindows = Guid$("{9BA05972-F6A8-11CF-A442-00A0C90A8F39}")
    $CLSID_Event_DShellWindowsEvents = Guid$("{33B1AC1C-83EF-4A8D-B364-A1BA37E684E9}")
    $CLSID_ShellUIHelper = Guid$("{64AB4BB7-111E-11D1-8F79-00C04FC2FBE1}")
    $CLSID_ShellNameSpace = Guid$("{55136805-B2DE-11D1-B9F2-00A0C98BC547}")
    $CLSID_Event_DShellNameSpaceEvents = Guid$("{D3158532-A601-4B5A-AE83-C5C3C7C21DE9}")
    $CLSID_ShellShellNameSpace = Guid$("{2F2F1F96-2BC1-4B1C-BE28-EA3774F4676A}")
    $CLSID_CScriptErrorList = Guid$("{EFD01300-160F-11D2-BB2E-00805FF7EFCA}")
    
    ' Interface Identifiers
    $IID_IWebBrowser = Guid$("{EAB22AC1-30C1-11CF-A7EB-0000C05BAE0B}")
    $IID_DWebBrowserEvents = Guid$("{EAB22AC2-30C1-11CF-A7EB-0000C05BAE0B}")
    $IID_IWebBrowserApp = Guid$("{0002DF05-0000-0000-C000-000000000046}")
    $IID_IWebBrowser2 = Guid$("{D30C1661-CDAF-11D0-8A3E-00C04FC9E26E}")
    $IID_DWebBrowserEvents2 = Guid$("{34A715A0-6587-11D0-924A-0020AFC7AC4D}")
    $IID_DShellWindowsEvents = Guid$("{FE4106E0-399A-11D0-A48C-00A0C90A8F39}")
    $IID_IShellWindows = Guid$("{85CB6900-4D95-11CF-960C-0080C7F4EE85}")
    $IID_IShellUIHelper = Guid$("{729FE2F8-1EA8-11D1-8F85-00C04FC2FBE1}")
    $IID_IShellUIHelper2 = Guid$("{A7FE6EDA-1932-4281-B881-87B31B8BC52C}")
    $IID_IShellUIHelper3 = Guid$("{528DF2EC-D419-40BC-9B6D-DCDBF9C1B25D}")
    $IID_DShellNameSpaceEvents = Guid$("{55136806-B2DE-11D1-B9F2-00A0C98BC547}")
    $IID_IShellFavoritesNameSpace = Guid$("{55136804-B2DE-11D1-B9F2-00A0C98BC547}")
    $IID_IShellNameSpace = Guid$("{E572D3C9-37BE-4AE2-825D-D521763E3108}")
    $IID_IScriptErrorList = Guid$("{F3470F24-15FD-11D2-BB2E-00805FF7EFCA}")
    
    Enum CommandStateChangeConstants
      CSC_UPDATECOMMANDS = -1
      CSC_NAVIGATEFORWARD = 1
      CSC_NAVIGATEBACK = 2
    End Enum
    
    Enum OLECMDID
      OLECMDID_OPEN = 1
      OLECMDID_NEW = 2
      OLECMDID_SAVE = 3
      OLECMDID_SAVEAS = 4
      OLECMDID_SAVECOPYAS = 5
      OLECMDID_PRINT = 6
      OLECMDID_PRINTPREVIEW = 7
      OLECMDID_PAGESETUP = 8
      OLECMDID_SPELL = 9
      OLECMDID_PROPERTIES = 10
      OLECMDID_CUT = 11
      OLECMDID_COPY = 12
      OLECMDID_PASTE = 13
      OLECMDID_PASTESPECIAL = 14
      OLECMDID_UNDO = 15
      OLECMDID_REDO = 16
      OLECMDID_SELECTALL = 17
      OLECMDID_CLEARSELECTION = 18
      OLECMDID_ZOOM = 19
      OLECMDID_GETZOOMRANGE = 20
      OLECMDID_UPDATECOMMANDS = 21
      OLECMDID_REFRESH = 22
      OLECMDID_STOP = 23
      OLECMDID_HIDETOOLBARS = 24
      OLECMDID_SETPROGRESSMAX = 25
      OLECMDID_SETPROGRESSPOS = 26
      OLECMDID_SETPROGRESSTEXT = 27
      OLECMDID_SETTITLE = 28
      OLECMDID_SETDOWNLOADSTATE = 29
      OLECMDID_STOPDOWNLOAD = 30
      OLECMDID_ONTOOLBARACTIVATED = 31
      OLECMDID_FIND = 32
      OLECMDID_DELETE = 33
      OLECMDID_HTTPEQUIV = 34
      OLECMDID_HTTPEQUIV_DONE = 35
      OLECMDID_ENABLE_INTERACTION = 36
      OLECMDID_ONUNLOAD = 37
      OLECMDID_PROPERTYBAG2 = 38
      OLECMDID_PREREFRESH = 39
      OLECMDID_SHOWSCRIPTERROR = 40
      OLECMDID_SHOWMESSAGE = 41
      OLECMDID_SHOWFIND = 42
      OLECMDID_SHOWPAGESETUP = 43
      OLECMDID_SHOWPRINT = 44
      OLECMDID_CLOSE = 45
      OLECMDID_ALLOWUILESSSAVEAS = 46
      OLECMDID_DONTDOWNLOADCSS = 47
      OLECMDID_UPDATEPAGESTATUS = 48
      OLECMDID_PRINT2 = 49
      OLECMDID_PRINTPREVIEW2 = 50
      OLECMDID_SETPRINTTEMPLATE = 51
      OLECMDID_GETPRINTTEMPLATE = 52
      OLECMDID_PAGEACTIONBLOCKED = 55
      OLECMDID_PAGEACTIONUIQUERY = 56
      OLECMDID_FOCUSVIEWCONTROLS = 57
      OLECMDID_FOCUSVIEWCONTROLSQUERY = 58
      OLECMDID_SHOWPAGEACTIONMENU = 59
      OLECMDID_ADDTRAVELENTRY = 60
      OLECMDID_UPDATETRAVELENTRY = 61
      OLECMDID_UPDATEBACKFORWARDSTATE = 62
      OLECMDID_OPTICAL_ZOOM = 63
      OLECMDID_OPTICAL_GETZOOMRANGE = 64
      OLECMDID_WINDOWSTATECHANGED = 65
      OLECMDID_ACTIVEXINSTALLSCOPE = 66
      OLECMDID_UPDATETRAVELENTRY_DATARECOVERY = 67
    End Enum
    
    Enum OLECMDF
      OLECMDF_SUPPORTED = 1
      OLECMDF_ENABLED = 2
      OLECMDF_LATCHED = 4
      OLECMDF_NINCHED = 8
      OLECMDF_INVISIBLE = 16
      OLECMDF_DEFHIDEONCTXTMENU = 32
    End Enum
    
    Enum OLECMDEXECOPT
      OLECMDEXECOPT_DODEFAULT = 0
      OLECMDEXECOPT_PROMPTUSER = 1
      OLECMDEXECOPT_DONTPROMPTUSER = 2
      OLECMDEXECOPT_SHOWHELP = 3
    End Enum
    
    Enum tagREADYSTATE
      READYSTATE_UNINITIALIZED = 0
      READYSTATE_LOADING = 1
      READYSTATE_LOADED = 2
      READYSTATE_INTERACTIVE = 3
      READYSTATE_COMPLETE = 4
    End Enum
    
    Enum SecureLockIconConstants
      secureLockIconUnsecure = 0
      secureLockIconMixed = 1
      secureLockIconSecureUnknownBits = 2
      secureLockIconSecure40Bit = 3
      secureLockIconSecure56Bit = 4
      secureLockIconSecureFortezza = 5
      secureLockIconSecure128Bit = 6
    End Enum
    
    Enum NewProcessCauseConstants
      ProtectedModeRedirect = 1
    End Enum
    
    Enum ShellWindowTypeConstants
      SWC_EXPLORER = 0
      SWC_BROWSER = 1
      SWC_3RDPARTY = 2
      SWC_CALLBACK = 4
      SWC_DESKTOP = 8
    End Enum
    
    Enum ShellWindowFindWindowOptions
      SWFO_NEEDDISPATCH = 1
      SWFO_INCLUDEPENDING = 2
      SWFO_COOKIEPASSED = 4
    End Enum
    
    
    ' Interface Name  : IWebBrowser
    ' Description     : Web Browser interface
    ' Class Name      : WebBrowser
    ' ClassID         : $CLSID_WebBrowser
    ' ProgID          : $PROGID_WebBrowser
    ' Version ProgID  : $PROGID_WebBrowser2
    Interface IWebBrowser $IID_IWebBrowser
      Inherit IDispatch
    
      Method GoBack <100> ()
      Method GoForward <101> ()
      Method GoHome <102> ()
      Method GoSearch <103> ()
      Method Navigate <104> (ByVal URL As WString, Opt ByRef In Flags As Variant, Opt ByRef In TargetFrameName As Variant, Opt _
        ByRef In PostData As Variant, Opt ByRef In Headers As Variant)
      Method Refresh <-550> ()
      Method Refresh2 <105> (Opt ByRef In Level As Variant)
      Method Stop <106> ()
      Property Get Application <200> () As IDispatch
      Property Get Parent <201> () As IDispatch
      Property Get Container <202> () As IDispatch
      Property Get Document <203> () As IDispatch
      Property Get TopLevelContainer <204> () As Integer
      Property Get Type <205> () As WString
      Property Get Left <206> () As Long
      Property Set Left <206> (ByVal pl As Long)
      Property Get Top <207> () As Long
      Property Set Top <207> (ByVal pl As Long)
      Property Get Width <208> () As Long
      Property Set Width <208> (ByVal pl As Long)
      Property Get Height <209> () As Long
      Property Set Height <209> (ByVal pl As Long)
      Property Get LocationName <210> () As WString
      Property Get LocationURL <211> () As WString
      Property Get Busy <212> () As Integer
    End Interface
    
    ' Interface Name  : DWebBrowserEvents
    ' Description     : Web Browser Control Events (old)
    ' ClassID         : $CLSID_Event_DWebBrowserEvents
    ' ProgID          : $PROGID_InternetExplorer
    ' Version ProgID  : $PROGID_InternetExplorer1
    ' This Interface cannot be created directly it can only
    ' be returned by a Method or Property in this library.
    Class Class_DWebBrowserEvents $CLSID_Event_DWebBrowserEvents As Event
      Interface DWebBrowserEvents $IID_DWebBrowserEvents
        Inherit IDispatch
    
        Method BeforeNavigate <100> (ByVal URL As WString, ByVal Flags As Long, ByVal TargetFrameName As WString, ByRef PostData _
        As Variant, ByVal Headers As WString, ByRef InOut Cancel As Integer)
          ' Insert your code here
        End Method
    
        Method NavigateComplete <101> (ByVal URL As WString)
          ' Insert your code here
        End Method
    
        Method StatusTextChange <102> (ByVal Text As WString)
          ' Insert your code here
        End Method
    
        Method ProgressChange <108> (ByVal Progress As Long, ByVal ProgressMax As Long)
          ' Insert your code here
        End Method
    
        Method DownloadComplete <104> ()
          ' Insert your code here
        End Method
    
        Method CommandStateChange <105> (ByVal Command As Long, ByVal PB_Enable As Integer)
          ' Insert your code here
        End Method
    
        Method DownloadBegin <106> ()
          ' Insert your code here
        End Method
    
        Method NewWindow <107> (ByVal URL As WString, ByVal Flags As Long, ByVal TargetFrameName As WString, ByRef In PostData _
        As Variant, ByVal Headers As WString, ByRef InOut Processed As Integer)
          ' Insert your code here
        End Method
    
        Method TitleChange <113> (ByVal Text As WString)
          ' Insert your code here
        End Method
    
        Method FrameBeforeNavigate <200> (ByVal URL As WString, ByVal Flags As Long, ByVal TargetFrameName As WString, ByRef _
        PostData As Variant, ByVal Headers As WString, ByRef InOut Cancel As Integer)
          ' Insert your code here
        End Method
    
        Method FrameNavigateComplete <201> (ByVal URL As WString)
          ' Insert your code here
        End Method
    
        Method FrameNewWindow <204> (ByVal URL As WString, ByVal Flags As Long, ByVal TargetFrameName As WString, ByRef In _
        PostData As Variant, ByVal Headers As WString, ByRef InOut Processed As Integer)
          ' Insert your code here
        End Method
    
        Method Quit <103> (ByRef InOut Cancel As Integer)
          ' Insert your code here
        End Method
    
        Method WindowMove <109> ()
          ' Insert your code here
        End Method
    
        Method WindowResize <110> ()
          ' Insert your code here
        End Method
    
        Method WindowActivate <111> ()
          ' Insert your code here
        End Method
    
        Method PropertyChange <112> (ByVal PB_Property As WString)
          ' Insert your code here
        End Method
    
      End Interface
    End Class
    
    ' Interface Name  : IWebBrowserApp
    ' Description     : Web Browser Application Interface.
    ' Class Name      : ShellBrowserWindow
    ' ClassID         : $CLSID_ShellBrowserWindow
    ' ProgID          : $PROGID_InternetExplorer
    ' Version ProgID  : $PROGID_InternetExplorer1
    ' This Interface cannot be created directly it can only
    ' be returned by a Method or Property in this library.
    Interface IWebBrowserApp $IID_IWebBrowserApp
      Inherit IDispatch
    
      Method GoBack <100> ()
      Method GoForward <101> ()
      Method GoHome <102> ()
      Method GoSearch <103> ()
      Method Navigate <104> (ByVal URL As WString, Opt ByRef In Flags As Variant, Opt ByRef In TargetFrameName As Variant, Opt _
        ByRef In PostData As Variant, Opt ByRef In Headers As Variant)
      Method Refresh <-550> ()
      Method Refresh2 <105> (Opt ByRef In Level As Variant)
      Method Stop <106> ()
      Property Get Application <200> () As IDispatch
      Property Get Parent <201> () As IDispatch
      Property Get Container <202> () As IDispatch
      Property Get Document <203> () As IDispatch
      Property Get TopLevelContainer <204> () As Integer
      Property Get Type <205> () As WString
      Property Get Left <206> () As Long
      Property Set Left <206> (ByVal Rhs As Long)
      Property Get Top <207> () As Long
      Property Set Top <207> (ByVal Rhs As Long)
      Property Get Width <208> () As Long
      Property Set Width <208> (ByVal Rhs As Long)
      Property Get Height <209> () As Long
      Property Set Height <209> (ByVal Rhs As Long)
      Property Get LocationName <210> () As WString
      Property Get LocationURL <211> () As WString
      Property Get Busy <212> () As Integer
      Method Quit <300> ()
      Method ClientToWindow <301> (ByRef InOut pcx As Long, ByRef InOut pcy As Long)
      Method PutProperty <302> (ByVal PB_Property As WString, ByVal vtValue As Variant)
      Method GetProperty <303> (ByVal PB_Property As WString) As Variant
      Property Get Name <0> () As WString
      Property Get HWND <-515> () As Long
      Property Get FullName <400> () As WString
      Property Get Path <401> () As WString
      Property Get Visible <402> () As Integer
      Property Set Visible <402> (ByVal Rhs As Integer)
      Property Get Statusbar <403> () As Integer
      Property Set Statusbar <403> (ByVal pBool As Integer)
      Property Get StatusText <404> () As WString
      Property Set StatusText <404> (ByVal StatusText As WString)
      Property Get Toolbar <405> () As Long
      Property Set Toolbar <405> (ByVal Value As Long)
      Property Get MenuBar <406> () As Integer
      Property Set MenuBar <406> (ByVal Value As Integer)
      Property Get FullScreen <407> () As Integer
      Property Set FullScreen <407> (ByVal pbFullScreen As Integer)
    End Interface
    
    ' Interface Name  : IWebBrowser2
    ' Description     : Web Browser Interface for IE4.
    ' Class Name      : ShellBrowserWindow
    ' ClassID         : $CLSID_ShellBrowserWindow
    ' ProgID          : $PROGID_InternetExplorer
    ' Version ProgID  : $PROGID_InternetExplorer1
    ' This Interface cannot be created directly it can only
    ' be returned by a Method or Property in this library.
    Interface IWebBrowser2 $IID_IWebBrowser2
      Inherit IDispatch
    
      Method GoBack <100> ()
      Method GoForward <101> ()
      Method GoHome <102> ()
      Method GoSearch <103> ()
      Method Navigate <104> (ByVal URL As WString, Opt ByRef In Flags As Variant, Opt ByRef In TargetFrameName As Variant, Opt _
        ByRef In PostData As Variant, Opt ByRef In Headers As Variant)
      Method Refresh <-550> ()
      Method Refresh2 <105> (Opt ByRef In Level As Variant)
      Method Stop <106> ()
      Property Get Application <200> () As IDispatch
      Property Get Parent <201> () As IDispatch
      Property Get Container <202> () As IDispatch
      Property Get Document <203> () As IDispatch
      Property Get TopLevelContainer <204> () As Integer
      Property Get Type <205> () As WString
      Property Get Left <206> () As Long
      Property Set Left <206> (ByVal Rhs As Long)
      Property Get Top <207> () As Long
      Property Set Top <207> (ByVal Rhs As Long)
      Property Get Width <208> () As Long
      Property Set Width <208> (ByVal Rhs As Long)
      Property Get Height <209> () As Long
      Property Set Height <209> (ByVal Rhs As Long)
      Property Get LocationName <210> () As WString
      Property Get LocationURL <211> () As WString
      Property Get Busy <212> () As Integer
      Method Quit <300> ()
      Method ClientToWindow <301> (ByRef InOut pcx As Long, ByRef InOut pcy As Long)
      Method PutProperty <302> (ByVal PB_Property As WString, ByVal vtValue As Variant)
      Method GetProperty <303> (ByVal PB_Property As WString) As Variant
      Property Get Name <0> () As WString
      Property Get HWND <-515> () As Long
      Property Get FullName <400> () As WString
      Property Get Path <401> () As WString
      Property Get Visible <402> () As Integer
      Property Set Visible <402> (ByVal Rhs As Integer)
      Property Get Statusbar <403> () As Integer
      Property Set Statusbar <403> (ByVal Rhs As Integer)
      Property Get StatusText <404> () As WString
      Property Set StatusText <404> (ByVal Rhs As WString)
      Property Get Toolbar <405> () As Long
      Property Set Toolbar <405> (ByVal Rhs As Long)
      Property Get MenuBar <406> () As Integer
      Property Set MenuBar <406> (ByVal Rhs As Integer)
      Property Get FullScreen <407> () As Integer
      Property Set FullScreen <407> (ByVal Rhs As Integer)
      Method Navigate2 <500> (ByRef In URL As Variant, Opt ByRef In Flags As Variant, Opt ByRef In TargetFrameName As Variant, _
        Opt ByRef In PostData As Variant, Opt ByRef In Headers As Variant)
      Method QueryStatusWB <501> (ByVal cmdID As Long) As Long
      Method ExecWB <502> (ByVal cmdID As Long, ByVal cmdexecopt As Long, Opt ByRef In pvaIn As Variant, Opt ByRef InOut _
        pvaOut As Variant)
      Method ShowBrowserBar <503> (ByRef In pvaClsid As Variant, Opt ByRef In pvarShow As Variant, Opt ByRef In pvarSize As _
        Variant)
      Property Get ReadyState <-525> () As Long
      Property Get Offline <550> () As Integer
      Property Set Offline <550> (ByVal Rhs As Integer)
      Property Get Silent <551> () As Integer
      Property Set Silent <551> (ByVal pbSilent As Integer)
      Property Get RegisterAsBrowser <552> () As Integer
      Property Set RegisterAsBrowser <552> (ByVal Rhs As Integer)
      Property Get RegisterAsDropTarget <553> () As Integer
      Property Set RegisterAsDropTarget <553> (ByVal pbRegister As Integer)
      Property Get TheaterMode <554> () As Integer
      Property Set TheaterMode <554> (ByVal Rhs As Integer)
      Property Get AddressBar <555> () As Integer
      Property Set AddressBar <555> (ByVal Rhs As Integer)
      Property Get Resizable <556> () As Integer
      Property Set Resizable <556> (ByVal Value As Integer)
    End Interface
    
    ' Interface Name  : DWebBrowserEvents2
    ' Description     : Web Browser Control events interface
    ' ClassID         : $CLSID_Event_DWebBrowserEvents2
    ' ProgID          : $PROGID_InternetExplorer
    ' Version ProgID  : $PROGID_InternetExplorer1
    ' This Interface cannot be created directly it can only
    ' be returned by a Method or Property in this library.
    Class Class_DWebBrowserEvents2 $CLSID_Event_DWebBrowserEvents2 As Event
      Interface DWebBrowserEvents2 $IID_DWebBrowserEvents2
        Inherit IDispatch
    
        Method StatusTextChange <102> (ByVal Text As WString)
          ' Insert your code here
        End Method
    
        Method ProgressChange <108> (ByVal Progress As Long, ByVal ProgressMax As Long)
          ' Insert your code here
        End Method
    
        Method CommandStateChange <105> (ByVal Command As Long, ByVal PB_Enable As Integer)
          ' Insert your code here
        End Method
    
        Method DownloadBegin <106> ()
          ' Insert your code here
        End Method
    
        Method DownloadComplete <104> ()
          ' Insert your code here
        End Method
    
        Method TitleChange <113> (ByVal Text As WString)
          ' Insert your code here
        End Method
    
        Method PropertyChange <112> (ByVal szProperty As WString)
          ' Insert your code here
        End Method
    
        Method BeforeNavigate2 <250> (ByVal pDisp As IDispatch, ByRef In URL As Variant, ByRef In Flags As Variant, ByRef In _
        TargetFrameName As Variant, ByRef In PostData As Variant, ByRef In Headers As Variant, ByRef InOut Cancel As Integer)
          ' Insert your code here
        End Method
    
        Method NewWindow2 <251> (ByRef InOut ppDisp As IDispatch, ByRef InOut Cancel As Integer)
          ' Insert your code here
        End Method
    
        Method NavigateComplete2 <252> (ByVal pDisp As IDispatch, ByRef In URL As Variant)
          ' Insert your code here
        End Method
    
        Method DocumentComplete <259> (ByVal pDisp As IDispatch, ByRef In URL As Variant)
          ' Insert your code here
        End Method
    
        Method OnQuit <253> ()
          ' Insert your code here
        End Method
    
        Method OnVisible <254> (ByVal PB_Visible As Integer)
          ' Insert your code here
        End Method
    
        Method OnToolBar <255> (ByVal PB_ToolBar As Integer)
          ' Insert your code here
        End Method
    
        Method OnMenuBar <256> (ByVal MenuBar As Integer)
          ' Insert your code here
        End Method
    
        Method OnStatusBar <257> (ByVal PB_StatusBar As Integer)
          ' Insert your code here
        End Method
    
        Method OnFullScreen <258> (ByVal FullScreen As Integer)
          ' Insert your code here
        End Method
    
        Method OnTheaterMode <260> (ByVal TheaterMode As Integer)
          ' Insert your code here
        End Method
    
        Method WindowSetResizable <262> (ByVal Resizable As Integer)
          ' Insert your code here
        End Method
    
        Method WindowSetLeft <264> (ByVal PB_Left As Long)
          ' Insert your code here
        End Method
    
        Method WindowSetTop <265> (ByVal Top As Long)
          ' Insert your code here
        End Method
    
        Method WindowSetWidth <266> (ByVal PB_Width As Long)
          ' Insert your code here
        End Method
    
        Method WindowSetHeight <267> (ByVal Height As Long)
          ' Insert your code here
        End Method
    
        Method WindowClosing <263> (ByVal IsChildWindow As Integer, ByRef InOut Cancel As Integer)
          ' Insert your code here
        End Method
    
        Method ClientToHostWindow <268> (ByRef InOut CX As Long, ByRef InOut CY As Long)
          ' Insert your code here
        End Method
    
        Method SetSecureLockIcon <269> (ByVal SecureLockIcon As Long)
          ' Insert your code here
        End Method
    
        Method FileDownload <270> (ByVal ActiveDocument As Integer, ByRef InOut Cancel As Integer)
          ' Insert your code here
        End Method
    
        Method NavigateError <271> (ByVal pDisp As IDispatch, ByRef In URL As Variant, ByRef In Frame As Variant, ByRef In _
        StatusCode As Variant, ByRef InOut Cancel As Integer)
          ' Insert your code here
        End Method
    
        Method PrintTemplateInstantiation <225> (ByVal pDisp As IDispatch)
          ' Insert your code here
        End Method
    
        Method PrintTemplateTeardown <226> (ByVal pDisp As IDispatch)
          ' Insert your code here
        End Method
    
        Method UpdatePageStatus <227> (ByVal pDisp As IDispatch, ByRef In nPage As Variant, ByRef In fDone As Variant)
          ' Insert your code here
        End Method
    
        Method PrivacyImpactedStateChange <272> (ByVal bImpacted As Integer)
          ' Insert your code here
        End Method
    
        Method NewWindow3 <273> (ByRef InOut ppDisp As IDispatch, ByRef InOut Cancel As Integer, ByVal dwFlags As Dword, ByVal _
        bstrUrlContext As WString, ByVal bstrUrl As WString)
          ' Insert your code here
        End Method
    
        Method SetPhishingFilterStatus <282> (ByVal PhishingFilterStatus As Long)
          ' Insert your code here
        End Method
    
        Method WindowStateChanged <283> (ByVal dwWindowStateFlags As Dword, ByVal dwValidFlagsMask As Dword)
          ' Insert your code here
        End Method
    
        Method NewProcess <284> (ByVal lCauseFlag As Long, ByVal pWB2 As IDispatch, ByRef InOut Cancel As Integer)
          ' Insert your code here
        End Method
    
        Method ThirdPartyUrlBlocked <285> (ByRef In URL As Variant, ByVal dwCount As Dword)
          ' Insert your code here
        End Method
    
        Method RedirectXDomainBlocked <286> (ByVal pDisp As IDispatch, ByRef In StartURL As Variant, ByRef In RedirectURL As _
        Variant, ByRef In Frame As Variant, ByRef In StatusCode As Variant)
          ' Insert your code here
        End Method
    
      End Interface
    End Class
    
    ' Interface Name  : DShellWindowsEvents
    ' Description     : Event interface for IShellWindows
    ' ClassID         : $CLSID_Event_DShellWindowsEvents
    Class Class_DShellWindowsEvents $CLSID_Event_DShellWindowsEvents As Event
      Interface DShellWindowsEvents $IID_DShellWindowsEvents
        Inherit IDispatch
    
        Method WindowRegistered <200> (ByVal lCookie As Long)
          ' Insert your code here
        End Method
    
        Method WindowRevoked <201> (ByVal lCookie As Long)
          ' Insert your code here
        End Method
    
      End Interface
    End Class
    
    ' Interface Name  : IShellWindows
    ' Description     : Definition of interface IShellWindows
    ' Class Name      : ShellWindows
    ' ClassID         : $CLSID_ShellWindows
    Interface IShellWindows $IID_IShellWindows
      Inherit IDispatch
    
      Property Get Count <1610743808> () As Long
      Method Item <0> (Opt ByVal index As Variant) As IDispatch
      Method Meth__NewEnum <-4> () As IUnknown
      Method Register <1610743811> (ByVal pid As IDispatch, ByVal HWND As Long, ByVal swClass As Long, ByRef plCookie As Long)
      Method RegisterPending <1610743812> (ByVal lThreadId As Long, ByRef In pvarloc As Variant, ByRef In pvarlocRoot As _
        Variant, ByVal swClass As Long, ByRef plCookie As Long)
      Method Revoke <1610743813> (ByVal lCookie As Long)
      Method OnNavigate <1610743814> (ByVal lCookie As Long, ByRef In pvarloc As Variant)
      Method OnActivated <1610743815> (ByVal lCookie As Long, ByVal fActive As Integer)
      Method FindWindowSW <1610743816> (ByRef In pvarloc As Variant, ByRef In pvarlocRoot As Variant, ByVal swClass As Long, _
        ByRef pHWND As Long, ByVal swfwOptions As Long) As IDispatch
      Method OnCreated <1610743817> (ByVal lCookie As Long, ByVal punk As IUnknown)
      Method ProcessAttachDetach <1610743818> (ByVal fAttach As Integer)
    End Interface
    
    ' Interface Name  : IShellUIHelper
    ' Description     : Shell UI Helper Control Interface
    ' This Interface cannot be created directly it can only
    ' be returned by a Method or Property in this library.
    Interface IShellUIHelper $IID_IShellUIHelper
      Inherit IDispatch
    
      Method ResetFirstBootMode <1> ()
      Method ResetSafeMode <2> ()
      Method RefreshOfflineDesktop <3> ()
      Method AddFavorite <4> (ByVal URL As WString, Opt ByRef In Title As Variant)
      Method AddChannel <5> (ByVal URL As WString)
      Method AddDesktopComponent <6> (ByVal URL As WString, ByVal PB_Type As WString, Opt ByRef In PB_Left As Variant, Opt _
        ByRef In Top As Variant, Opt ByRef In PB_Width As Variant, Opt ByRef In Height As Variant)
      Method IsSubscribed <7> (ByVal URL As WString) As Integer
      Method NavigateAndFind <8> (ByVal URL As WString, ByVal strQuery As WString, ByRef In varTargetFrame As Variant)
      Method ImportExportFavorites <9> (ByVal fImport As Integer, ByVal strImpExpPath As WString)
      Method AutoCompleteSaveForm <10> (Opt ByRef In Form As Variant)
      Method AutoScan <11> (ByVal strSearch As WString, ByVal strFailureUrl As WString, Opt ByRef In pvarTargetFrame As _
        Variant)
      Method AutoCompleteAttach <12> (Opt ByRef In Reserved As Variant)
      Method ShowBrowserUI <13> (ByVal bstrName As WString, ByRef In pvarIn As Variant) As Variant
    End Interface
    
    ' Interface Name  : IShellUIHelper2
    ' Description     : Shell UI Helper Control Interface 2
    ' This Interface cannot be created directly it can only
    ' be returned by a Method or Property in this library.
    Interface IShellUIHelper2 $IID_IShellUIHelper2
      Inherit IDispatch
    
      Method ResetFirstBootMode <1> ()
      Method ResetSafeMode <2> ()
      Method RefreshOfflineDesktop <3> ()
      Method AddFavorite <4> (ByVal URL As WString, Opt ByRef In Title As Variant)
      Method AddChannel <5> (ByVal URL As WString)
      Method AddDesktopComponent <6> (ByVal URL As WString, ByVal PB_Type As WString, Opt ByRef In PB_Left As Variant, Opt _
        ByRef In Top As Variant, Opt ByRef In PB_Width As Variant, Opt ByRef In Height As Variant)
      Method IsSubscribed <7> (ByVal URL As WString) As Integer
      Method NavigateAndFind <8> (ByVal URL As WString, ByVal strQuery As WString, ByRef In varTargetFrame As Variant)
      Method ImportExportFavorites <9> (ByVal fImport As Integer, ByVal strImpExpPath As WString)
      Method AutoCompleteSaveForm <10> (Opt ByRef In Form As Variant)
      Method AutoScan <11> (ByVal strSearch As WString, ByVal strFailureUrl As WString, Opt ByRef In pvarTargetFrame As _
        Variant)
      Method AutoCompleteAttach <12> (Opt ByRef In Reserved As Variant)
      Method ShowBrowserUI <13> (ByVal bstrName As WString, ByRef In pvarIn As Variant) As Variant
      Method AddSearchProvider <14> (ByVal URL As WString)
      Method RunOnceShown <15> ()
      Method SkipRunOnce <16> ()
      Method CustomizeSettings <17> (ByVal fSQM As Integer, ByVal fPhishing As Integer, ByVal bstrLocale As WString)
      Method SqmEnabled <18> () As Integer
      Method PhishingEnabled <19> () As Integer
      Method BrandImageUri <20> () As WString
      Method SkipTabsWelcome <21> ()
      Method DiagnoseConnection <22> ()
      Method CustomizeClearType <23> (ByVal fSet As Integer)
      Method IsSearchProviderInstalled <24> (ByVal URL As WString) As Dword
      Method IsSearchMigrated <25> () As Integer
      Method DefaultSearchProvider <26> () As WString
      Method RunOnceRequiredSettingsComplete <27> (ByVal fComplete As Integer)
      Method RunOnceHasShown <28> () As Integer
      Method SearchGuideUrl <29> () As WString
    End Interface
    
    ' Interface Name  : IShellUIHelper3
    ' Description     : Shell UI Helper Control Interface 3
    ' Class Name      : ShellUIHelper
    ' ClassID         : $CLSID_ShellUIHelper
    ' Version ProgID  : $PROGID_ShellUIHelper1
    Interface IShellUIHelper3 $IID_IShellUIHelper3
      Inherit IDispatch
    
      Method ResetFirstBootMode <1> ()
      Method ResetSafeMode <2> ()
      Method RefreshOfflineDesktop <3> ()
      Method AddFavorite <4> (ByVal URL As WString, Opt ByRef In Title As Variant)
      Method AddChannel <5> (ByVal URL As WString)
      Method AddDesktopComponent <6> (ByVal URL As WString, ByVal PB_Type As WString, Opt ByRef In PB_Left As Variant, Opt _
        ByRef In Top As Variant, Opt ByRef In PB_Width As Variant, Opt ByRef In Height As Variant)
      Method IsSubscribed <7> (ByVal URL As WString) As Integer
      Method NavigateAndFind <8> (ByVal URL As WString, ByVal strQuery As WString, ByRef In varTargetFrame As Variant)
      Method ImportExportFavorites <9> (ByVal fImport As Integer, ByVal strImpExpPath As WString)
      Method AutoCompleteSaveForm <10> (Opt ByRef In Form As Variant)
      Method AutoScan <11> (ByVal strSearch As WString, ByVal strFailureUrl As WString, Opt ByRef In pvarTargetFrame As _
        Variant)
      Method AutoCompleteAttach <12> (Opt ByRef In Reserved As Variant)
      Method ShowBrowserUI <13> (ByVal bstrName As WString, ByRef In pvarIn As Variant) As Variant
      Method AddSearchProvider <14> (ByVal URL As WString)
      Method RunOnceShown <15> ()
      Method SkipRunOnce <16> ()
      Method CustomizeSettings <17> (ByVal fSQM As Integer, ByVal fPhishing As Integer, ByVal bstrLocale As WString)
      Method SqmEnabled <18> () As Integer
      Method PhishingEnabled <19> () As Integer
      Method BrandImageUri <20> () As WString
      Method SkipTabsWelcome <21> ()
      Method DiagnoseConnection <22> ()
      Method CustomizeClearType <23> (ByVal fSet As Integer)
      Method IsSearchProviderInstalled <24> (ByVal URL As WString) As Dword
      Method IsSearchMigrated <25> () As Integer
      Method DefaultSearchProvider <26> () As WString
      Method RunOnceRequiredSettingsComplete <27> (ByVal fComplete As Integer)
      Method RunOnceHasShown <28> () As Integer
      Method SearchGuideUrl <29> () As WString
      Method AddService <30> (ByVal URL As WString)
      Method IsServiceInstalled <31> (ByVal URL As WString, ByVal Verb As WString) As Dword
      Method InPrivateFilteringEnabled <37> () As Integer
      Method AddToFavoritesBar <32> (ByVal URL As WString, ByVal Title As WString, Opt ByRef In PB_Type As Variant)
      Method BuildNewTabPage <33> ()
      Method SetRecentlyClosedVisible <34> (ByVal fVisible As Integer)
      Method SetActivitiesVisible <35> (ByVal fVisible As Integer)
      Method ContentDiscoveryReset <36> ()
      Method IsSuggestedSitesEnabled <38> () As Integer
      Method EnableSuggestedSites <39> (ByVal fEnable As Integer)
      Method NavigateToSuggestedSites <40> (ByVal bstrRelativeUrl As WString)
      Method ShowTabsHelp <41> ()
      Method ShowInPrivateHelp <42> ()
    End Interface
    
    ' Interface Name  : DShellNameSpaceEvents
    ' ClassID         : $CLSID_Event_DShellNameSpaceEvents
    ' ProgID          : $PROGID_ShellShellNameSpace
    ' Version ProgID  : $PROGID_ShellShellNameSpace1
    Class Class_DShellNameSpaceEvents $CLSID_Event_DShellNameSpaceEvents As Event
      Interface DShellNameSpaceEvents $IID_DShellNameSpaceEvents
        Inherit IDispatch
    
        Method FavoritesSelectionChange <1> (ByVal cItems As Long, ByVal hItem As Long, ByVal strName As WString, ByVal strUrl _
        As WString, ByVal cVisits As Long, ByVal strDate As WString, ByVal fAvailableOffline As Long)
          ' Insert your code here
        End Method
    
        Method SelectionChange <2> ()
          ' Insert your code here
        End Method
    
        Method DoubleClick <3> ()
          ' Insert your code here
        End Method
    
        Method Initialized <4> ()
          ' Insert your code here
        End Method
    
      End Interface
    End Class
    
    ' Interface Name  : IShellFavoritesNameSpace
    ' Description     : IShellFavoritesNameSpace Interface
    ' This Interface cannot be created directly it can only
    ' be returned by a Method or Property in this library.
    Interface IShellFavoritesNameSpace $IID_IShellFavoritesNameSpace
      Inherit IDispatch
    
      Method MoveSelectionUp <1> ()
      Method MoveSelectionDown <2> ()
      Method ResetSort <3> ()
      Method NewFolder <4> ()
      Method Synchronize <5> ()
      Method Import <6> ()
      Method Export <7> ()
      Method InvokeContextMenuCommand <8> (ByVal strCommand As WString)
      Method MoveSelectionTo <9> ()
      Property Get SubscriptionsEnabled <10> () As Integer
      Method CreateSubscriptionForSelection <11> () As Integer
      Method DeleteSubscriptionForSelection <12> () As Integer
      Method SetRoot <13> (ByVal bstrFullPath As WString)
    End Interface
    
    ' Interface Name  : IShellNameSpace
    ' Description     : IShellNameSpace Interface
    ' Class Name      : ShellShellNameSpace
    ' ClassID         : $CLSID_ShellShellNameSpace
    ' ProgID          : $PROGID_ShellShellNameSpace
    ' Version ProgID  : $PROGID_ShellShellNameSpace1
    Interface IShellNameSpace $IID_IShellNameSpace
      Inherit IDispatch
    
      Method MoveSelectionUp <1> ()
      Method MoveSelectionDown <2> ()
      Method ResetSort <3> ()
      Method NewFolder <4> ()
      Method Synchronize <5> ()
      Method Import <6> ()
      Method Export <7> ()
      Method InvokeContextMenuCommand <8> (ByVal strCommand As WString)
      Method MoveSelectionTo <9> ()
      Property Get SubscriptionsEnabled <10> () As Integer
      Method CreateSubscriptionForSelection <11> () As Integer
      Method DeleteSubscriptionForSelection <12> () As Integer
      Method SetRoot <13> (ByVal bstrFullPath As WString)
      Property Get EnumOptions <14> () As Long
      Property Set EnumOptions <14> (ByVal Rhs As Long)
      Property Get SelectedItem <15> () As IDispatch
      Property Set SelectedItem <15> (ByVal pItem As IDispatch)
      Property Get Root <16> () As Variant
      Property Set Root <16> (ByVal Rhs As Variant)
      Property Get Depth <17> () As Long
      Property Set Depth <17> (ByVal piDepth As Long)
      Property Get Mode <18> () As Dword
      Property Set Mode <18> (ByVal Rhs As Dword)
      Property Get Flags <19> () As Dword
      Property Set Flags <19> (ByVal Rhs As Dword)
      Property Set TVFlags <20> (ByVal dwFlags As Dword)
      Property Get TVFlags <20> () As Dword
      Property Get Columns <21> () As WString
      Property Set Columns <21> (ByVal Rhs As WString)
      Property Get CountViewTypes <22> () As Long
      Method SetViewType <23> (ByVal iType As Long)
      Method SelectedItems <24> () As IDispatch
      Method Expand <25> (ByVal var As Variant, ByVal iDepth As Long)
      Method UnselectAll <26> ()
    End Interface
    
    ' Interface Name  : IScriptErrorList
    ' Description     : Script Error List Interface
    ' Class Name      : CScriptErrorList
    ' ClassID         : $CLSID_CScriptErrorList
    ' This Interface cannot be created directly it can only
    ' be returned by a Method or Property in this library.
    Interface IScriptErrorList $IID_IScriptErrorList
      Inherit IDispatch
    
      Method advanceError <10> ()
      Method retreatError <11> ()
      Method canAdvanceError <12> () As Long
      Method canRetreatError <13> () As Long
      Method getErrorLine <14> () As Long
      Method getErrorChar <15> () As Long
      Method getErrorCode <16> () As Long
      Method getErrorMsg <17> () As WString
      Method getErrorUrl <18> () As WString
      Method getAlwaysShowLockState <23> () As Long
      Method getDetailsPaneOpen <19> () As Long
      Method setDetailsPaneOpen <20> (ByVal fDetailsPaneOpen As Long)
      Method getPerErrorDisplay <21> () As Long
      Method setPerErrorDisplay <22> (ByVal fPerErrorDisplay As Long)
    End Interface

  • #2
    > This samples demonstrates how to embed a web browser in a PowerBASIC application.

    No, it does not embed a web browser control. It simply launches an instance of Internet Explorer.
    Forum: http://www.jose.it-berater.org/smfforum/index.php

    Comment


    • #3
      Is there some way to control the size and positioning the of the instance of Internet Explorer?

      Comment


      • #4
        Hi Douglas,
        Find the handle to IE and use SetWindowPos to move/resize it to wherever you want.

        Something like this has worked for me, after starting IExplore.exe ..

        Code:
        Do : hBrowser = FindWindow("IEFrame", ByVal %Null) : Loop Until hBrowser
        SetWindowPos hBrowser, %hWnd_NoTopMost, 800,200,1000,600,%SWP_ShowWindow

        Comment


        • #5
          Hi Gary
          The download link in post#1 no longer exist ?

          Comment


          • #6
            Hi Anne,
            Yep, don't know what happened. Restored.

            Comment


            • #7
              Thanks Gary

              Comment


              • #8
                retracted

                Comment

                Working...
                X