Click here to Skip to main content
13,356,787 members (60,954 online)
Click here to Skip to main content
Add your own
alternative version


61 bookmarked
Posted 3 Mar 2001

Cookie Spy

, 10 Oct 2001
Rate this:
Please Sign up or sign in to vote.
Creating a CookieSpy explorer bar with ATL
<!-- Download Links -->
  • Download source files - 44 Kb
  • Download dll - 64 Kb
  • <!-- Article image -->

    Sample Image - CookieSpy.gif

    <!-- Main HTML starts here -->


    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.


    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.


    I tested this band under Win2k and IE 5.0 only


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


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


    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
    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.

    You may also be interested in...

    Comments and Discussions

    QuestionAutomate View - > Explorer Bars - > Cookie Spy Pin
    vikrant kpr4-Sep-07 12:51
    membervikrant kpr4-Sep-07 12:51 
    GeneralExport the method of the IeExtension.dll for another application Pin
    Vincenzo Carnuccio15-Nov-04 22:10
    memberVincenzo Carnuccio15-Nov-04 22:10 
    GeneralPane is not scrollable Pin
    Anonymous4-Nov-04 11:53
    sussAnonymous4-Nov-04 11:53 
    GeneralRe: Pane is not scrollable Pin
    KamalPulsamy15-Dec-04 19:23
    sussKamalPulsamy15-Dec-04 19:23 
    QuestionCompile error - what to download ? Pin
    Led16-Sep-03 13:21
    memberLed16-Sep-03 13:21 
    AnswerRe: Compile error - what to download ? Pin
    VincenzoCarnuccio4-Nov-04 5:25
    sussVincenzoCarnuccio4-Nov-04 5:25 
    AnswerRe: Compile error - what to download ? Pin
    hacker121116-Oct-08 16:23
    memberhacker121116-Oct-08 16:23 
    Generalhere is my simple read only spy! Pin
    Anonymous11-Oct-01 18:05
    memberAnonymous11-Oct-01 18:05 
    make a new shortcut on your desktop...

    for the location of the item...put:


    click next...give it a name... click ok. now right click on your new shortcut... properties... remove the "http://" from the front and the "/" from the end... which now leaves:


    Click ok or apply... you get error "The protocol "javascript" does not have a registered program, do you want to keep this target anyway?" click yes.
    now go to a or somthn... and drag your new shortcut onto the browser window.... viola! MUAHAHAH
    Eek! | :eek:

    David Eschmeyer ....
    See one of my databases featured on CNN!
    Hire me! hehe.
    GeneralRe: here is my simple read only spy! Pin
    Alvaro Mendez15-Oct-01 5:56
    memberAlvaro Mendez15-Oct-01 5:56 
    GeneralRe: here is my simple read only spy! Pin
    Anonymous9-Nov-01 20:45
    memberAnonymous9-Nov-01 20:45 
    GeneralRe: here is my simple read only spy! Pin
    Anonymous9-Oct-02 1:03
    sussAnonymous9-Oct-02 1:03 
    GeneralRe: here is my simple read only spy! Pin
    zichun24-Oct-03 22:35
    memberzichun24-Oct-03 22:35 
    GeneralRe: here is my simple read only spy! Pin
    sori507828-Jan-10 13:32
    membersori507828-Jan-10 13:32 
    GeneralRe: here is my simple read only spy! Pin
    Bilal Ahmed20-Aug-03 16:14
    memberBilal Ahmed20-Aug-03 16:14 
    GeneralDoes not work with French IE5.5SP1 Pin
    SoftLion6-Mar-01 4:41
    memberSoftLion6-Mar-01 4:41 
    GeneralRe: Does not work with French IE5.5SP1 Pin
    Anonymous9-Apr-01 9:31
    memberAnonymous9-Apr-01 9:31 
    GeneralRe: Does not work with French IE5.5SP1 Pin
    Anonymous9-Apr-01 9:34
    memberAnonymous9-Apr-01 9:34 
    GeneralRe: Does not work with French IE5.5SP1 Pin
    Konstantin Boukreev9-Oct-01 20:18
    memberKonstantin Boukreev9-Oct-01 20:18 
    GeneralDoes not work with English IE 5.5 Pin
    Mario M.5-Mar-01 6:23
    memberMario M.5-Mar-01 6:23 
    GeneralDoes not work with English IE 5.5 Pin
    Mario M.5-Mar-01 6:22
    memberMario M.5-Mar-01 6:22 
    GeneralRe: Does not work with English IE 5.5 Pin
    Konstantin Boukreev9-Oct-01 20:16
    memberKonstantin Boukreev9-Oct-01 20:16 
    GeneralInstalling the Plugin Pin
    Goran Lastro5-Mar-01 1:12
    memberGoran Lastro5-Mar-01 1:12 
    GeneralRe: Installing the Plugin Pin
    Tom Wellige5-Mar-01 3:58
    memberTom Wellige5-Mar-01 3:58 
    GeneralRe: Installing the Plugin Pin
    Anonymous6-Mar-01 11:51
    memberAnonymous6-Mar-01 11:51 
    GeneralRe: Installing the Plugin Pin
    sas28-Mar-01 14:09
    membersas28-Mar-01 14:09 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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 | Terms of Use | Mobile
    Web01 | 2.8.180111.1 | Last Updated 11 Oct 2001
    Article Copyright 2001 by Konstantin Boukreev
    Everything else Copyright © CodeProject, 1999-2018
    Layout: fixed | fluid