Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

RSS Reader Plug-in for Internet Explorer

, 17 Jul 2007 CPOL
This is a toolbar for the Internet Explorer which shows information from RSS taken from the Internet.
rssreader_exe.zip
Setup.exe
rssreader_src.zip
RssReader_src
RRPRssFetcher
RRPRssFetcher
res
RRPRssFetcher.ico
toolbar.bmp
RRPRssFetcher.vcproj.TEKAWADE.Prafulla V Tekawade.user
RSSReaderplugin
Debug
res
RssReaderPlugin.dll.manifest
RRPComInterfaceImplementor.rgs
RssReaderPlugin.aps
RssReaderPlugin.def
RssReaderPlugin.dsp
RssReaderPlugin.dsw
RssReaderPlugin.opt
RssReaderPlugin.plg
RssReaderPlugin.tlb
RssReaderPlugin.vcproj.TEKAWADE.Prafulla V Tekawade.user
RssReaderPluginps.def
RssReaderPluginps.mk
Setup.iss
/*
	Project		: RSS Reader plugin for Internet Explorer	
	File name	: RRPToolbar.h
	Date		: 
	Purpose		: This is the actula toolbar class,provides interface for creation 
				  of toolbar,It handles or forwardes all important window messages
				  related to this perticulare project
	Note		: This file was created using the CWindowImpl ATL Object Wizard
	Send comments 
	or Bugs to	: prafulla_t@users.sourceforge.net
*/


#pragma once


#include "StdAfx.h"
#include <vector>

#include <commctrl.h>
#include <atlctrls.h>

#include "RRPConfigurationManager.h"
#include "RRPDebugInfoLogger.h"
#include "RRPMenuTooltip.h"
#include "RRPNewsButton.h"
#include "RRPRssFetcher.h"
#include "Resource.h"
class RRPConfigurationManager;

#define RRP_RSSFETCH WM_USER + 10
#define RRP_FETCHCOMPLETE WM_USER + 11
#define RRP_REFRESH WM_USER + 12
#define RRP_REMOVE WM_USER + 13
#define RRP_TOOLBAR_REG WM_USER + 14
#define RRP_TOOLBAR_UNREG WM_USER + 15
#define RRP_FETCHER_PROCESS_BUSY WM_USER + 16
#define RRP_FETCHER_PROCESS_FREE WM_USER + 17
#define RRP_CLEAN WM_USER + 18



/////////////////////////////////////////////////////////////////////////////
// RRPToolbar
class RRPToolbar : public CWindowImpl<RRPToolbar, CToolBarCtrl> {
public:
	DECLARE_WND_SUPERCLASS("RRPToolbar Class", TOOLBARCLASSNAME)
	BEGIN_MSG_MAP(RRPToolbar)
		COMMAND_ID_HANDLER(ID_NEWS_FOOTER,OnNewsFooterClick)
		COMMAND_RANGE_HANDLER(ID_NEWS_ITEM_START,ID_NEWS_ITEM_START+100,OnMenuClick);
		OCM_COMMAND_ID_HANDLER(ID_CONFIG,OnConfig)
		OCM_NOTIFY_CODE_HANDLER(TBN_DROPDOWN, OnToolbarDropDown)
		MESSAGE_HANDLER(RRP_FETCHCOMPLETE,OnFetchComplete)
		MESSAGE_HANDLER(RRP_FETCHER_PROCESS_BUSY,OnProcessBusy)
		MESSAGE_HANDLER(RRP_FETCHER_PROCESS_FREE,OnProcessFree)
		MESSAGE_HANDLER(WM_DRAWITEM,OnDrawItem)                   
		MESSAGE_HANDLER(WM_MENUSELECT,OnMenuSelect)
		MESSAGE_HANDLER(WM_MEASUREITEM,OnMeasureItem)
		MESSAGE_HANDLER(WM_INITMENUPOPUP,OnMenuPopup)
		MESSAGE_HANDLER(WM_TIMER,OnTimer)
	END_MSG_MAP()

// Handler prototypes:
//  LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
//  LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
//  LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
	RRPToolbar(void);
	virtual ~RRPToolbar(void);

	HWND createToolbar(HWND parentWindowHadle,RECT area);
	LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	void changeButtonCaption(int nID,char * str,DWORD dwMask = TBIF_TEXT);
	void createButton();
	void addButton(int buttonIndex);
	void removeButton(unsigned int buttonIndex);

	LRESULT OnButtonClick(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT OnConfig(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnToolbarDropDown(int idCtrl, LPNMHDR pnmh, BOOL& bHandled)	;
	LRESULT OnDrawItem(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT OnMeasureItem(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT	OnNewsFooterClick(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT	OnMenuClick(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
	LRESULT	OnMenuPopup(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	LRESULT	OnMenuSelect(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
	void setBusyFlag(bool flag) {
		fetcherProcessBusy = flag;
	}
	
	BOOL isRssFetcherProcessBusy() {
		return fetcherProcessBusy;
	}

	//Busy signal received from the process
	LRESULT OnProcessBusy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) {
		fetcherProcessBusy = true;
		return 0;
	}
	//Free signal received from the process
	LRESULT OnProcessFree(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) {
		fetcherProcessBusy = false;
		fetcher->informRSSFetcherProcess(true);
		return 0;
	}
	LRESULT OnFetchComplete(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) {
		fetcherProcessBusy = false;
		fetcher->informRSSFetcherProcess();
		return 0;
	}
	LRESULT	OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) {
		int n = newsButtonVector.size();
		for(int i=0;i<n;i++) {
			if(newsButtonVector[i]) 
				newsButtonVector[i]->removeRssFile(true);
		}
		return 0;
	}

	RRPRssFetcher *getRssFetcher() {
		return fetcher;
	};

	RRPConfigurationManager* getConfigManger() {
		return configManager;
	};


	void setBrowser(IWebBrowser2 *p) {
		webBrowser = p;
	};

	FILETIME& getStartTIme() {
		return startTime;
	};

	HWND& getPopupMenuHandle() {
		return popupMenuHandle;
	};

private :
	std::vector<RRPNewsButton *> newsButtonVector;
	RRPDebugInfoLogger *debug;
	HWND toolbarHandle;
	HWND popupMenuHandle;
	BOOL fetcherProcessBusy;
	

	RRPConfigurationManager *configManager;
	RRPMenuTooltip *menuTooltip;
	RRPRssFetcher *fetcher;
	IWebBrowser2 *webBrowser;
	
	static int referenceCount;
	FILETIME startTime;
	

	POINT cursorPosition;

};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

PrafullaT

India India
Quote : "Life is all about solving problems and enjoying their solutions !! "

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150414.1 | Last Updated 17 Jul 2007
Article Copyright 2007 by PrafullaT
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid