Click here to Skip to main content
12,999,628 members (52,334 online)
Click here to Skip to main content


325 bookmarked
Posted 11 Jul 2002

Taskbar Notification dialog

, 11 Jul 2002
A MSN IM-style popup notification dialog
// CTaskbarNotifier Header file
// By John O'Byrne - 05 July 2002

#pragma once

#define TN_TEXT_NORMAL			0x0000
#define TN_TEXT_BOLD			0x0001
#define TN_TEXT_ITALIC			0x0002
#define TN_TEXT_UNDERLINE		0x0004

// CTaskbarNotifier

class CTaskbarNotifier : public CWnd

	virtual ~CTaskbarNotifier();

	int Create(CWnd *pWndParent);
	void Show(LPCTSTR szCaption,DWORD dwTimeToShow=500,DWORD dwTimeToStay=3000,DWORD dwTimeToHide=500,int nIncrement=1);
	void Hide();
	BOOL SetSkin(UINT nBitmapID,short red=-1,short green=-1,short blue=-1);
	BOOL SetSkin(LPCTSTR szFileName,short red=-1,short green=-1,short blue=-1);
	void SetTextFont(LPCTSTR szFont,int nSize,int nNormalStyle,int nSelectedStyle);
	void SetTextColor(COLORREF crNormalTextColor,COLORREF crSelectedTextColor);
	void SetTextRect(RECT rcText);
	CWnd *m_pWndParent;
	CFont m_myNormalFont;
	CFont m_mySelectedFont;
	COLORREF m_crNormalTextColor;
	COLORREF m_crSelectedTextColor;
	HCURSOR m_hCursor;
	CBitmap m_biSkinBackground;
	HRGN m_hSkinRegion;
	CRect m_rcText;
	int m_nSkinWidth;
	int m_nSkinHeight;

	CString m_strCaption;
	BOOL m_bMouseIsOver;
	int m_nAnimStatus;

 	DWORD m_dwTimeToShow;
	DWORD m_dwTimeToLive;
	DWORD m_dwTimeToHide;
	DWORD m_dwDelayBetweenShowEvents;
	DWORD m_dwDelayBetweenHideEvents;
	int m_nStartPosX;
	int m_nStartPosY;
	int m_nCurrentPosX;
	int m_nCurrentPosY;
	int m_nTaskbarPlacement;
	int m_nIncrement;
	BYTE* Get24BitPixels(HBITMAP pBitmap, WORD *pwWidth, WORD *pwHeight);
	HRGN GenerateRegion(HBITMAP hBitmap, BYTE red, BYTE green, BYTE blue);

	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnDestroy();
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg LRESULT OnMouseHover(WPARAM w, LPARAM l);
	afx_msg LRESULT OnMouseLeave(WPARAM w, LPARAM l);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnPaint();
	afx_msg void OnTimer(UINT nIDEvent);

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.


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

John O'Byrne
Web Developer
United States United States
I live in Santa Clara CA and work as a software engineer for SAP Business Objects.

My areas of expertise are user interface developments in Eclipse RCP / SWT / Draw 2D and C#

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170624.1 | Last Updated 12 Jul 2002
Article Copyright 2002 by John O'Byrne
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid