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

PowerBoogle v2.0

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

  • PowerBoogle v2.0

    making use of google search "query builder" from stan durham here:

    (powerboogle v1.0)
    http://www.powerbasic.com/support/pb...ad.php?t=24810

    and webbrowser code from jose roca here:
    http://www.powerbasic.com/support/pb...ead.php?t=8907

    and a little help from pbforms, we now have powerboogle v2.0, built in browse/searching capabilities.

    have tested in pbwin7.x and pbwin8.x and it seems to work well in both.

    public domain, no warranties, use at own risk

    [CODE] #dim all
    #include "win32api.inc"
    #include "initctrl.inc"

    %wm_forwardmsg = &h37f ' (895)

    %id_ocx = 2000

    %idd_dialog_main = 101
    %idc_label1 = 1001 '*
    %idc_frame1 = 1002 '*
    %idc_button1 = 1007 '*
    %idc_label_search_site = 1003
    %idc_label_search_category = 1005
    %idc_combobox_site = 1004
    %idc_combobox_category = 1006
    %idc_button_search = 1008
    %idc_textbox_url = 1009
    %idc_label_url = 1010
    %idc_button_back = 1011
    %idc_button_forward = 1012
    %idc_button_refresh = 1013
    %idc_button_stop = 1014
    %idc_button_navigate = 1015
    %idc_label_sitelinks = 1016
    %idc_textbox1 = 1018
    %idc_msctls_statusbar32_1 = 1019
    %idc_listbox_links = 1017
    %idc_textbox_keywords = 1018
    %idc_label_keywords = 1019

    global hdlg as dword
    global hocx as dword
    global oocx as dispatch
    global hwndsb as dword

    global urltext() as string
    global searchdata() as string
    global searchdesc() as string
    global extralist as long

    ' --------------------------------------------------------------------------------------------
    ' coclass: webbrowser
    ' guid: {8856f961-340a-11d0-a96b-00c04fd705a2}
    ' --------------------------------------------------------------------------------------------
    ' default event interface: dwebbrowserevents2
    ' default interface iid: {34a715a0-6587-11d0-924a-0020afc7ac4d}
    ' --------------------------------------------------------------------------------------------

    ' statustextchange dispid: &h00000066 (102)
    ' progresschange dispid: &h0000006c (108)
    ' commandstatechange dispid: &h00000069 (105)
    ' downloadbegin dispid: &h0000006a (106)
    ' downloadcomplete dispid: &h00000068 (104)
    ' titlechange dispid: &h00000071 (113)
    ' propertychange dispid: &h00000070 (112)
    ' beforenavigate2 dispid: &h000000fa (250)
    ' newwindow2 dispid: &h000000fb (251)
    ' navigatecomplete2 dispid: &h000000fc (252)
    ' documentcomplete dispid: &h00000103 (259)
    ' onquit dispid: &h000000fd (253)
    ' onvisible dispid: &h000000fe (254)
    ' ontoolbar dispid: &h000000ff (255)
    ' onmenubar dispid: &h00000100 (256)
    ' onstatusbar dispid: &h00000101 (257)
    ' onfullscreen dispid: &h00000102 (258)
    ' ontheatermode dispid: &h00000104 (260)
    ' windowsetresizable dispid: &h00000106 (262)
    ' windowsetleft dispid: &h00000108 (264)
    ' windowsettop dispid: &h00000109 (265)
    ' windowsetwidth dispid: &h0000010a (266)
    ' windowsetheight dispid: &h0000010b (267)
    ' windowclosing dispid: &h00000107 (263)
    ' clienttohostwindow dispid: &h0000010c (268)
    ' setsecurelockicon dispid: &h0000010d (269)
    ' filedownload dispid: &h0000010e (270)
    ' navigateerror dispid: &h0000010f (271)
    ' printtemplateinstantiation dispid: &h000000e1 (225)
    ' printtemplateteardown dispid: &h000000e2 (226)
    ' updatepagestatus dispid: &h000000e3 (227)
    ' privacyimpactedstatechange dispid: &h00000110 (272)

    ' --------------------------------------------------------------------------------------------
    ' excepinfo structure
    ' --------------------------------------------------------------------------------------------

    type excepinfo
    wcode as word ' // an error code describing the error.
    wreserved as word
    bstrsource as dword ' // source of the exception.
    bstrdescription as dword ' // textual description of the error.
    bstrhelpfile as dword ' // help file path.
    dwhelpcontext as dword ' // help context id.
    pvreserved as dword
    pfndeferredfillin as dword ' // pointer to a function that takes an excepinfo structure as an argument and returns an hresult value.
    scode as dword ' // a return value describing the error.
    end type

    ' --------------------------------------------------------------------------------------------
    ' idispatchvtable
    ' --------------------------------------------------------------------------------------------
    type idispatchvtable
    pqueryinterface as dword ' returns pointers to supported interfaces.
    paddref as dword ' increments reference count.
    prelease as dword ' decrements reference count.
    pgettypeinfocount as dword ' retrieves the number of type descriptions.
    pgettypeinfo as dword ' retrieves a description of object's programmable interface.
    pgetidsofnames as dword ' maps name of method or property to dispid.
    pinvoke as dword ' calls one of the object's methods, or gets/sets one of its properties.
    end type
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' ui4 release()
    ' --------------------------------------------------------------------------------------------

    declare function proto_shellwebbrowser_release (byval pthis as dword) as dword

    function shellwebbrowser_release (byval punk as dword) as dword
    local hresult as dword
    local ppunk as dword ptr
    local pvtbl as dword ptr
    local ppmethod as dword ptr
    local pmethod as dword
    ppunk = punk
    pvtbl = @ppunk
    ppmethod = pvtbl + 8
    pmethod = @ppmethod
    call dword pmethod using proto_shellwebbrowser_release(punk) to hresult
    function = hresult
    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' hresult queryinterface([in] *guid riid, [out] **void ppvobj)
    ' --------------------------------------------------------------------------------------------

    declare function proto_shellwebbrowser_iconnectionpointcontainer_queryinterface (byval punk as dword, byref riid as guid, byref ppvobj as dword) as dword

    function shellwebbrowser_iconnectionpointcontainer_queryinterface (byval punk as dword, byref riid as guid, byref ppvobj as dword) as dword
    local hresult as dword
    local ppunk as dword ptr
    local pvtbl as dword ptr
    local ppmethod as dword ptr
    local pmethod as dword
    ppunk = punk
    pvtbl = @ppunk
    ppmethod = pvtbl
    pmethod = @ppmethod
    call dword pmethod using proto_shellwebbrowser_iconnectionpointcontainer_queryinterface(punk,riid,ppvobj) to hresult
    function = hresult
    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' hresult findconnectionpoint([in] *guid riid, [out] **void ppcp)
    ' --------------------------------------------------------------------------------------------

    declare function proto_shellwebbrowser_iconnectionpointcontainer_findconnectionpoint (byval punk as dword, byref riid as guid, byref ppcp as dword) as dword

    function shellwebbrowser_iconnectionpointcontainer_findconnectionpoint (byval punk as dword, byref riid as guid, byref ppcp as dword) as dword
    local hresult as dword
    local ppunk as dword ptr
    local pvtbl as dword ptr
    local ppmethod as dword ptr
    local pmethod as dword
    ppunk = punk
    pvtbl = @ppunk
    ppmethod = pvtbl + 16
    pmethod = @ppmethod
    call dword pmethod using proto_shellwebbrowser_iconnectionpointcontainer_findconnectionpoint(punk,riid,ppcp) to hresult
    function = hresult
    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' hresult advise([in] *iunknown psink, [out] *dword pdwcookie)
    ' --------------------------------------------------------------------------------------------

    declare function proto_shellwebbrowser_iconnectionpoint_advise (byval punk as dword, byval psink as dword, byref preturn as dword) as dword

    function shellwebbrowser_iconnectionpoint_advise (byval punk as dword, byval psink as dword, byref pdwcookie as dword) as dword
    local preturn as dword
    local hresult as dword
    local ppunk as dword ptr
    local pvtbl as dword ptr
    local ppmethod as dword ptr
    local pmethod as dword
    ppunk = punk
    pvtbl = @ppunk
    ppmethod = pvtbl + 20
    pmethod = @ppmethod
    call dword pmethod using proto_shellwebbrowser_iconnectionpoint_advise(punk,psink,preturn) to hresult
    pdwcookie = preturn
    function = hresult
    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' hresult unadvise([in] dword dwcookie)
    ' --------------------------------------------------------------------------------------------

    declare function proto_shellwebbrowser_iconnectionpoint_unadvise (byval punk as dword, byval pdwcookie as dword) as dword

    function shellwebbrowser_iconnectionpoint_unadvise (byval punk as dword, byval dwcookie as dword) as dword
    local hresult as dword
    local ppunk as dword ptr
    local pvtbl as dword ptr
    local ppmethod as dword ptr
    local pmethod as dword
    ppunk = punk
    pvtbl = @ppunk
    ppmethod = pvtbl + 24
    pmethod = @ppmethod
    call dword pmethod using proto_shellwebbrowser_iconnectionpoint_unadvise(punk,dwcookie) to hresult
    function = hresult
    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' builds the idispatch vtable
    ' --------------------------------------------------------------------------------------------

    sub shellwebbrowser_idispatch_buildvtable (vt as idispatchvtable)
    vt.pqueryinterface = codeptr(shellwebbrowser_idispatch_queryinterface)
    vt.paddref = codeptr(shellwebbrowser_idispatch_addref)
    vt.prelease = codeptr(shellwebbrowser_idispatch_release)
    vt.pgettypeinfocount = codeptr(shellwebbrowser_idispatch_gettypeinfocount)
    vt.pgettypeinfo = codeptr(shellwebbrowser_idispatch_gettypeinfo)
    vt.pgetidsofnames = codeptr(shellwebbrowser_idispatch_getidsofnames)
    vt.pinvoke = codeptr(shellwebbrowser_idispatch_invoke)
    end sub
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' ui4 addref()
    ' --------------------------------------------------------------------------------------------

    function shellwebbrowser_idispatch_addref (byval punk as dword) as dword
    function = %s_ok
    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' ui4 release()
    ' --------------------------------------------------------------------------------------------
    function shellwebbrowser_idispatch_release (byval punk as dword) as dword
    function = %s_ok
    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' hresult queryinterface([in] *guid riid, [out] **void ppvobj)
    ' --------------------------------------------------------------------------------------------

    function shellwebbrowser_idispatch_queryinterface (byval punk as dword, byref riid as guid, byref ppvobj as dword) as dword
    static psink as dword
    static vtbl as idispatchvtable
    shellwebbrowser_idispatch_buildvtable(vtbl)
    psink = varptr(vtbl)
    ppvobj = varptr(psink)
    shellwebbrowser_idispatch_addref(punk)
    function = %s_ok
    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' hresult gettypeinfocount([out] *uint pctinfo)
    ' --------------------------------------------------------------------------------------------

    function shellwebbrowser_idispatch_gettypeinfocount (byval punk as dword, byref pctinfo as dword) as dword
    function = %e_notimpl
    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' hresult gettypeinfo([in] uint itinfo, [in] ui4 lcid, [out] **void pptinfo)
    ' --------------------------------------------------------------------------------------------

    function shellwebbrowser_idispatch_gettypeinfo (byval punk as dword, byval itinfo as dword, byval lcid as dword, byref pptinfo as dword) as dword
    function = %e_notimpl
    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' hresult getidsofnames([in] *guid riid, [in] **i1 rgsznames, [in] uint cnames, [in] ui4 lcid, [out] *i4 rgdispid)
    ' --------------------------------------------------------------------------------------------

    function shellwebbrowser_idispatch_getidsofnames (byval punk as dword, byref riid as guid, byval rgsznames as dword, byval cnames as dword, byval lcid as dword, byref rgdispid as long) as dword
    function = %e_notimpl
    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' establishes a connection between the connection point object and the client's sink.
    ' returns a token that uniquely identifies this connection.
    ' --------------------------------------------------------------------------------------------

    function shellwebbrowser_setevents (byval punk as dword, byref pdwcookie as dword) as dword

    local hr as dword ' hresult
    local pcpc as dword ' iconnectionpointcontainer
    local pcp as dword ' iconnectionpoint
    local iid_cpc as guid ' iid_iconnectionpointcontainer
    local iid_cp as guid ' mshflexgrid events dispinterface
    local psink as dword ' pointer to our sink interface
    local dwcookie as dword ' returned token
    static vtbl as idispatchvtable

    iid_cpc = guid$(" {b196b284-bab4-101a-b69c-00aa00341d07}")
    iid_cp = guid$("{34a715a0-6587-11d0-924a-0020afc7ac4d}")

    hr = shellwebbrowser_iconnectionpointcontainer_queryinterface(punk, iid_cpc, pcpc)
    if hr <> %s_ok then
    function = hr
    exit function
    end if

    hr = shellwebbrowser_iconnectionpointcontainer_findconnectionpoint(pcpc, iid_cp, pcp)
    shellwebbrowser_release(pcpc)
    if hr <> %s_ok then
    function = hr
    exit function
    end if

    shellwebbrowser_idispatch_buildvtable(vtbl)
    psink = varptr(vtbl)
    hr = shellwebbrowser_iconnectionpoint_advise(pcp, byval varptr(psink), dwcookie)

    pdwcookie = dwcookie
    shellwebbrowser_release(pcp)
    function = hr

    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------

    function shellwebbrowser_releaseevents (byval punk as dword, byval dwcookie as dword) as dword

    local hr as dword ' hresult
    local pcpc as dword ' iconnectionpointcontainer
    local pcp as dword ' iconnectionpoint
    local iid_cpc as guid ' iid_iconnectionpointcontainer
    local iid_cp as guid ' connectionevents dispinterface

    iid_cpc = guid$(" {b196b284-bab4-101a-b69c-00aa00341d07}")
    iid_cp = guid$("{34a715a0-6587-11d0-924a-0020afc7ac4d}")

    hr = shellwebbrowser_iconnectionpointcontainer_queryinterface(punk, iid_cpc, pcpc)
    if hr <> %s_ok then
    function = hr
    exit function
    end if

    hr = shellwebbrowser_iconnectionpointcontainer_findconnectionpoint(pcpc, iid_cp, pcp)
    shellwebbrowser_release(pcpc)
    if hr <> %s_ok then
    function = hr
    exit function
    end if

    hr = shellwebbrowser_iconnectionpoint_unadvise(pcp, dwcookie)
    shellwebbrowser_release(pcp)
    function = hr

    end function
    ' --------------------------------------------------------------------------------------------

    ' ********************************************************************************************
    ' onevent functions
    ' ********************************************************************************************

    ' --------------------------------------------------------------------------------------------
    ' statusbar text changed.
    ' dispid: &h00000066 (102)
    ' --------------------------------------------------------------------------------------------
    ' parameters:
    ' text string byval [flags: 1] [in] '[vt_bstr] (8)
    ' --------------------------------------------------------------------------------------------
    function shellwebbrowser_statustextchange (byval punk as dword, byref pdispparams as dispparams) as dword

    local pv as variant ptr
    local bstrtext as string
    local szbuf as asciiz*500

    ' // parameters in dispparams are zero based and in reverse order.
    pv = pdispparams.variantargs
    bstrtext = variant$(@pv[0])

    szbuf=bstrtext
    sendmessage hwndsb, %sb_settext, 0, varptr(szbuf)

    ' *** put your code here ***

    function = %s_ok

    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' fired when download progress is updated.
    ' dispid: &h0000006c (108)
    ' --------------------------------------------------------------------------------------------
    ' parameters:
    ' progress long byval [flags: 1] [in] '[vt_i4] (3)
    ' progressmax long byval [flags: 1] [in] '[vt_i4] (3)
    ' --------------------------------------------------------------------------------------------
    function shellwebbrowser_progresschange (byval punk as dword, byref pdispparams as dispparams) as dword

    local pv as variant ptr
    local i4progress as long
    local i4progressmax as long

    ' // parameters in dispparams are zero based and in reverse order.
    pv = pdispparams.variantargs
    i4progress = variant#(@pv[1])
    i4progressmax = variant#(@pv[0])


    ' *** put your code here ***

    function = %s_ok

    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' the enabled state of a command changed.
    ' dispid: &h00000069 (105)
    ' --------------------------------------------------------------------------------------------
    ' parameters:
    ' command long byval [flags: 1] [in] '[vt_i4] (3)
    ' enable long byval [flags: 1] [in] '[vt_bool] (11)
    ' --------------------------------------------------------------------------------------------
    function shellwebbrowser_commandstatechange (byval punk as dword, byref pdispparams as dispparams) as dword

    local pv as variant ptr
    local i4command as long
    local benable as long

    ' // parameters in dispparams are zero based and in reverse order.
    pv = pdispparams.variantargs
    i4command = variant#(@pv[1])
    benable = variant#(@pv[0])

    select case i4command
    case &h00000002
    if istrue(benable) then
    control enable hdlg, %idc_button_back
    else
    control disable hdlg, %idc_button_back
    end if
    case &h00000001
    if istrue(benable) then
    control enable hdlg, %idc_button_forward
    else
    control disable hdlg, %idc_button_forward
    end if
    end select

    ' *** put your code here ***

    function = %s_ok

    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' download of a page started.
    ' dispid: &h0000006a (106)
    ' --------------------------------------------------------------------------------------------
    function shellwebbrowser_downloadbegin (byval punk as dword, byref pdispparams as dispparams) as dword

    ' *** put your code here ***

    function = %s_ok

    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' download of page complete.
    ' dispid: &h00000068 (104)
    ' --------------------------------------------------------------------------------------------
    function shellwebbrowser_downloadcomplete (byval punk as dword, byref pdispparams as dispparams) as dword

    ' *** put your code here ***

    function = %s_ok

    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' document title changed.
    ' dispid: &h00000071 (113)
    ' --------------------------------------------------------------------------------------------
    ' parameters:
    ' text string byval [flags: 1] [in] '[vt_bstr] (8)
    ' --------------------------------------------------------------------------------------------
    function shellwebbrowser_titlechange (byval punk as dword, byref pdispparams as dispparams) as dword

    local pv as variant ptr
    local bstrtext as string

    ' // parameters in dispparams are zero based and in reverse order.
    pv = pdispparams.variantargs
    bstrtext = variant$(@pv[0])

    dialog set text hdlg, "powerboogle v2.0 - "+bstrtext

    ' *** put your code here ***

    function = %s_ok

    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' fired when the putproperty method has been called.
    ' dispid: &h00000070 (112)
    ' --------------------------------------------------------------------------------------------
    ' parameters:
    ' szproperty string byval [flags: 1] [in] '[vt_bstr] (8)
    ' --------------------------------------------------------------------------------------------
    function shellwebbrowser_propertychange (byval punk as dword, byref pdispparams as dispparams) as dword

    local pv as variant ptr
    local bstrszproperty as string

    ' // parameters in dispparams are zero based and in reverse order.
    pv = pdispparams.variantargs
    bstrszproperty = variant$(@pv[0])

    ' *** put your code here ***

    function = %s_ok

    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' fired before navigate occurs in the given webbrowser (window or frameset element). the processing of this navigation may be modified.
    ' dispid: &h000000fa (250)
    ' --------------------------------------------------------------------------------------------
    ' parameters:
    ' pdisp dword byval [flags: 1] [in] '[vt_dispatch] (9)
    ' url variant byref [flags: 1] [in] '[vt_variant] (12)
    ' flags variant byref [flags: 1] [in] '[vt_variant] (12)
    ' targetframename variant byref [flags: 1] [in] '[vt_variant] (12)
    ' postdata variant byref [flags: 1] [in] '[vt_variant] (12)
    ' headers variant byref [flags: 1] [in] '[vt_variant] (12)
    ' cancel long byref [flags: 3] [out] '[vt_bool] (11)
    ' --------------------------------------------------------------------------------------------
    function shellwebbrowser_beforenavigate2 (byval punk as dword, byref pdispparams as dispparams) as dword

    local pv as variant ptr
    local ui4pdisp as dword
    local vurl as variant
    local vflags as variant
    local vtargetframename as variant
    local vpostdata as variant
    local vheaders as variant
    local bcancel as long

    ' // parameters in dispparams are zero based and in reverse order.
    pv = pdispparams.variantargs
    ui4pdisp = variant#(@pv[6])
    vurl = @pv[5]
    vflags = @pv[4]
    vtargetframename = @pv[3]
    vpostdata = @pv[2]
    vheaders = @pv[1]
    bcancel = variant#(@pv[0])

    ' *** put your code here ***
    control enable hdlg, %idc_button_stop

    function = %s_ok

    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' a new, hidden, non-navigated webbrowser window is needed.
    ' dispid: &h000000fb (251)
    ' --------------------------------------------------------------------------------------------
    ' parameters:
    ' ppdisp dword byref [flags: 3] [out] '[vt_dispatch] (9)
    ' cancel long byref [flags: 3] [out] '[vt_bool] (11)
    ' --------------------------------------------------------------------------------------------
    function shellwebbrowser_newwindow2 (byval punk as dword, byref pdispparams as dispparams) as dword

    local pv as variant ptr
    local ui4ppdisp as dword
    local bcancel as long

    ' // parameters in dispparams are zero based and in reverse order.
    pv = pdispparams.variantargs
    ui4ppdisp = variant#(@pv[1])
    bcancel = variant#(@pv[0])

    ' *** put your code here ***

    function = %s_ok

    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' fired when the document being navigated to becomes visible and enters the navigation stack.
    ' dispid: &h000000fc (252)
    ' --------------------------------------------------------------------------------------------
    ' parameters:
    ' pdisp dword byval [flags: 1] [in] '[vt_dispatch] (9)
    ' url variant byref [flags: 1] [in] '[vt_variant] (12)
    ' --------------------------------------------------------------------------------------------
    function shellwebbrowser_navigatecomplete2 (byval punk as dword, byref pdispparams as dispparams) as dword

    local pv as variant ptr
    local ui4pdisp as dword
    local vurl as variant

    ' // parameters in dispparams are zero based and in reverse order.
    pv = pdispparams.variantargs
    ui4pdisp = variant#(@pv[1])
    vurl = @pv[0]

    ' *** put your code here ***
    control disable hdlg, %idc_button_stop
    control set text hdlg, %idc_textbox_url, variant$(vurl)

    ' // to get the location name:
    ' local vlocname as variant
    ' object get oocx.locationname to vlocname
    ' control set text hdlg, %idc_url, variant$(vlocname)

    function = %s_ok

    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' fired when the document being navigated to reaches readystate_complete.
    ' dispid: &h00000103 (259)
    ' --------------------------------------------------------------------------------------------
    ' parameters:
    ' pdisp dword byval [flags: 1] [in] '[vt_dispatch] (9)
    ' url variant byref [flags: 1] [in] '[vt_variant] (12)
    ' --------------------------------------------------------------------------------------------
    function shellwebbrowser_documentcomplete (byval punk as dword, byref pdispparams as dispparams) as dword

    local pv as variant ptr
    local ui4pdisp as dword
    local vurl as variant

    ' // parameters in dispparams are zero based and in reverse order.
    pv = pdispparams.variantargs
    ui4pdisp = variant#(@pv[1])
    vurl = @pv[0]

    ' *** put your code here ***

    function = %s_ok

    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' fired when application is quiting.
    ' dispid: &h000000fd (253)
    ' --------------------------------------------------------------------------------------------
    function shellwebbrowser_onquit (byval punk as dword, byref pdispparams as dispparams) as dword

    ' *** put your code here ***

    function = %s_ok

    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' fired when the window should be shown/hidden
    ' dispid: &h000000fe (254)
    ' --------------------------------------------------------------------------------------------
    ' parameters:
    ' visible long byval [flags: 1] [in] '[vt_bool] (11)
    ' --------------------------------------------------------------------------------------------
    function shellwebbrowser_onvisible (byval punk as dword, byref pdispparams as dispparams) as dword

    local pv as variant ptr
    local bvisible as long

    ' // parameters in dispparams are zero based and in reverse order.
    pv = pdispparams.variantargs
    bvisible = variant#(@pv[0])

    ' *** put your code here ***

    function = %s_ok

    end function
    ' --------------------------------------------------------------------------------------------

    ' --------------------------------------------------------------------------------------------
    ' fired when the toolbar should be shown/hidden
    ' dispid: &h000000ff (255)
    ' --------------------------------------------------------------------------------------------
    ' parameters:
    ' toolbar long byval [flags: 1] [in] '[vt_bool] (11)
    ' --------------------------------------------------------------------------------------------
    function shellwebbrowser_ontoolbar (byval punk as dword, byref pdispparams as dispparams) as dword

    local pv as variant ptr
    local btoolbar as long

    ' // parameters i
    Adam Drake
    Drake Software

  • #2
    Edit: 01/20/2006

    Made changes to webbrowser code per instructions of Jose Roca, and added to ability to add sites to the list via an INI file.

    ------------------
    Adam Drake
    Drake Software

    Comment


    • #3
      Ok, one more edit, added the ability to customize your list somewhat.

      - If you want one of the sites to be only in the site links list, insert '%URLONLY%' into that line in the INI file, like this:

      Code:
      Phoenix Forums,http://www.phnxthunder.com/forums/phpBB2/%URLONLY%
      If you want your "site query" to be slightly different than your link, for example the MSDN search, add this to the file, note '%SEARCH%' delimits the URL and the custom site query:

      Code:
      MSDN 2,http://msdn.microsoft.com/library/default.asp%SEARCH%msdn.microsoft.com+MSDN+WIN32
      ------------------


      [This message has been edited by Adam J. Drake (edited January 20, 2006).]
      Adam Drake
      Drake Software

      Comment


      • #4
        I know this thread hasn't been touched in over 13 years, BUT!!! I haven't been active on the forums for a long time...

        I just tried to compile the code above, and found that, at the least, it was truncated.

        I'm still interested in trying this out, if it's possible to obtain the rest of the code?

        Thanks,
        -John

        Comment


        • #5
          Hi John,

          Found this on my PC. Good Luck

          PowerBoogle.zip
          Rgds, Dave

          Comment


          • #6
            Hi Dave,

            Thanks for posting that file!

            Upon examination, I note that the .BAS in the .ZIP is significantly different in coding style from the (incomplete) code in post #1.
            It's going to take me some time to see which version is the most current (and how/why) ... I think one is built on objects, the other not...

            No sweat, I have some time, as there's no football tonight!

            Thanks,
            -John

            Comment


            • #7
              I found the old code - these links are unfortunately current as of 2006 - not this decade - but the functionality is there - it was only tested and compiled up through PBWIN8 - I don't think all of the UDTs will be correct for later versions:

              Code:
                #DIM ALL
                #INCLUDE "win32api.inc"
                #INCLUDE "INITCTRL.INC"
              
                %WM_FORWARDMSG = &H37F ' (895)
              
                %ID_OCX     = 2000
              
                %IDD_DIALOG_MAIN           =  101
                %IDC_LABEL1                = 1001   '*
                %IDC_FRAME1                = 1002   '*
                %IDC_BUTTON1               = 1007   '*
                %IDC_LABEL_SEARCH_SITE     = 1003
                %IDC_LABEL_SEARCH_CATEGORY = 1005
                %IDC_COMBOBOX_SITE         = 1004
                %IDC_COMBOBOX_CATEGORY     = 1006
                %IDC_BUTTON_SEARCH         = 1008
                %IDC_TEXTBOX_URL           = 1009
                %IDC_LABEL_URL             = 1010
                %IDC_BUTTON_BACK           = 1011
                %IDC_BUTTON_FORWARD        = 1012
                %IDC_BUTTON_REFRESH        = 1013
                %IDC_BUTTON_STOP           = 1014
                %IDC_BUTTON_NAVIGATE       = 1015
                %IDC_LABEL_SITELINKS       = 1016
                %IDC_TEXTBOX1              = 1018
                %IDC_MSCTLS_STATUSBAR32_1  = 1019
                %IDC_LISTBOX_LINKS         = 1017
                %IDC_TEXTBOX_KEYWORDS      = 1018
                %IDC_LABEL_KEYWORDS        = 1019
              
                GLOBAL hDlg AS DWORD
                GLOBAL hOcx AS DWORD
                GLOBAL oOcx AS DISPATCH
                GLOBAL hWndSB AS DWORD
              
                GLOBAL URLText()      AS STRING
                GLOBAL SearchData()   AS STRING
                GLOBAL SearchDesc()   AS STRING
                GLOBAL ExtraList      AS LONG
              
              ' --------------------------------------------------------------------------------------------
              ' CoClass: WebBrowser
              ' GUID: {8856F961-340A-11D0-A96B-00C04FD705A2}
              ' --------------------------------------------------------------------------------------------
              ' Default event interface: DWebBrowserEvents2
              ' Default interface IID: {34A715A0-6587-11D0-924A-0020AFC7AC4D}
              ' --------------------------------------------------------------------------------------------
              
              ' StatusTextChange                        DispId: &H00000066 (102)
              ' ProgressChange                          DispId: &H0000006C (108)
              ' CommandStateChange                      DispId: &H00000069 (105)
              ' DownloadBegin                           DispId: &H0000006A (106)
              ' DownloadComplete                        DispId: &H00000068 (104)
              ' TitleChange                             DispId: &H00000071 (113)
              ' PropertyChange                          DispId: &H00000070 (112)
              ' BeforeNavigate2                         DispId: &H000000FA (250)
              ' NewWindow2                              DispId: &H000000FB (251)
              ' NavigateComplete2                       DispId: &H000000FC (252)
              ' DocumentComplete                        DispId: &H00000103 (259)
              ' OnQuit                                  DispId: &H000000FD (253)
              ' OnVisible                               DispId: &H000000FE (254)
              ' OnToolBar                               DispId: &H000000FF (255)
              ' OnMenuBar                               DispId: &H00000100 (256)
              ' OnStatusBar                             DispId: &H00000101 (257)
              ' OnFullScreen                            DispId: &H00000102 (258)
              ' OnTheaterMode                           DispId: &H00000104 (260)
              ' WindowSetResizable                      DispId: &H00000106 (262)
              ' WindowSetLeft                           DispId: &H00000108 (264)
              ' WindowSetTop                            DispId: &H00000109 (265)
              ' WindowSetWidth                          DispId: &H0000010A (266)
              ' WindowSetHeight                         DispId: &H0000010B (267)
              ' WindowClosing                           DispId: &H00000107 (263)
              ' ClientToHostWindow                      DispId: &H0000010C (268)
              ' SetSecureLockIcon                       DispId: &H0000010D (269)
              ' FileDownload                            DispId: &H0000010E (270)
              ' NavigateError                           DispId: &H0000010F (271)
              ' PrintTemplateInstantiation              DispId: &H000000E1 (225)
              ' PrintTemplateTeardown                   DispId: &H000000E2 (226)
              ' UpdatePageStatus                        DispId: &H000000E3 (227)
              ' PrivacyImpactedStateChange              DispId: &H00000110 (272)
              
              ' --------------------------------------------------------------------------------------------
              ' EXCEPINFO structure
              ' --------------------------------------------------------------------------------------------
              
                TYPE EXCEPINFO
                   wCode AS WORD               ' // An error code describing the error.
                   wReserved AS WORD
                   bstrSource AS DWORD         ' // Source of the exception.
                   bstrDescription AS DWORD    ' // Textual description of the error.
                   bstrHelpFile AS DWORD       ' // Help file path.
                   dwHelpContext AS DWORD      ' // Help context ID.
                   pvReserved AS DWORD
                   pfnDeferredFillIn AS DWORD  ' // Pointer to a function that takes an EXCEPINFO structure as an argument and returns an HRESULT value.
                   scode AS DWORD              ' // A return value describing the error.
                END TYPE
              
              ' --------------------------------------------------------------------------------------------
              ' IDispatchVTable
              ' --------------------------------------------------------------------------------------------
                TYPE IDispatchVTable
                   pQueryInterface AS DWORD     ' Returns pointers to supported interfaces.
                   pAddRef AS DWORD             ' Increments reference count.
                   pRelease AS DWORD            ' Decrements reference count.
                   pGetTypeInfoCount AS DWORD   ' Retrieves the number of type descriptions.
                   pGetTypeInfo AS DWORD        ' Retrieves a description of object's programmable interface.
                   pGetIDsOfNames AS DWORD      ' Maps name of method or property to DispId.
                   pInvoke AS DWORD             ' Calls one of the object's methods, or gets/sets one of its properties.
                END TYPE
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' UI4 Release()
              ' --------------------------------------------------------------------------------------------
              
                DECLARE FUNCTION Proto_ShellWebBrowser_Release (BYVAL pThis AS DWORD) AS DWORD
              
                FUNCTION ShellWebBrowser_Release (BYVAL pUnk AS DWORD) AS DWORD
                   LOCAL HRESULT AS DWORD
                   LOCAL ppunk AS DWORD PTR
                   LOCAL pvtbl AS DWORD PTR
                   LOCAL ppmethod AS DWORD PTR
                   LOCAL pmethod AS DWORD
                   ppunk = pUnk
                   pvtbl = @ppunk
                   ppmethod = pvtbl + 8
                   pmethod = @ppmethod
                   CALL DWORD pmethod USING Proto_ShellWebBrowser_Release(pUnk) TO HRESULT
                   FUNCTION = HRESULT
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' HRESULT QueryInterface([in] *GUID riid, [out] **VOID ppvObj)
              ' --------------------------------------------------------------------------------------------
              
                DECLARE FUNCTION Proto_ShellWebBrowser_IConnectionPointContainer_QueryInterface (BYVAL pUnk AS DWORD, BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS DWORD
              
                FUNCTION ShellWebBrowser_IConnectionPointContainer_QueryInterface (BYVAL pUnk AS DWORD, BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS DWORD
                   LOCAL HRESULT AS DWORD
                   LOCAL ppunk AS DWORD PTR
                   LOCAL pvtbl AS DWORD PTR
                   LOCAL ppmethod AS DWORD PTR
                   LOCAL pmethod AS DWORD
                   ppunk = pUnk
                   pvtbl = @ppunk
                   ppmethod = pvtbl
                   pmethod = @ppmethod
                   CALL DWORD pmethod USING Proto_ShellWebBrowser_IConnectionPointContainer_QueryInterface(pUnk,riid,ppvObj) TO HRESULT
                   FUNCTION = HRESULT
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' HRESULT FindConnectionPoint([in] *GUID riid, [out] **VOID ppCP)
              ' --------------------------------------------------------------------------------------------
              
                DECLARE FUNCTION Proto_ShellWebBrowser_IConnectionPointContainer_FindConnectionPoint (BYVAL pUnk AS DWORD, BYREF riid AS GUID, BYREF ppCP AS DWORD) AS DWORD
              
                FUNCTION ShellWebBrowser_IConnectionPointContainer_FindConnectionPoint (BYVAL pUnk AS DWORD, BYREF riid AS GUID, BYREF ppCP AS DWORD) AS DWORD
                   LOCAL HRESULT AS DWORD
                   LOCAL ppunk AS DWORD PTR
                   LOCAL pvtbl AS DWORD PTR
                   LOCAL ppmethod AS DWORD PTR
                   LOCAL pmethod AS DWORD
                   ppunk = pUnk
                   pvtbl = @ppunk
                   ppmethod = pvtbl + 16
                   pmethod = @ppmethod
                   CALL DWORD pmethod USING Proto_ShellWebBrowser_IConnectionPointContainer_FindConnectionPoint(pUnk,riid,ppCP) TO HRESULT
                   FUNCTION = HRESULT
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' HRESULT Advise([in] *IUNKNOWN pSink, [out] *DWORD pdwCookie)
              ' --------------------------------------------------------------------------------------------
              
                DECLARE FUNCTION Proto_ShellWebBrowser_IConnectionPoint_Advise (BYVAL pUnk AS DWORD, BYVAL pSink AS DWORD, BYREF pReturn AS DWORD) AS DWORD
              
                FUNCTION ShellWebBrowser_IConnectionPoint_Advise (BYVAL pUnk AS DWORD, BYVAL pSink AS DWORD, BYREF pdwCookie AS DWORD) AS DWORD
                   LOCAL pReturn AS DWORD
                   LOCAL HRESULT AS DWORD
                   LOCAL ppunk AS DWORD PTR
                   LOCAL pvtbl AS DWORD PTR
                   LOCAL ppmethod AS DWORD PTR
                   LOCAL pmethod AS DWORD
                   ppunk = pUnk
                   pvtbl = @ppunk
                   ppmethod = pvtbl + 20
                   pmethod = @ppmethod
                   CALL DWORD pmethod USING Proto_ShellWebBrowser_IConnectionPoint_Advise(pUnk,pSink,pReturn) TO HRESULT
                   pdwCookie = pReturn
                   FUNCTION = HRESULT
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              '  HRESULT Unadvise([in] DWORD dwCookie)
              ' --------------------------------------------------------------------------------------------
              
                DECLARE FUNCTION Proto_ShellWebBrowser_IConnectionPoint_Unadvise (BYVAL pUnk AS DWORD, BYVAL pdwCookie AS DWORD) AS DWORD
              
                FUNCTION ShellWebBrowser_IConnectionPoint_Unadvise (BYVAL pUnk AS DWORD, BYVAL dwCookie AS DWORD) AS DWORD
                   LOCAL HRESULT AS DWORD
                   LOCAL ppunk AS DWORD PTR
                   LOCAL pvtbl AS DWORD PTR
                   LOCAL ppmethod AS DWORD PTR
                   LOCAL pmethod AS DWORD
                   ppunk = pUnk
                   pvtbl = @ppunk
                   ppmethod = pvtbl + 24
                   pmethod = @ppmethod
                   CALL DWORD pmethod USING Proto_ShellWebBrowser_IConnectionPoint_Unadvise(pUnk,dwCookie) TO HRESULT
                   FUNCTION = HRESULT
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Builds the IDispatch VTable
              ' --------------------------------------------------------------------------------------------
              
                SUB ShellWebBrowser_IDispatch_BuildVTable (Vt AS IDispatchVTable)
                   Vt.pQueryInterface   = CODEPTR(ShellWebBrowser_IDispatch_QueryInterface)
                   Vt.pAddRef           = CODEPTR(ShellWebBrowser_IDispatch_AddRef)
                   Vt.pRelease          = CODEPTR(ShellWebBrowser_IDispatch_Release)
                   Vt.pGetTypeInfoCount = CODEPTR(ShellWebBrowser_IDispatch_GetTypeInfoCount)
                   Vt.pGetTypeInfo      = CODEPTR(ShellWebBrowser_IDispatch_GetTypeInfo)
                   Vt.pGetIDsOfNames    = CODEPTR(ShellWebBrowser_IDispatch_GetIDsOfNames)
                   Vt.pInvoke           = CODEPTR(ShellWebBrowser_IDispatch_Invoke)
                END SUB
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' UI4 AddRef()
              ' --------------------------------------------------------------------------------------------
              
                FUNCTION ShellWebBrowser_IDispatch_AddRef (BYVAL pUnk AS DWORD) AS DWORD
                   FUNCTION = %S_OK
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' UI4 Release()
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_IDispatch_Release (BYVAL pUnk AS DWORD) AS DWORD
                   FUNCTION = %S_OK
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' HRESULT QueryInterface([in] *GUID riid, [out] **VOID ppvObj)
              ' --------------------------------------------------------------------------------------------
              
                FUNCTION ShellWebBrowser_IDispatch_QueryInterface (BYVAL pUnk AS DWORD, BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS DWORD
                   STATIC pSink AS DWORD
                   STATIC Vtbl AS IDispatchVTable
                   ShellWebBrowser_IDispatch_BuildVTable(Vtbl)
                   pSink = VARPTR(VTbl)
                   ppvObj = VARPTR(pSink)
                   ShellWebBrowser_IDispatch_AddRef(pUnk)
                   FUNCTION = %S_OK
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' HRESULT GetTypeInfoCount([out] *UINT pctinfo)
              ' --------------------------------------------------------------------------------------------
              
                FUNCTION ShellWebBrowser_IDispatch_GetTypeInfoCount (BYVAL pUnk AS DWORD, BYREF pctInfo AS DWORD) AS DWORD
                   FUNCTION = %E_NOTIMPL
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' HRESULT GetTypeInfo([in] UINT itinfo, [in] UI4 lcid, [out] **VOID pptinfo)
              ' --------------------------------------------------------------------------------------------
              
                FUNCTION ShellWebBrowser_IDispatch_GetTypeInfo (BYVAL pUnk AS DWORD, BYVAL itinfo AS DWORD, BYVAL lcid AS DWORD, BYREF pptinfo AS DWORD) AS DWORD
                   FUNCTION = %E_NOTIMPL
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' HRESULT GetIDsOfNames([in] *GUID riid, [in] **I1 rgszNames, [in] UINT cNames, [in] UI4 lcid, [out] *I4 rgdispid)
              ' --------------------------------------------------------------------------------------------
              
                FUNCTION ShellWebBrowser_IDispatch_GetIDsOfNames (BYVAL pUnk AS DWORD, BYREF riid AS GUID, BYVAL rgszNames AS DWORD, BYVAL cNames AS DWORD, BYVAL lcid AS DWORD, BYREF rgdispid AS LONG) AS DWORD
                   FUNCTION = %E_NOTIMPL
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Establishes a connection between the connection point object and the client's sink.
              ' Returns a token that uniquely identifies this connection.
              ' --------------------------------------------------------------------------------------------
              
                FUNCTION ShellWebBrowser_SetEvents (BYVAL pUnk AS DWORD, BYREF pdwCookie AS DWORD) AS DWORD
              
                   LOCAL hr AS DWORD        ' HRESULT
                   LOCAL pCPC AS DWORD      ' IConnectionPointContainer
                   LOCAL pCP AS DWORD       ' IConnectionPoint
                   LOCAL IID_CPC AS GUID    ' IID_IConnectionPointContainer
                   LOCAL IID_CP AS GUID     ' MSHFlexGrid events dispinterface
                   LOCAL pSink AS DWORD     ' Pointer to our sink interface
                   LOCAL dwCookie AS DWORD  ' Returned token
                   STATIC VTbl AS IDispatchVTable
              
                   IID_CPC = GUID$(" {B196B284-BAB4-101A-B69C-00AA00341D07}")
                   IID_CP  = GUID$("{34A715A0-6587-11D0-924A-0020AFC7AC4D}")
              
                   hr = ShellWebBrowser_IConnectionPointContainer_QueryInterface(pUnk, IID_CPC, pCPC)
                   IF hr <> %S_OK THEN
                      FUNCTION = hr
                      EXIT FUNCTION
                   END IF
              
                   hr = ShellWebBrowser_IConnectionPointContainer_FindConnectionPoint(pCPC, IID_CP, pCP)
                   ShellWebBrowser_Release(pCPC)
                   IF hr <> %S_OK THEN
                      FUNCTION = hr
                      EXIT FUNCTION
                   END IF
              
                   ShellWebBrowser_IDispatch_BuildVTable(VTbl)
                   pSink = VARPTR(VTbl)
                   hr = ShellWebBrowser_IConnectionPoint_Advise(pCP, BYVAL VARPTR(pSink), dwCookie)
              
                   pdwCookie = dwCookie
                   ShellWebBrowser_Release(pCP)
                   FUNCTION = hr
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              
                FUNCTION ShellWebBrowser_ReleaseEvents (BYVAL pUnk AS DWORD, BYVAL dwCookie AS DWORD) AS DWORD
              
                   LOCAL hr AS DWORD        ' HRESULT
                   LOCAL pCPC AS DWORD      ' IConnectionPointContainer
                   LOCAL pCP AS DWORD       ' IConnectionPoint
                   LOCAL IID_CPC AS GUID    ' IID_IConnectionPointContainer
                   LOCAL IID_CP AS GUID     ' ConnectionEvents dispinterface
              
                   IID_CPC = GUID$(" {B196B284-BAB4-101A-B69C-00AA00341D07}")
                   IID_CP  = GUID$("{34A715A0-6587-11D0-924A-0020AFC7AC4D}")
              
                   hr = ShellWebBrowser_IConnectionPointContainer_QueryInterface(pUnk, IID_CPC, pCPC)
                   IF hr <> %S_OK THEN
                      FUNCTION = hr
                      EXIT FUNCTION
                   END IF
              
                   hr = ShellWebBrowser_IConnectionPointContainer_FindConnectionPoint(pCPC, IID_CP, pCP)
                   ShellWebBrowser_Release(pCPC)
                   IF hr <> %S_OK THEN
                      FUNCTION = hr
                      EXIT FUNCTION
                   END IF
              
                   hr = ShellWebBrowser_IConnectionPoint_Unadvise(pCP, dwCookie)
                   ShellWebBrowser_Release(pCP)
                   FUNCTION = hr
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' ********************************************************************************************
              ' OnEvent Functions
              ' ********************************************************************************************
              
              ' --------------------------------------------------------------------------------------------
              ' Statusbar text changed.
              ' DispId: &H00000066 (102)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' Text                                STRING    BYVAL  [flags: 1] [in]  '[VT_BSTR] (8)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_StatusTextChange (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL bstrText AS STRING
                   LOCAL szBuf    AS ASCIIZ*500
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   bstrText = VARIANT$(@pv[0])
              
                   szBuf=bstrText
                   SendMessage hWndSB, %SB_SETTEXT, 0, VARPTR(szBuf)
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when download progress is updated.
              ' DispId: &H0000006C (108)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' Progress                            LONG      BYVAL  [flags: 1] [in]  '[VT_I4] (3)
              ' ProgressMax                         LONG      BYVAL  [flags: 1] [in]  '[VT_I4] (3)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_ProgressChange (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL i4Progress AS LONG
                   LOCAL i4ProgressMax AS LONG
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   i4Progress = VARIANT#(@pv[1])
                   i4ProgressMax = VARIANT#(@pv[0])
              
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' The enabled state of a command changed.
              ' DispId: &H00000069 (105)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' Command                             LONG      BYVAL  [flags: 1] [in]  '[VT_I4] (3)
              ' Enable                              LONG      BYVAL  [flags: 1] [in]  '[VT_BOOL] (11)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_CommandStateChange (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL i4Command AS LONG
                   LOCAL bEnable AS LONG
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   i4Command = VARIANT#(@pv[1])
                   bEnable = VARIANT#(@pv[0])
              
                   SELECT CASE i4Command
                       CASE &H00000002
                           IF ISTRUE(bEnable) THEN
                               CONTROL ENABLE hDlg, %IDC_BUTTON_BACK
                           ELSE
                               CONTROL DISABLE hDlg, %IDC_BUTTON_BACK
                           END IF
                       CASE &H00000001
                           IF ISTRUE(bEnable) THEN
                               CONTROL ENABLE hDlg, %IDC_BUTTON_FORWARD
                           ELSE
                               CONTROL DISABLE hDlg, %IDC_BUTTON_FORWARD
                           END IF
                   END SELECT
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Download of a page started.
              ' DispId: &H0000006A (106)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_DownloadBegin (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Download of page complete.
              ' DispId: &H00000068 (104)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_DownloadComplete (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Document title changed.
              ' DispId: &H00000071 (113)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' Text                                STRING    BYVAL  [flags: 1] [in]  '[VT_BSTR] (8)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_TitleChange (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL bstrText AS STRING
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   bstrText = VARIANT$(@pv[0])
              
                   DIALOG SET TEXT hDlg, "PowerBoogle v2.0 - "+bstrText
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when the PutProperty method has been called.
              ' DispId: &H00000070 (112)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' szProperty                          STRING    BYVAL  [flags: 1] [in]  '[VT_BSTR] (8)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_PropertyChange (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL bstrszProperty AS STRING
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   bstrszProperty = VARIANT$(@pv[0])
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired before navigate occurs in the given WebBrowser (window or frameset element). The processing of this navigation may be modified.
              ' DispId: &H000000FA (250)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' pDisp                               DWORD     BYVAL  [flags: 1] [in]  '[VT_DISPATCH] (9)
              ' URL                                 VARIANT   BYREF  [flags: 1] [in]  '[VT_VARIANT] (12)
              ' Flags                               VARIANT   BYREF  [flags: 1] [in]  '[VT_VARIANT] (12)
              ' TargetFrameName                     VARIANT   BYREF  [flags: 1] [in]  '[VT_VARIANT] (12)
              ' PostData                            VARIANT   BYREF  [flags: 1] [in]  '[VT_VARIANT] (12)
              ' Headers                             VARIANT   BYREF  [flags: 1] [in]  '[VT_VARIANT] (12)
              ' Cancel                              LONG      BYREF  [flags: 3] [out]  '[VT_BOOL] (11)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_BeforeNavigate2 (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL ui4pDisp AS DWORD
                   LOCAL vURL AS VARIANT
                   LOCAL vFlags AS VARIANT
                   LOCAL vTargetFrameName AS VARIANT
                   LOCAL vPostData AS VARIANT
                   LOCAL vHeaders AS VARIANT
                   LOCAL bCancel AS LONG
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   ui4pDisp = VARIANT#(@pv[6])
                   vURL = @pv[5]
                   vFlags = @pv[4]
                   vTargetFrameName = @pv[3]
                   vPostData = @pv[2]
                   vHeaders = @pv[1]
                   bCancel = VARIANT#(@pv[0])
              
                   ' *** Put your code here ***
                   CONTROL ENABLE hDlg, %IDC_BUTTON_STOP
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' A new, hidden, non-navigated WebBrowser window is needed.
              ' DispId: &H000000FB (251)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' ppDisp                              DWORD     BYREF  [flags: 3] [out]  '[VT_DISPATCH] (9)
              ' Cancel                              LONG      BYREF  [flags: 3] [out]  '[VT_BOOL] (11)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_NewWindow2 (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL ui4ppDisp AS DWORD
                   LOCAL bCancel AS LONG
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   ui4ppDisp = VARIANT#(@pv[1])
                   bCancel = VARIANT#(@pv[0])
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when the document being navigated to becomes visible and enters the navigation stack.
              ' DispId: &H000000FC (252)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' pDisp                               DWORD     BYVAL  [flags: 1] [in]  '[VT_DISPATCH] (9)
              ' URL                                 VARIANT   BYREF  [flags: 1] [in]  '[VT_VARIANT] (12)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_NavigateComplete2 (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL ui4pDisp AS DWORD
                   LOCAL vURL AS VARIANT
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   ui4pDisp = VARIANT#(@pv[1])
                   vURL = @pv[0]
              
                   ' *** Put your code here ***
                   CONTROL DISABLE hDlg, %IDC_BUTTON_STOP
                   CONTROL SET TEXT hDlg, %IDC_TEXTBOX_URL, VARIANT$(vURL)
              
              '     // To get the location name:
              '     LOCAL vLocName AS VARIANT
              '     OBJECT GET oOcx.LocationName TO vLocName
              '     CONTROL SET TEXT hDlg, %IDC_URL, VARIANT$(vLocName)
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when the document being navigated to reaches ReadyState_Complete.
              ' DispId: &H00000103 (259)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' pDisp                               DWORD     BYVAL  [flags: 1] [in]  '[VT_DISPATCH] (9)
              ' URL                                 VARIANT   BYREF  [flags: 1] [in]  '[VT_VARIANT] (12)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_DocumentComplete (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL ui4pDisp AS DWORD
                   LOCAL vURL AS VARIANT
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   ui4pDisp = VARIANT#(@pv[1])
                   vURL = @pv[0]
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when application is quiting.
              ' DispId: &H000000FD (253)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_OnQuit (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when the window should be shown/hidden
              ' DispId: &H000000FE (254)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' Visible                             LONG      BYVAL  [flags: 1] [in]  '[VT_BOOL] (11)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_OnVisible (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL bVisible AS LONG
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   bVisible = VARIANT#(@pv[0])
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when the toolbar  should be shown/hidden
              ' DispId: &H000000FF (255)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' ToolBar                             LONG      BYVAL  [flags: 1] [in]  '[VT_BOOL] (11)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_OnToolBar (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL bToolBar AS LONG
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   bToolBar = VARIANT#(@pv[0])
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when the menubar should be shown/hidden
              ' DispId: &H00000100 (256)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' MenuBar                             LONG      BYVAL  [flags: 1] [in]  '[VT_BOOL] (11)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_OnMenuBar (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL bMenuBar AS LONG
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   bMenuBar = VARIANT#(@pv[0])
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when the statusbar should be shown/hidden
              ' DispId: &H00000101 (257)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' StatusBar                           LONG      BYVAL  [flags: 1] [in]  '[VT_BOOL] (11)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_OnStatusBar (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL bStatusBar AS LONG
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   bStatusBar = VARIANT#(@pv[0])
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when fullscreen mode should be on/off
              ' DispId: &H00000102 (258)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' FullScreen                          LONG      BYVAL  [flags: 1] [in]  '[VT_BOOL] (11)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_OnFullScreen (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL bFullScreen AS LONG
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   bFullScreen = VARIANT#(@pv[0])
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when theater mode should be on/off
              ' DispId: &H00000104 (260)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' TheaterMode                         LONG      BYVAL  [flags: 1] [in]  '[VT_BOOL] (11)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_OnTheaterMode (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL bTheaterMode AS LONG
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   bTheaterMode = VARIANT#(@pv[0])
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when the host window should allow/disallow resizing
              ' DispId: &H00000106 (262)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' Resizable                           LONG      BYVAL  [flags: 1] [in]  '[VT_BOOL] (11)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_WindowSetResizable (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL bResizable AS LONG
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   bResizable = VARIANT#(@pv[0])
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when the host window should change its Left coordinate
              ' DispId: &H00000108 (264)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' Left                                LONG      BYVAL  [flags: 1] [in]  '[VT_I4] (3)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_WindowSetLeft (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL i4Left AS LONG
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   i4Left = VARIANT#(@pv[0])
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when the host window should change its Top coordinate
              ' DispId: &H00000109 (265)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' Top                                 LONG      BYVAL  [flags: 1] [in]  '[VT_I4] (3)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_WindowSetTop (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL i4Top AS LONG
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   i4Top = VARIANT#(@pv[0])
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when the host window should change its width
              ' DispId: &H0000010A (266)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' Width                               LONG      BYVAL  [flags: 1] [in]  '[VT_I4] (3)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_WindowSetWidth (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL i4Width AS LONG
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   i4Width = VARIANT#(@pv[0])
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when the host window should change its height
              ' DispId: &H0000010B (267)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' Height                              LONG      BYVAL  [flags: 1] [in]  '[VT_I4] (3)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_WindowSetHeight (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL i4Height AS LONG
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   i4Height = VARIANT#(@pv[0])
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when the WebBrowser is about to be closed by script
              ' DispId: &H00000107 (263)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' IsChildWindow                       LONG      BYVAL  [flags: 1] [in]  '[VT_BOOL] (11)
              ' Cancel                              LONG      BYREF  [flags: 3] [out]  '[VT_BOOL] (11)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_WindowClosing (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL bIsChildWindow AS LONG
                   LOCAL bCancel AS LONG
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   bIsChildWindow = VARIANT#(@pv[1])
                   bCancel = VARIANT#(@pv[0])
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired to request client sizes be converted to host window sizes
              ' DispId: &H0000010C (268)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' CX                                  LONG      BYREF  [flags: 3] [out]  '[VT_I4] (3)
              ' CY                                  LONG      BYREF  [flags: 3] [out]  '[VT_I4] (3)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_ClientToHostWindow (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL i4CX AS LONG
                   LOCAL i4CY AS LONG
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   i4CX = VARIANT#(@pv[1])
                   i4CY = VARIANT#(@pv[0])
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired to indicate the security level of the current web page contents
              ' DispId: &H0000010D (269)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' SecureLockIcon                      LONG      BYVAL  [flags: 1] [in]  '[VT_I4] (3)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_SetSecureLockIcon (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL i4SecureLockIcon AS LONG
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   i4SecureLockIcon = VARIANT#(@pv[0])
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired to indicate the File Download dialog is opening
              ' DispId: &H0000010E (270)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' Cancel                              LONG      BYREF  [flags: 3] [out]  '[VT_BOOL] (11)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_FileDownload (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL bCancel AS LONG
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   bCancel = VARIANT#(@pv[0])
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when a binding error occurs (window or frameset element).
              ' DispId: &H0000010F (271)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' pDisp                               DWORD     BYVAL  [flags: 1] [in]  '[VT_DISPATCH] (9)
              ' URL                                 VARIANT   BYREF  [flags: 1] [in]  '[VT_VARIANT] (12)
              ' Frame                               VARIANT   BYREF  [flags: 1] [in]  '[VT_VARIANT] (12)
              ' StatusCode                          VARIANT   BYREF  [flags: 1] [in]  '[VT_VARIANT] (12)
              ' Cancel                              LONG      BYREF  [flags: 3] [out]  '[VT_BOOL] (11)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_NavigateError (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL ui4pDisp AS DWORD
                   LOCAL vURL AS VARIANT
                   LOCAL vFrame AS VARIANT
                   LOCAL vStatusCode AS VARIANT
                   LOCAL bCancel AS LONG
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   ui4pDisp = VARIANT#(@pv[4])
                   vURL = @pv[3]
                   vFrame = @pv[2]
                   vStatusCode = @pv[1]
                   bCancel = VARIANT#(@pv[0])
              
                   ' *** Put your code here ***
                   CONTROL DISABLE hDlg, %IDC_BUTTON_STOP
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when a print template is instantiated.
              ' DispId: &H000000E1 (225)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' pDisp                               DWORD     BYVAL  [flags: 1] [in]  '[VT_DISPATCH] (9)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_PrintTemplateInstantiation (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL pDisp AS DWORD
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   pDisp = VARIANT#(@pv[0])
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when a print template destroyed.
              ' DispId: &H000000E2 (226)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' pDisp                               DWORD     BYVAL  [flags: 1] [in]  '[VT_DISPATCH] (9)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_PrintTemplateTeardown (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL pDisp AS DWORD
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   pDisp = VARIANT#(@pv[0])
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when a page is spooled. When it is fired can be changed by a custom template.
              ' DispId: &H000000E3 (227)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' pDisp                               DWORD     BYVAL  [flags: 1] [in]  '[VT_DISPATCH] (9)
              ' nPage                               VARIANT   BYREF  [flags: 1] [in]  '[VT_VARIANT] (12)
              ' fDone                               VARIANT   BYREF  [flags: 1] [in]  '[VT_VARIANT] (12)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_UpdatePageStatus (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL ui4pDisp AS DWORD
                   LOCAL vnPage AS VARIANT
                   LOCAL vfDone AS VARIANT
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   ui4pDisp = VARIANT#(@pv[2])
                   vnPage = @pv[1]
                   vfDone = @pv[0]
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' Fired when the global privacy impacted state changes
              ' DispId: &H00000110 (272)
              ' --------------------------------------------------------------------------------------------
              ' Parameters:
              ' bImpacted                           LONG      BYVAL  [flags: 1] [in]  '[VT_BOOL] (11)
              ' --------------------------------------------------------------------------------------------
                FUNCTION ShellWebBrowser_PrivacyImpactedStateChange (BYVAL pUnk AS DWORD, BYREF pdispparams AS DISPPARAMS) AS DWORD
              
                   LOCAL pv AS VARIANT PTR
                   LOCAL bbImpacted AS LONG
              
                   ' // Parameters in DISPPARAMS are zero based and in reverse order.
                   pv = pdispparams.VariantArgs
                   bbImpacted = VARIANT#(@pv[0])
              
                   ' *** Put your code here ***
              
                   FUNCTION = %S_OK
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              ' --------------------------------------------------------------------------------------------
              ' HRESULT Invoke([in] I4 dispidMember, [in] *GUID riid, [in] UI4 lcid, [in] UI2 wFlags, [in] *DISPPARAMS pdispparams, [out] *VARIANT pvarResult, [out] *EXCEPINFO pexcepinfo, [out] *UINT puArgErr)
              ' --------------------------------------------------------------------------------------------
              
                FUNCTION ShellWebBrowser_IDispatch_Invoke (BYVAL pUnk AS DWORD, BYVAL dispidMember AS LONG, BYREF riid AS GUID, _
                BYVAL lcid AS DWORD, BYVAL wFlags AS WORD, BYREF pdispparams AS DISPPARAMS, BYREF pvarResult AS VARIANT, _
                BYREF pexcepinfo AS EXCEPINFO, BYREF puArgErr AS DWORD) AS DWORD
              
                   FUNCTION = %S_OK
              
                   IF VARPTR(pdispparams) THEN
              
                      SELECT CASE AS LONG dispidMember
              
                         CASE &H66  ' (102)  ' // StatusTextChange
                            FUNCTION = ShellWebBrowser_StatusTextChange(pUnk, pdispparams)
              
                         CASE &H6C  ' (108)  ' // ProgressChange
                            FUNCTION = ShellWebBrowser_ProgressChange(pUnk, pdispparams)
              
                         CASE &H69  ' (105)  ' // CommandStateChange
                            FUNCTION = ShellWebBrowser_CommandStateChange(pUnk, pdispparams)
              
                         CASE &H6A  ' (106)  ' // DownloadBegin
                            FUNCTION = ShellWebBrowser_DownloadBegin(pUnk, pdispparams)
              
                         CASE &H68  ' (104)  ' // DownloadComplete
                            FUNCTION = ShellWebBrowser_DownloadComplete(pUnk, pdispparams)
              
                         CASE &H71  ' (113)  ' // TitleChange
                            FUNCTION = ShellWebBrowser_TitleChange(pUnk, pdispparams)
              
                         CASE &H70  ' (112)  ' // PropertyChange
                            FUNCTION = ShellWebBrowser_PropertyChange(pUnk, pdispparams)
              
                         CASE &HFA  ' (250)  ' // BeforeNavigate2
                            FUNCTION = ShellWebBrowser_BeforeNavigate2(pUnk, pdispparams)
              
                         CASE &HFB  ' (251)  ' // NewWindow2
                            FUNCTION = ShellWebBrowser_NewWindow2(pUnk, pdispparams)
              
                         CASE &HFC  ' (252)  ' // NavigateComplete2
                            FUNCTION = ShellWebBrowser_NavigateComplete2(pUnk, pdispparams)
              
                         CASE &H103  ' (259)  ' // DocumentComplete
                            FUNCTION = ShellWebBrowser_DocumentComplete(pUnk, pdispparams)
              
                         CASE &HFD  ' (253)  ' // OnQuit
                            FUNCTION = ShellWebBrowser_OnQuit(pUnk, pdispparams)
              
                         CASE &HFE  ' (254)  ' // OnVisible
                            FUNCTION = ShellWebBrowser_OnVisible(pUnk, pdispparams)
              
                         CASE &HFF  ' (255)  ' // OnToolBar
                            FUNCTION = ShellWebBrowser_OnToolBar(pUnk, pdispparams)
              
                         CASE &H100  ' (256)  ' // OnMenuBar
                            FUNCTION = ShellWebBrowser_OnMenuBar(pUnk, pdispparams)
              
                         CASE &H101  ' (257)  ' // OnStatusBar
                            FUNCTION = ShellWebBrowser_OnStatusBar(pUnk, pdispparams)
              
                         CASE &H102  ' (258)  ' // OnFullScreen
                            FUNCTION = ShellWebBrowser_OnFullScreen(pUnk, pdispparams)
              
                         CASE &H104  ' (260)  ' // OnTheaterMode
                            FUNCTION = ShellWebBrowser_OnTheaterMode(pUnk, pdispparams)
              
                         CASE &H106  ' (262)  ' // WindowSetResizable
                            FUNCTION = ShellWebBrowser_WindowSetResizable(pUnk, pdispparams)
              
                         CASE &H108  ' (264)  ' // WindowSetLeft
                            FUNCTION = ShellWebBrowser_WindowSetLeft(pUnk, pdispparams)
              
                         CASE &H109  ' (265)  ' // WindowSetTop
                            FUNCTION = ShellWebBrowser_WindowSetTop(pUnk, pdispparams)
              
                         CASE &H10A  ' (266)  ' // WindowSetWidth
                            FUNCTION = ShellWebBrowser_WindowSetWidth(pUnk, pdispparams)
              
                         CASE &H10B  ' (267)  ' // WindowSetHeight
                            FUNCTION = ShellWebBrowser_WindowSetHeight(pUnk, pdispparams)
              
                         CASE &H107  ' (263)  ' // WindowClosing
                            FUNCTION = ShellWebBrowser_WindowClosing(pUnk, pdispparams)
              
                         CASE &H10C  ' (268)  ' // ClientToHostWindow
                            FUNCTION = ShellWebBrowser_ClientToHostWindow(pUnk, pdispparams)
              
                         CASE &H10D  ' (269)  ' // SetSecureLockIcon
                            FUNCTION = ShellWebBrowser_SetSecureLockIcon(pUnk, pdispparams)
              
                         CASE &H10E  ' (270)  ' // FileDownload
                            FUNCTION = ShellWebBrowser_FileDownload(pUnk, pdispparams)
              
                         CASE &H10F  ' (271)  ' // NavigateError
                            FUNCTION = ShellWebBrowser_NavigateError(pUnk, pdispparams)
              
                         CASE &HE1  ' (225)  ' // PrintTemplateInstantiation
                            FUNCTION = ShellWebBrowser_PrintTemplateInstantiation(pUnk, pdispparams)
              
                         CASE &HE2  ' (226)  ' // PrintTemplateTeardown
                            FUNCTION = ShellWebBrowser_PrintTemplateTeardown(pUnk, pdispparams)
              
                         CASE &HE3  ' (227)  ' // UpdatePageStatus
                            FUNCTION = ShellWebBrowser_UpdatePageStatus(pUnk, pdispparams)
              
                         CASE &H110  ' (272)  ' // PrivacyImpactedStateChange
                            FUNCTION = ShellWebBrowser_PrivacyImpactedStateChange(pUnk, pdispparams)
              
                      END SELECT
              
                   END IF
              
                END FUNCTION
              ' --------------------------------------------------------------------------------------------
              
              
                DECLARE FUNCTION AtlAxWinInit LIB "ATL.DLL" ALIAS "AtlAxWinInit" () AS LONG
              ' *********************************************************************************************
                DECLARE FUNCTION AtlAxWinTerm () AS LONG
              ' *********************************************************************************************
                FUNCTION AtlAxWinTerm () AS LONG
                  UnregisterClass ("AtlAxWin", GetModuleHandle(BYVAL %NULL))
                END FUNCTION
              ' *********************************************************************************************
              ' **********************************************************************************************
                DECLARE FUNCTION AtlAxGetControl LIB "ATL.DLL" ALIAS "AtlAxGetControl" _
                   ( _
                   BYVAL hWnd AS DWORD, _   ' [in] A handle to the window that is hosting the control.
                   BYREF pp AS DWORD _      ' [out] The IUnknown of the control being hosted.
                ) AS DWORD
              ' *********************************************************************************************
              ' *********************************************************************************************
                FUNCTION IUnknown_AddRef (BYVAL pthis AS DWORD PTR) AS DWORD
                   LOCAL DWRESULT AS LONG
                   IF ISFALSE pthis THEN EXIT FUNCTION
                   CALL DWORD @@pthis[1] USING IUnknown_AddRef(pthis) TO DWRESULT
                   FUNCTION = DWRESULT
                END FUNCTION
              ' *********************************************************************************************
              
              ' *********************************************************************************************
              ' Puts the address of an object in a variant and marks it as containing a dispatch variable
              ' *********************************************************************************************
                SUB AtlMakeDispatch ( _
                   BYVAL lpObj AS DWORD, _                        ' Address of the object instance
                   BYREF vObj AS VARIANT _                        ' Variant to contain this address
                   ) EXPORT
                   LOCAL lpvObj AS VARIANTAPI PTR                 ' Pointer to a VARIANTAPI structure
                   LET vObj = EMPTY                               ' Make sure is empty to avoid memory leaks
                   lpvObj = VARPTR(vObj)                          ' Get the VARIANT address
                   @lpvObj.vt = %VT_DISPATCH                      ' Mark it as containing a dispatch variable
                   @lpvObj.vd.pdispVal = lpObj                    ' Set the dispatch pointer address
                   IUnknown_AddRef lpObj                          ' Increase the reference count
                END SUB
              ' *********************************************************************************************
              ' *********************************************************************************************
              
              ' *********************************************************************************************
              ' Main dialog callback
              ' *********************************************************************************************
                CALLBACK FUNCTION MainDlgProc()
              
                  LOCAL xx        AS LONG
                  LOCAL yy        AS LONG
                  LOCAL strURL    AS STRING
                  LOCAL lbSel     AS LONG
                  LOCAL strSite   AS STRING
                  LOCAL strCat    AS STRING
                  LOCAL strQuery  AS STRING
                  LOCAL found     AS LONG
                  LOCAL strkeyw   AS STRING
              
                  SELECT CASE AS LONG CBMSG
                      CASE %WM_INITDIALOG
                          ' Initialization handler
              
                      CASE %WM_SIZE
                          ' Dialog has been resized
                          IF CBWPARAM<>%SIZE_MINIMIZED THEN
                              CONTROL SEND CBHNDL, %IDC_MSCTLS_STATUSBAR32_1, CBMSG, CBWPARAM, _
                                  CBLPARAM
                              DIALOG GET SIZE CBHNDL TO xx, yy
                              CONTROL SET SIZE CBHNDL, %ID_OCX, xx-118, yy-59
                              CONTROL SET SIZE CBHNDL, %IDC_TEXTBOX_URL, xx-213, 13
                              CONTROL SET LOC CBHNDL, %IDC_BUTTON_NAVIGATE, xx-58, 5
                              IF (yy-192)>0 THEN
                                  CONTROL SET SIZE CBHNDL, %IDC_LISTBOX_LINKS, 100, yy-187
                              END IF
                          END IF
              
              
                      CASE %WM_NCACTIVATE
                          STATIC hWndSaveFocus AS DWORD
                          IF ISFALSE CBWPARAM THEN
                              ' Save control focus
                              hWndSaveFocus = GetFocus()
                          ELSEIF hWndSaveFocus THEN
                              ' Restore control focus
                              SetFocus(hWndSaveFocus)
                              hWndSaveFocus = 0
                          END IF
              
                      CASE %WM_DESTROY
                          PostQuitMessage 0
              
                      CASE %WM_COMMAND
                          ' Process control notifications
                          SELECT CASE AS LONG CBCTL
                              CASE %IDCANCEL
                                  DIALOG END CBHNDL
                              CASE %IDC_LABEL_SEARCH_SITE
              
                              CASE %IDC_COMBOBOX_SITE
                                  IF CBCTLMSG=%CBN_SELCHANGE THEN
                                      COMBOBOX GET TEXT CBHNDL, %IDC_COMBOBOX_SITE TO strSite
                                      IF strSITE<>"PowerBASIC" THEN
                                          CONTROL DISABLE CBHNDL, %IDC_COMBOBOX_CATEGORY
                                      ELSE
                                          CONTROL ENABLE CBHNDL, %IDC_COMBOBOX_CATEGORY
                                      END IF
                                  END IF
              
                              CASE %IDC_LABEL_SEARCH_CATEGORY
              
                              CASE %IDC_COMBOBOX_CATEGORY
              
                              CASE %IDC_BUTTON_SEARCH
                                  IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                      COMBOBOX GET TEXT CBHNDL, %IDC_COMBOBOX_SITE TO strSite
                                      COMBOBOX GET TEXT CBHNDL, %IDC_COMBOBOX_CATEGORY TO strCat
                                      CONTROL GET TEXT CBHNDL, %IDC_TEXTBOX_KEYWORDS TO strKeyw
                                      REPLACE " " WITH "+" IN strKeyw
                                      strKeyw="+"+strKeyw
                                      strURL="http://www.google.com/search?hl=en&q=+"
                                      SELECT CASE strSite
                                          CASE "PowerBASIC"
                                              strQuery="site:www.powerbasic.com"
                                              SELECT CASE strCat
                                                  CASE "All Forums"
                                                      ' Add nothing
                                                  CASE "Product Announcements"
                                                      strQuery=strQuery+"+Forum1"
                                                  CASE "FAQ"
                                                      strQuery=strQuery+"+Forum2"
                                                  CASE "PowerBase"
                                                      strQuery=strQuery+"+Forum13"
                                                  CASE "PowerBASIC CC"
                                                      strQuery=strQuery+"+Forum5"
                                                  CASE "PowerBASIC for DOS"
                                                      strQuery=strQuery+"+Forum3"
                                                  CASE "PowerBASIC for Windows"
                                                      strQuery=strQuery+"+Forum4"
                                                  CASE "Programming"
                                                      strQuery=strQuery+"+Forum6"
                                                  CASE "Programming the Internet"
                                                      strQuery=strQuery+"+Forum9"
                                                  CASE "Source Code"
                                                      strQuery=strQuery+"+Forum7"
                                                  CASE "Third Party Add-Ons"
                                                      strQuery=strQuery+"+Forum8"
                                                  CASE "Positions Wanted/Offered"
                                                      strQuery=strQuery+"+Forum11"
                                                  CASE "Cafe PowerBASIC"
                                                      strQuery=strQuery+"+Forum12"
                                                  CASE "Online PBCC Help"
                                                      strQuery=strQuery+"/support/help/pbcc/"
                                              END SELECT
                                          CASE "MSDN"
                                              strQuery="site:msdn.microsoft.com+MSDN+WIN32"
                                          CASE "EZGUI"
                                              strQuery="site:chrisboss.hypermart.net"
                                          CASE "PlanetSquires"
                                              strQuery="site:www.planetsquires.com"
                                          CASE "Win32 API Tutorial"
                                              strQuery="site:www.winprog.org"
                                          CASE "Wotsit.ORG"
                                              strQuery="site:www.wotsit.org"
                                          CASE "AllAPI Network"
                                              strQuery="site:www.mentalis.org"
                                          CASE "Hello Basic"
                                              strQuery="site:www.hellobasic.com"
                                          CASE "Jose Roca Software"
                                              strQuery="site:com.it-berater.org"
                                          CASE "SQLite"
                                              strQuery="site:www.sqlite.org"
                                          CASE "SQL"
                                              strQuery="site:www.w3schools.com/sql/"
                                          CASE "Tsunami"
                                              strQuery="site:www.trm-ug.com"
                                          CASE "Web"
                                              strQuery=""
                                          CASE ELSE
                                              ARRAY SCAN SearchDesc(), =strSite, TO Found
                                              IF Found<>0 THEN
                                                  strQuery=SearchData(Found)
                                              ELSE
                                                  MSGBOX "URL for selected item not found.", %MB_ICONINFORMATION, "PowerBoogle v2.0"
                                                  EXIT FUNCTION
                                              END IF
                                      END SELECT
                                      strURL=strURL+strQuery+strKeyw
                                      CALL NavigateURL(strURL)
                                  END IF
              
                              CASE %IDC_TEXTBOX_URL
              
                              CASE %IDC_LABEL_URL
              
                              CASE %IDC_BUTTON_BACK
                                  IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                      OBJECT CALL oOcx.GoBack
                                  END IF
              
                              CASE %IDC_BUTTON_FORWARD
                                  IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                      OBJECT CALL oOcx.GoForward
                                  END IF
              
                              CASE %IDC_BUTTON_REFRESH
                                  IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                      OBJECT CALL oOcx.Refresh
                                  END IF
              
                              CASE %IDC_BUTTON_STOP
                                  IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                      OBJECT CALL oOcx.Stop
                                  END IF
              
                              CASE %IDC_BUTTON_NAVIGATE
                                  IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN
                                      CONTROL GET TEXT CBHNDL, %IDC_TEXTBOX_URL TO strURL
                                      CALL NavigateURL(strURL)
                                  END IF
              
                              CASE %IDC_LABEL_SITELINKS
              
                              CASE %IDC_LISTBOX_LINKS
                                  IF CBCTLMSG=%LBN_DBLCLK THEN
                                      CONTROL SEND CBHNDL, %IDC_LISTBOX_LINKS, %LB_GETCURSEL, 0, 0 TO lbSel
                                      IF lbSel>-1 THEN
                                          strURL=URLText(lbSel+1)
                                          CALL NavigateURL(strURL)
                                      END IF
                                  END IF
              
                              CASE %IDC_TEXTBOX1
              
                              CASE %IDC_MSCTLS_STATUSBAR32_1
              
              
                          END SELECT
                  END SELECT
              
                END FUNCTION
              ' *********************************************************************************************
              
              ' *********************************************************************************************
              
              FUNCTION Webbrowser_TranslateMessage(BYVAL hWnd AS DWORD, tmsg AS tagMsg) AS LONG
              
              ' Retrieve the handle of the window that hosts the WebBrowser control
                LOCAL hCtrl AS DWORD
                hCtrl = GetDlgItem(hWnd, %ID_OCX)
                ' Retrieve the ancestor of the control that has the focus
                LOCAL hWndCtrl AS DWORD
                hWndCtrl = GetFocus
                DO
                   IF ISFALSE GetParent(hWndCtrl) OR GetParent(hWndCtrl) = hWnd THEN EXIT DO
                   hWndCtrl = GetParent(hWndCtrl)
                LOOP
              ' %WM_FORWARDMSG = &H37F
              ' If the focus is in the WebBrowser, forward the message to it
              '  IF hCtrl = GetParent(GetParent(GetParent(GetFocus))) THEN
                IF hCtrl = hWndCtrl THEN
                   IF ISTRUE SendMessage(hCtrl, &H37F, 0, VARPTR(tmsg)) THEN FUNCTION = %TRUE
                END IF
              
              END FUNCTION
              
              ' *********************************************************************************************
              ' Main
              ' *********************************************************************************************
                FUNCTION PBMAIN
              
                   LOCAL hInst AS DWORD
                   LOCAL hr AS DWORD
                   LOCAL OcxName AS ASCIIZ * 255
                   LOCAL pUnk AS DWORD
                   LOCAL vVar AS VARIANT
                   LOCAL uMsg AS tagMsg
                   LOCAL dwCookie AS DWORD
                   LOCAL filedata AS STRING
                   LOCAL fnum     AS LONG
                   LOCAL x        AS LONG
                   LOCAL temp     AS STRING
                   LOCAL URLOnly  AS LONG
                   LOCAL SearchDiff AS STRING
                   LOCAL NoTrim     AS LONG
              
                   InitComCtl32 %ICC_WIN95_CLASSES OR %ICC_DATE_CLASSES OR %ICC_INTERNET_CLASSES
              
                   OcxName = "Shell.Explorer"
              
                   AtlAxWinInit   ' // Initializes ATL
              
                   DIALOG NEW %HWND_DESKTOP, "PowerBoogle v2.0", 70, 70, 534, 353, %WS_POPUP OR _
                       %WS_BORDER OR %WS_DLGFRAME OR %WS_SYSMENU OR %WS_MINIMIZEBOX OR _
                       %WS_MAXIMIZEBOX OR %WS_CLIPSIBLINGS OR %WS_THICKFRAME OR %WS_VISIBLE OR %DS_MODALFRAME _
                       OR %DS_3DLOOK OR %DS_NOFAILCREATE OR %DS_SETFONT, _
                       %WS_EX_CONTROLPARENT OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                       %WS_EX_RIGHTSCROLLBAR, TO hDlg
                   CONTROL ADD "AtlAxWin", hDlg, %ID_OCX, OcxName, 110, 25, 420, 310, %WS_VISIBLE OR %WS_CHILD
                   CONTROL HANDLE hDlg, %ID_OCX TO hOcx
                  CONTROL ADD TEXTBOX,  hDlg, %IDC_TEXTBOX_URL, "", 150, 5, 325, 13
                  CONTROL ADD BUTTON,   hDlg, %IDC_BUTTON_NAVIGATE, "Navigate", 480, 5, 50, _
                      15
                  CONTROL ADD COMBOBOX, hDlg, %IDC_COMBOBOX_SITE, , 5, 15, 100, 65, _
                      %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %WS_VSCROLL OR _
                      %CBS_DROPDOWNLIST, %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                      %WS_EX_RIGHTSCROLLBAR
                  CONTROL ADD COMBOBOX, hDlg, %IDC_COMBOBOX_CATEGORY, , 5, 40, 100, 60, _
                      %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %WS_VSCROLL OR _
                      %CBS_DROPDOWNLIST, %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                      %WS_EX_RIGHTSCROLLBAR
                   CONTROL ADD TEXTBOX,  hDlg, %IDC_TEXTBOX_KEYWORDS, "", 5, 65, 100, 13
                   CONTROL ADD BUTTON,   hDlg, %IDC_BUTTON_SEARCH, "&Search", 55, 80, 50, 15
                   CONTROL ADD BUTTON,   hDlg, %IDC_BUTTON_BACK, "&Back", 5, 100, 50, 15
                   CONTROL ADD BUTTON,   hDlg, %IDC_BUTTON_FORWARD, "&Forward", 55, 100, 50, _
                       15
                   CONTROL ADD BUTTON,   hDlg, %IDC_BUTTON_REFRESH, "&Refresh", 5, 120, 50, _
                       15
                   CONTROL ADD BUTTON,   hDlg, %IDC_BUTTON_STOP, "S&top", 55, 120, 50, 15
                   CONTROL ADD LISTBOX,  hDlg, %IDC_LISTBOX_LINKS, , 5, 155, 100, 180, _
                       %WS_CHILD OR %WS_VISIBLE OR %WS_TABSTOP OR %WS_VSCROLL OR _
                       %LBS_NOTIFY, %WS_EX_CLIENTEDGE OR %WS_EX_LEFT OR %WS_EX_LTRREADING _
                       OR %WS_EX_RIGHTSCROLLBAR
                   CONTROL ADD "msctls_statusbar32", hDlg, %IDC_MSCTLS_STATUSBAR32_1, _
                       "msctls_statusbar32_1", 0, 340, 534, 13, %WS_CHILD OR %WS_VISIBLE, _
                       %WS_EX_TRANSPARENT OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _
                       %WS_EX_RIGHTSCROLLBAR
                   CONTROL ADD LABEL,    hDlg, %IDC_LABEL_SEARCH_SITE, "Search Site:", 5, 5, _
                       80, 10
                   CONTROL ADD LABEL,    hDlg, %IDC_LABEL_SEARCH_CATEGORY, "Search " + _
                       "Category:", 5, 30, 80, 10
                   CONTROL ADD LABEL,    hDlg, %IDC_LABEL_URL, "URL:", 115, 7, 30, 10
                   CONTROL ADD LABEL,    hDlg, %IDC_LABEL_SITELINKS, "Site Links:", 5, 145, _
                       95, 10
                   CONTROL ADD LABEL,    hDlg, %IDC_LABEL_KEYWORDS, "Keywords:", 5, 55, 80, _
                       10
              
                   REDIM URLText(1 TO 14) AS GLOBAL STRING
              
                   URLText(1)="http://www.powerbasic.com/support/forums/ultimate.cgi"
                   LISTBOX ADD hDlg, %IDC_LISTBOX_LINKS, "PowerBASIC Forums"
              
                   URLText(2)="http://www.powerbasic.com/"
                   LISTBOX ADD hDlg, %IDC_LISTBOX_LINKS, "PowerBASIC Home Page"
              
                   URLText(3)="http://msdn.microsoft.com/library/default.asp"
                   LISTBOX ADD hDlg, %IDC_LISTBOX_LINKS, "MSDN Search"
              
                   URLText(4)="http://www.powerbasic.com/support/help/pbcc/"
                   LISTBOX ADD hDlg, %IDC_LISTBOX_LINKS, "Online PBCC Help"
              
                   URLText(5)="http://chrisboss.hypermart.net/cgi-bin/Ultimate.cgi"
                   LISTBOX ADD hDlg, %IDC_LISTBOX_LINKS, "EZGUI Forums"
              
                   URLText(6)="http://www.planetsquires.com/"
                   LISTBOX ADD hDlg, %IDC_LISTBOX_LINKS, "PlanetSquires"
              
                   URLText(7)="http://www.winprog.org/"
                   LISTBOX ADD hDlg, %IDC_LISTBOX_LINKS, "Win32 API Tutorial"
              
                   URLText(8)="http://www.wotsit.org/"
                   LISTBOX ADD hDlg, %IDC_LISTBOX_LINKS, "Wotsit.ORG"
              
                   URLText(9)="http://www.mentalis.org/"
                   LISTBOX ADD hDlg, %IDC_LISTBOX_LINKS, "AllAPI Network"
              
                   URLText(10)="http://www.hellobasic.com/"
                   LISTBOX ADD hDlg, %IDC_LISTBOX_LINKS, "Hello Basic"
              
                   URLText(11)="http://com.it-berater.org/"
                   LISTBOX ADD hDlg, %IDC_LISTBOX_LINKS, "Jose Roca Software"
              
                   URLText(12)="http://www.sqlite.org/"
                   LISTBOX ADD hDlg, %IDC_LISTBOX_LINKS, "SQLite"
              
                   URLText(13)="http://www.w3schools.com/sql/"
                   LISTBOX ADD hDlg, %IDC_LISTBOX_LINKS, "W3 Schools - SQL"
              
                   URLText(14)="http://www.trm-ug.com/"
                   LISTBOX ADD hDlg, %IDC_LISTBOX_LINKS, "Tsunami"
              
                   IF DIR$("sitelist.ini")="" THEN
                       REDIM PRESERVE URLText(1 TO 15) AS GLOBAL STRING
                       URLText(15)="http://www.google.com/"
                       LISTBOX ADD hDlg, %IDC_LISTBOX_LINKS, "Google"
                   ELSE
                       x=14
                       fnum=FREEFILE
                       OPEN "sitelist.ini" FOR INPUT ACCESS READ SHARED AS #fnum
                       WHILE NOT EOF(fnum)
                           LINE INPUT #fnum, filedata
                           IF TRIM$(filedata)<>"" THEN
                              IF INSTR(filedata,"%URLONLY%")<>0 THEN
                                  URLOnly=%TRUE
                                  filedata=REMOVE$(filedata,"%URLONLY%")
                              ELSE
                                  URLOnly=%FALSE
                              END IF
                              INCR x
                              REDIM PRESERVE URLText(1 TO x) AS GLOBAL STRING
                              URLText(x)=PARSE$(filedata,2)
                              IF INSTR(URLText(x),"%SEARCH%")<>0 THEN
                                  SearchDiff=REMAIN$(URLText(x),"%SEARCH%")
                                  URLText(x)=EXTRACT$(URLText(x),"%SEARCH%")
                                  NoTrim=%TRUE
                              ELSE
                                  NoTrim=%FALSE
                                  SearchDiff=URLText(x)
                              END IF
                              LISTBOX ADD hDlg, %IDC_LISTBOX_LINKS, PARSE$(filedata, 1)
                              IF ISFALSE(URLOnly) THEN
                                  temp=SearchDiff
                                  INCR ExtraList
                                  REDIM PRESERVE SearchData(1 TO ExtraList) AS GLOBAL STRING
                                  REDIM PRESERVE SearchDesc(1 TO ExtraList) AS GLOBAL STRING
                                  IF INSTR(temp,"http://")<>0 AND ISFALSE(NoTrim) THEN
                                      temp=REMAIN$(temp,"http://")
                                      IF TALLY(temp,"/")=1 AND RIGHT$(temp,1)="/" THEN
                                          temp=RTRIM$(temp, "/")
                                      END IF
                                  END IF
                                  SearchData(ExtraList)="site:"+temp
                                  SearchDesc(ExtraList)=PARSE$(filedata,1)
                              END IF
                           END IF
                       WEND
                       INCR x
                       REDIM PRESERVE URLText(1 TO x)
                       URLText(x)="http://www.google.com/"
                       LISTBOX ADD hDlg, %IDC_LISTBOX_LINKS, "Google"
                   END IF
              
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_SITE, "PowerBASIC"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_SITE, "MSDN"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_SITE, "EZGUI"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_SITE, "PlanetSquires"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_SITE, "Win32 API Tutorial"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_SITE, "Wotsit.ORG"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_SITE, "AllAPI Network"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_SITE, "Hello Basic"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_SITE, "Jose Roca Software"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_SITE, "SQLite"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_SITE, "SQL"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_SITE, "Tsunami"
                   IF ExtraList>0 THEN
                       FOR x=1 TO ExtraList
                           COMBOBOX ADD hDlg, %IDC_COMBOBOX_SITE, SearchDesc(x)
                       NEXT
                   END IF
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_SITE, "Web"
              
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_CATEGORY, "All Forums"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_CATEGORY, "Product Announcements"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_CATEGORY, "FAQ"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_CATEGORY, "PowerBase"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_CATEGORY, "PowerBASIC CC"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_CATEGORY, "PowerBASIC for DOS"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_CATEGORY, "PowerBASIC for Windows"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_CATEGORY, "Programming"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_CATEGORY, "Programming the Internet"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_CATEGORY, "Source Code"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_CATEGORY, "Third Party Add-Ons"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_CATEGORY, "Positions Wanted/Offered"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_CATEGORY, "Cafe PowerBASIC"
                   COMBOBOX ADD hDlg, %IDC_COMBOBOX_CATEGORY, "Online PBCC Help"
              
                   COMBOBOX SELECT hDlg, %IDC_COMBOBOX_SITE, 1
                   COMBOBOX SELECT hDlg, %IDC_COMBOBOX_CATEGORY, 1
              
                   SetProp GetDlgItem(hDlg, %IDC_TEXTBOX_URL), "OldProc", SetWindowLong(GetDlgItem(hDlg, %IDC_TEXTBOX_URL), %GWL_WNDPROC, CODEPTR(URLSubclass))
                   SetProp GetDlgItem(hDlg, %IDC_TEXTBOX_KEYWORDS), "OldProc", SetWindowLong(GetDlgItem(hDlg, %IDC_TEXTBOX_KEYWORDS), %GWL_WNDPROC, CODEPTR(KEYWSubclass))
              
                   hWndSB=GetDlgItem(hDlg, %IDC_MSCTLS_STATUSBAR32_1)
              
                   LOCAL szBuf AS ASCIIZ*10
                   szBuf=""
                   SendMessage hWndSB, %WM_SETTEXT, 0, VARPTR(szBuf)
              
                   AtlAxGetControl(hOcx, pUnk)
                   AtlMakeDispatch(pUnk, vVar)
                   SET oOcx = vVar
              
                   '// Subscribe to the WebBroser events
                   hr = ShellWebBrowser_SetEvents(OBJPTR(oOcx), dwCookie)
              
                   DIALOG SHOW MODELESS hDlg, CALL MainDlgProc TO hr
              
                   CALL NavigateURL("http://www.powerbasic.com/support/forums/ultimate.cgi")
              
                   WHILE GetMessage(uMsg, %NULL, 0, 0) AND IsWindow(hDlg)
                      '// Pass keyboard messages to the ancestor
                      '// Returns 0 if the message was not processed, nonzero if it was
                      IF WebBrowser_TranslateMessage(hDlg, uMsg) = 0 THEN
                         IF IsDialogMessage(hDlg, uMsg) = %FALSE THEN
                            TranslateMessage uMsg
                            DispatchMessage uMsg
                         END IF
                      END IF
                   WEND
              
                   ' // Unsubscribe from the WebBrowser events
                   hr = ShellWebBrowser_ReleaseEvents(OBJPTR(oOcx), dwCookie)
              
                   AtlAxWinTerm   ' // Uninitializes ATL
                   SET oOcx = NOTHING
              
                END FUNCTION
              ' *********************************************************************************************
              
              SUB NavigateURL(strURL AS STRING)
              
                  LOCAL vVar AS VARIANT
                  vVar=strURL
              
                  OBJECT CALL oOcx.Navigate(vVar)
              
              END SUB
              
              ' *********************************************************************************************
              
              FUNCTION KEYWSubclass(BYVAL hWnd AS LONG, BYVAL wMsg AS LONG, BYVAL wParam AS LONG, BYVAL lParam AS LONG) AS LONG
              
                  LOCAL OldProc   AS LONG
                  LOCAL ptMsg     AS TAGMSG PTR
              
                  OldProc=GetProp(hWnd, "OldProc")
              
                  SELECT CASE wMsg
                      CASE %WM_GETDLGCODE
                          IF lParam THEN
                              ptMsg=lParam
                              IF @ptMsg.message=%WM_KEYDOWN AND @ptMsg.wParam=%VK_RETURN THEN
                                  FUNCTION=%DLGC_WANTMESSAGE
                                  EXIT FUNCTION
                              END IF
                          END IF
                      CASE %WM_KEYDOWN
                          IF wParam=%VK_RETURN THEN
                              PostMessage hDlg, %WM_COMMAND, MAKLNG(%IDC_BUTTON_SEARCH, %BN_CLICKED), 0
                              EXIT FUNCTION
                          END IF
                      CASE %WM_CHAR
                          IF wParam=%VK_RETURN THEN
                              EXIT FUNCTION
                          END IF
                      CASE %WM_DESTROY
                          RemoveProp hWnd, "OldProc"
                          SetWindowLong hWnd, %GWL_WNDPROC, OldProc
                  END SELECT
              
                  FUNCTION=CallWindowProc(OldProc, hWnd, wMsg, wParam, lParam)
              
              END FUNCTION
              
              ' *********************************************************************************************
              
              FUNCTION URLSubclass(BYVAL hWnd AS LONG, BYVAL wMsg AS LONG, BYVAL wParam AS LONG, BYVAL lParam AS LONG) AS LONG
              
                  LOCAL OldProc   AS LONG
                  LOCAL ptMsg     AS TAGMSG PTR
              
                  OldProc=GetProp(hWnd, "OldProc")
              
                  SELECT CASE wMsg
                      CASE %WM_GETDLGCODE
                          IF lParam THEN
                              ptMsg=lParam
                              IF @ptMsg.message=%WM_KEYDOWN AND @ptMsg.wParam=%VK_RETURN THEN
                                  FUNCTION=%DLGC_WANTMESSAGE
                                  EXIT FUNCTION
                              END IF
                          END IF
                      CASE %WM_KEYDOWN
                          IF wParam=%VK_RETURN THEN
                              PostMessage hDlg, %WM_COMMAND, MAKLNG(%IDC_BUTTON_NAVIGATE, %BN_CLICKED), 0
                              EXIT FUNCTION
                          END IF
                      CASE %WM_CHAR
                          IF wParam=%VK_RETURN THEN
                              EXIT FUNCTION
                          END IF
                      CASE %WM_DESTROY
                          RemoveProp hWnd, "OldProc"
                          SetWindowLong hWnd, %GWL_WNDPROC, OldProc
                  END SELECT
              
                  FUNCTION=CallWindowProc(OldProc, hWnd, wMsg, wParam, lParam)
              
              END FUNCTION
              
              ' *********************************************************************************************
              Adam Drake
              Drake Software

              Comment


              • #8
                John,

                Apart from some cosmetics - case & white spacing etc - the code in post #1 comprises the first 730 or so lines of the 1890 or so lines in the zipped file
                Rgds, Dave

                Comment


                • #9
                  Dave Biggs - I didn't catch that you had reposted my code as it was above - got an error downloading (may not have been logged in first) - which is why I reposted.
                  Adam Drake
                  Drake Software

                  Comment


                  • #10
                    Hi Adam,

                    No worries. I made the following changes to work around the newer Type assignments so that it compiles ok in PBWin10.
                    (- Didn't make any changes to outdated URLs in the app yet..)
                    Code:
                    ' ..
                    ' PrivacyImpactedStateChange              DispId: &H00000110 (272)
                    
                    UNION VARIANTDATA_
                      bVal AS BYTE            ' VT_UI1
                      iVal AS INTEGER         ' VT_I2
                      lVal AS LONG            ' VT_I4
                      fltVal AS SINGLE        ' VT_R4
                      dblVal AS DOUBLE        ' VT_R8
                      boolVal AS INTEGER      ' VT_BOOL
                      scode AS LONG           ' VT_ERROR
                      cyVal AS LONG           ' VT_CY
                      date AS DOUBLE          ' VT_DATE
                      bstrVal AS LONG         ' VT_BSTR
                      punkVal AS DWORD        ' VT_UNKNOWN
                      pdispVal AS DWORD       ' VT_DISPATCH
                      parray AS DWORD         ' VT_ARRAY|*
                      pbVal AS BYTE PTR       ' VT_BYREF|VT_UI1
                      piVal AS INTEGER PTR    ' VT_BYREF|VT_I2
                      plVal AS LONG PTR       ' VT_BYREF|VT_I4
                      pfltVal AS SINGLE PTR   ' VT_BYREF|VT_R4
                      pdblVal AS DOUBLE PTR   ' VT_BYREF|VT_R8
                      pboolVal AS INTEGER PTR ' VT_BYREF|VT_BOOL
                      pscode AS LONG PTR      ' VT_BYREF|VT_ERROR
                      pcyVal AS LONG PTR      ' VT_BYREF|VT_CY
                      pdate AS DOUBLE PTR     ' VT_BYREF|VT_DATE
                      pbstrVal AS LONG PTR    ' VT_BYREF|VT_BSTR
                      ppunkVal AS DWORD PTR   ' VT_BYREF|VT_UNKNOWN
                      ppdispVal AS DWORD PTR  ' VT_BYREF|VT_DISPATCH
                      psArray AS DWORD PTR    ' VT_ARRAY|*
                      pVariant AS DWORD PTR   ' VT_BYREF|VT_VARIANT
                      pByRef AS DWORD         ' Generic ByRef
                    END UNION
                    
                    TYPE VARIANTAPI_
                      vt         AS WORD  'VARTYPE
                      wReserved1 AS WORD
                      wReserved2 AS WORD
                      wReserved3 AS WORD
                      vd         AS VARIANTDATA_
                    END TYPE
                    
                    ' --------------------------------------------------------------------------------------------
                    ' EXCEPINFO structure
                    ' --------------------------------------------------------------------------------------------
                      TYPE EXCEPINFO_
                         wCode AS WORD               ' // An error code describing the error.
                         wReserved AS WORD
                         bstrSource AS DWORD         ' // Source of the exception.
                         bstrDescription AS DWORD    ' // Textual description of the error.
                         bstrHelpFile AS DWORD       ' // Help file path.
                         dwHelpContext AS DWORD      ' // Help context ID.
                         pvReserved AS DWORD
                         pfnDeferredFillIn AS DWORD  ' // Pointer to a function that takes an EXCEPINFO structure as an argument and returns an HRESULT value.
                         scode AS DWORD              ' // A return value describing the error.
                      END TYPE
                    
                    ' --------------------------------------------------------------------------------------------
                    ' IDispatchVTable
                    '.
                    '.
                    
                      FUNCTION ShellWebBrowser_IDispatch_Invoke (BYVAL pUnk AS DWORD, BYVAL dispidMember AS LONG, BYREF riid AS GUID, _
                      BYVAL lcid AS DWORD, BYVAL wFlags AS WORD, BYREF pdispparams AS DISPPARAMS, BYREF pvarResult AS VARIANT, _
                      BYREF pexcepinfo AS EXCEPINFO_, BYREF puArgErr AS DWORD) AS DWORD                               ' << EXCEPINFO_
                    
                    '.
                    ' *********************************************************************************************
                    ' Puts the address of an object in a variant and marks it as containing a dispatch variable
                    ' *********************************************************************************************
                      SUB AtlMakeDispatch ( _
                         BYVAL lpObj AS DWORD, _                        ' Address of the object instance
                         BYREF vObj AS VARIANT _                        ' Variant to contain this address
                         ) EXPORT
                         LOCAL lpvObj AS VARIANTAPI_ PTR                 ' Pointer to a VARIANTAPI structure          ' << VARIANTAPI_
                         LET vObj = EMPTY                               ' Make sure is empty to avoid memory leaks
                         lpvObj = VARPTR(vObj)                          ' Get the VARIANT address
                         @lpvObj.vt = %VT_DISPATCH                      ' Mark it as containing a dispatch variable
                         @lpvObj.vd.pdispVal = lpObj                    ' Set the dispatch pointer address
                         IUnknown_AddRef lpObj                          ' Increase the reference count
                      END SUB
                    ' *********************************************************************************************
                    ' *********************************************************************************************
                    Rgds, Dave

                    Comment


                    • #11
                      Hi Adam
                      What does this code do? it does look interesting and probably you can compile it and show a screenshot of what it does

                      Comment


                      • #12
                        It was just a collection of links that used the Web Browser control to try to have them all in a PB App, also tried to facilitate making a quick google search of the forum (at the time the forum search engine wasn't even half as good as it is now). Half of the old links are dead - like "wotsit" - you can see what it was here: https://web.archive.org/web/20070225...ww.wotsit.org/ - I might could re-create the app simply as a "toolbar" that would launch any links or searches you wanted since there have been so many language changes since I originally posted it.

                        Here's a screenshot of it compiled:

                        Click image for larger version

Name:	powerboogle.png
Views:	145
Size:	49.2 KB
ID:	778338
                        Adam Drake
                        Drake Software

                        Comment


                        • #13
                          Thanks for the newer postings! I'm looking forward to a couple of study/play sessions with it this week.
                          -John

                          Comment

                          Working...
                          X