Contents - Index - Top


OnGetCookieList

Interface AntViewCookieManager

 

Type: Event

Parameters: Int HResult AntViewCookieList Args

Returns: None

 

 

Returns the cookies as a AntViewCookieList object queried via the GetCookies method.

 

An example of how that looks like in VB6 follows:

 

Option Explicit

 

Public WithEvents CookieManager As AntviewAx2.AntViewCookieManager

 

Private Sub CookieButton_Click()

 ' click

  Set CookieManager = EdgeWebBrowser.CookieManager

  CookieManager.GetCookies EdgeWebBrowser.Source

End Sub

 

Private Sub CookieManager_OnGetCookieList(ByVal HResult As Long, ByVal Args As AntviewAx2.IAntViewCookieList)

  Dim ndx As Integer

  Dim Cookie As AntviewAx2.AntViewCookie

  

  If HResult = 0 Then

    If Args.Count > 0 Then

    For ndx = 0 To (Args.Count - 1)

      Set Cookie = Args.ValueAtIndex(ndx)

      If (Cookie.Name <> "") Then

        MsgBox "name " & Cookie.Name & " = " & Cookie.Value, vbOKOnly, "Cookie " & CStr(ndx M 1) & " of " & CStr(Args.Count)

      End If

    Next

    Else

      MsgBox "No Cookies have been set for this site.", vbOKOnly, "Cookies"

    End If

  End If

End Sub

 

 

So in summary, you have to first create an object called CookieManager based on the AntViewCookiemanager interface.

 

Once you want to use that, assign the WebBrowser object IDispatch pointer of the cookiemanager to the CookieManager object and invoke the GetCookies method with the URL from the currently browsed page.

 

The OnGetCookieList event from the CookieManager object is where you can enumerate the cookies.

The Args parameter contains a AntViewCookieList object that has a list with all the cookies.

 

Introduced in AntView release 1.1.270

 


AntView - The MS Edge WebView2 ActiveX control Date last changed: 04/16/2025