Internet Explorer Pager Control

Environment: VC6

Hi, I was 14 years old when I wrote this control (almost when it came up to IE5.5) when I saw it for first time I said to myself: "I will make my own" because:

  1. I like it
  2. I haven't been able to find it.
That is the story of the control.

How to Use:

1. Projects->Add to Project->Files->SpawnFrameWnd.h/.cpp;IEPagerCtrl.h/.cpp;MenuSpawn.h/.cpp

2. MainFrm.h changes:

#include "IEPagerCtrl.h"
#include "SpawnFrameWnd.h"
----------------------------------------------------
//General message map functions
protected:
//AFX_MSG(CMainFrame)
//add this:
  afx_msg void OnArrow();
-----------------------------------------------------
  • Replace "CFrameWnd" with "CSpawnFrameWnd"
  • Replace "CToolBar m_wndToolBar" with "CIEPagerCtrl m_wndToolBar"

3. View->Resource Symbols->New->Name: ID_ARROW -> OK

4. MainFrm.cpp changes:

BEGIN _MESSAGE_MAP(........)
  ON_COMMAND(ID_ARROW, OnArrow)
  .
  .
  .
  .
  .

5. Replace "CFrameWnd" with "CSpawnFrameWnd"(everywhere, try with replace action from the edit menu and replace all)

6. Add message handler to WM_SIZE, and add this code to the message.
Replace the OnSize with that:

void CMainFrame::OnSize(UINT nType, int cx, int cy) 
{
  if ( nType == SIZE_MINIMIZED )
  {
     cx1 = cx;cy1 = cy;
  }
  else
  if ( nType == SIZE_RESTORED && cx1 != 0 && cy1 != 0)
  {
     m_wndToolBar.SetSize(cx1);
  }

  m_wndToolBar.SetSize(cx);
  Invalidate();
  CSpawnFrameWnd::OnSize(nType, cx, cy);
}

and then add that before it: "int cx1 = 0,cy1 = 0;" as global variables.

7. Add this source code to the MainFrm.cpp

void CMainFrame::OnArrow() 
{
  HMENU lMenu;
  CPoint pPoint;
  lMenu = ::CreatePopupMenu();
  if ( lMenu != NULL )
  {
    BUTTONSINFO butInfo[100];
    int nButtons = 
          m_wndToolBar.GetHiddenButtonsInfo ( butInfo );
    for ( int i = 0; i < nButtons; i++ )
    {
      if ( butInfo[i].nStyle == TBSTYLE_SEP &&
        i == 0 ) {}
      else
        ::AppendMenu(lMenu, MF_ENABLED | MF_STRING ,
                     butInfo[i].nID,
                     butInfo[i].strToolTip );
    }
    CMenu *pMenu;
    pMenu = pMenu->FromHandle ( lMenu );
    CRect rect;	
    m_wndToolBar.GetToolBarCtrl().GetRect(ID_ARROW , &rect);
    m_wndToolBar.ClientToScreen(&rect);
    m_wndToolBar.GetToolBarCtrl().PressButton( ID_ARROW );
    pMenu->TrackPopupMenu ( TPM_LEFTBUTTON,
                            rect.left,
                            rect.bottom,
                            this,
                            NULL );
    m_wndToolBar.GetToolBarCtrl().PressButton( ID_ARROW,
                                               FALSE );
  }
  else
    TRACE0("ERROR: lMenu = NULL");
}

8. Add this source code to the CMainFrame construction:

cSpawn.LoadToolBarResource( IDR_MAINFRAME );

9. Add the bitmaps IDB_ARROW and IDB_MENUCHK

That's it!!!

Special thanks for the Spawn class - it gives me the ability of settings bitmaps for the Menus!!! I hope you like what I did!

Downloads

Download Demo Project - 59.9 Kb
Download Source Code - 10.5 Kb


Comments

  • it is very good

    Posted by lupy on 05/16/2006 09:16pm

    good code,thank you

    Reply
  • Why not use a Rebar, that has the chevron (>>) functionality

    Posted by Legacy on 01/21/2002 12:00am

    Originally posted by: John Smith

    So my question is

    Why not use a Rebar, that has the chevron (>>) functionality ?

    Why re-invent the wheel ?

    By the way (the arrows >>) are called chevrons !!!!

    Reply
  • What is this!

    Posted by Legacy on 01/18/2002 12:00am

    Originally posted by: h.s jang

    I can't understand this program..

    Reply
  • Good Job!

    Posted by Legacy on 01/17/2002 12:00am

    Originally posted by: Brian


    Thanks.

    Bri

    Reply
  • Another project made of myself .... WindowsManager

    Posted by Legacy on 01/17/2002 12:00am

    Originally posted by: Svetosav Chakaroff

    Hi, i got a Windows Manager, which i made, tell me if there is some interest to post it here in code guru...

    Reply
  • Not a pager

    Posted by Legacy on 01/17/2002 12:00am

    Originally posted by: Le Ridder Noir

    This is not a pager control, it's just a chevron a pager is something else see:

    http://www.codeproject.com/miscctrl/controls_pager.asp

    Reply
  • um, wtf does this do?

    Posted by Legacy on 01/16/2002 12:00am

    Originally posted by: uhh

    it doesn't do anything.........


    downloaded the demo project, it's just an empty MFC shell..

    Reply
  • Was also wondering what was "new" and how it related to IE.

    Posted by Legacy on 01/16/2002 12:00am

    Originally posted by: Steve

    You may want to explain what an "Internet Explorer Pager Control" is and how your program provides the same functionality.

    The graphic of your program does not look much different than many other programs. I could not find anything "new" just by looking at it. You may want to point out the >> in the upper right corner of the toolbar works the same as IE. Many programs use the >> in their toolbars, not just IE.

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: May 11, 2015 @ 1:00 p.m. ET / 10:00 a.m. PT One of the languages that have always been supported with the Intel® RealSense™ SDK (Software Developer Kit) is JavaScript, specifically so that web-enabled apps could be created. Come hear from Intel Expert Bob Duffy as he reviews his own little "space shooting" game where the orientation of your face controls the aiming reticle to help teach developers how to write apps and games in JavaScript that can use facial and gesture …

  • Several technologies are driving big changes at federal agencies, but at the forefront is cloud computing. Cloud -- the use of remote, Internet-hosted servers for storing, managing and processing data in place of on-site technology -- is helping along technologies such as those related to collaboration and enabling new ones, such as the analysis of Big Data. Cloud is complicated but also growing in importance at federal agencies. Read this technology article to learn how governmental entities are creating a …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date