Click here to Skip to main content
Licence 
First Posted 3 Mar 2001
Views 146,091
Bookmarked 54 times

Cookie Spy

By | 10 Oct 2001 | Article
Creating a CookieSpy explorer bar with ATL
  • Download source files - 44 Kb
  • Download dll - 64 Kb
  • Sample Image - CookieSpy.gif

    Introduction

    CookieSpy is a custom explorer bar. This extension was created for the monitoring of cookie activity and for the possibility to add and edit cookies. I used VC++ 6.0 (SP4) and ATL.

    Implementation.

    1. At first, every IE band object must implement a couple interfaces:
    - IDeskBand
    - IObjectWithSite
    I wrote a template class DeskBandImpl<> to implement all the IE necessary routines.

    2. Second, the band object must add to the registry the appropriate records to the "Component Categories" hive. I registered for CATID_InfoBand and CATID_CommBand categories. Certainly, you can use only one placement for band: vertical or horizontal at the same time.

    3. Next, when IE calls IObjectWithSite::SetSite method, the main objectives are:
    - to create a band window.
    - to advise DWebBrowserEvents2 event sink interface for receiving event notifications from a explorer

    4. CookieSpy::OnCreate method objectives:
    - to create MSHTML control for displaying HTML page from resource
    - to set external dispatch

    5. By processing events: BeforeNavigate2, DocumentComplete, NavigateComplete2, I try to update the cookie's information for the current document:
    - to parse cookie string
    - to update a main html page

    Cookie Edit Dialog

    6. Also the user can add and edit the cookie. If the cookie was stored on the hard disc, I try to find the cookie's file in cookie's folder for determining a expire date and domain\path info otherwise (in case lack of such file) I suggest that it's the session cookie. Then with help InternetSetCookie API I create a cookie for the specified URL.

    Environment.

    I tested this band under Win2k and IE 5.0 only

    Acknowledgments.

    Thanks a Neeraj Srivastava for his article "Implementing Web Browser Band Using ATL HTML Control"

    History

    12 Oct 2001 - New download files: These solve trouble with IE.5.5\6.0 and CookieSpy plug-ins.

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

    About the Author

    Konstantin Boukreev

    Web Developer

    Russian Federation Russian Federation

    Member

    I am freelance programmer. About 3 years of experience in C++ and I would rather use ATL, STL, WTL but not MFC Smile | :) . Main backgrounds are Win32 API, COM and Networking. Now I am interested about AI (Neural Network, Fuzzy Logic and GA). Currently based in Vladivostok, Russia.

    Sign Up to vote   Poor Excellent
    Add a reason or comment to your vote: x
    Votes of 3 or less require a comment

    Comments and Discussions

     
    You must Sign In to use this message board. (secure sign-in)
     
    Search this forum  
     FAQ
        Noise  Layout  Per page   
      Refresh
    QuestionAutomate View - > Explorer Bars - > Cookie Spy Pinmembervikrant kpr11:51 4 Sep '07  
    GeneralExport the method of the IeExtension.dll for another application PinmemberVincenzo Carnuccio21:10 15 Nov '04  
    GeneralPane is not scrollable PinsussAnonymous10:53 4 Nov '04  
    GeneralRe: Pane is not scrollable PinsussKamalPulsamy18:23 15 Dec '04  
    QuestionCompile error - what to download ? PinmemberLed12:21 16 Sep '03  
    AnswerRe: Compile error - what to download ? PinsussVincenzoCarnuccio4:25 4 Nov '04  
    AnswerRe: Compile error - what to download ? Pinmemberhacker121115:23 16 Oct '08  
    Generalhere is my simple read only spy! PinmemberAnonymous17:05 11 Oct '01  
    GeneralRe: here is my simple read only spy! PinmemberAlvaro Mendez4:56 15 Oct '01  
    GeneralRe: here is my simple read only spy! PinmemberAnonymous19:45 9 Nov '01  
    GeneralRe: here is my simple read only spy! PinsussAnonymous0:03 9 Oct '02  
    GeneralRe: here is my simple read only spy! Pinmemberzichun21:35 24 Oct '03  
    GeneralRe: here is my simple read only spy! Pinmembersori507812:32 28 Jan '10  
    GeneralRe: here is my simple read only spy! PinmemberBilal Ahmed15:14 20 Aug '03  
    GeneralDoes not work with French IE5.5SP1 PinmemberSoftLion3:41 6 Mar '01  
    Mad | :mad:
    Each time the pane is shown, it complains:
    Line: 9
    Error: Incorrect argument or procedure call: Left
     
    the line is in the VBScript:
    theBody.background = Left(s, n - 1) + "/RT_JPEG/#201"
     
    Mad | :mad:

    GeneralRe: Does not work with French IE5.5SP1 PinmemberAnonymous8:31 9 Apr '01  
    GeneralRe: Does not work with French IE5.5SP1 PinmemberAnonymous8:34 9 Apr '01  
    GeneralRe: Does not work with French IE5.5SP1 PinmemberKonstantin Boukreev19:18 9 Oct '01  
    GeneralDoes not work with English IE 5.5 PinmemberMario M.5:23 5 Mar '01  
    GeneralDoes not work with English IE 5.5 PinmemberMario M.5:22 5 Mar '01  
    GeneralRe: Does not work with English IE 5.5 PinmemberKonstantin Boukreev19:16 9 Oct '01  
    GeneralInstalling the Plugin PinmemberGoran Lastro0:12 5 Mar '01  
    GeneralRe: Installing the Plugin PinmemberTom Wellige2:58 5 Mar '01  
    GeneralRe: Installing the Plugin PinmemberAnonymous10:51 6 Mar '01  
    GeneralRe: Installing the Plugin Pinmembersas13:09 28 Mar '01  

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

    Permalink | Advertise | Privacy | Mobile
    Web02 | 2.5.120529.1 | Last Updated 11 Oct 2001
    Article Copyright 2001 by Konstantin Boukreev
    Everything else Copyright © CodeProject, 1999-2012
    Terms of Use
    Layout: fixed | fluid