Click here to Skip to main content
12,698,292 members (23,454 online)
Click here to Skip to main content


54 bookmarked

System Tray Icons - Adding to your dialog application

, 15 Apr 2002
Easy to implement system tray icon!
// ashsystrayDlg.h : header file


#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "TrayNot.h"
// CAshsystrayDlg dialog

class CAshsystrayDlg : public CDialog
// Construction
	CTrayNot*	m_pTray;
	BOOL  m_bHidden;
	CAshsystrayDlg(CWnd* pParent = NULL);	// standard constructor
	void CANCEL();
// Dialog Data
		// NOTE: the ClassWizard will add data members here

	// ClassWizard generated virtual function overrides
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support

// Implementation
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg LONG OnTrayNotify ( WPARAM wParam, LPARAM lParam ) ;
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnTrayRestore();
	afx_msg void OnHideapp();
	afx_msg void OnHide();
	afx_msg void OnUnHide();
	afx_msg void OnDestroy();
	afx_msg void OnAppExit();

// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_ASHSYSTRAYDLG_H__E3615DCB_AA0B_497C_BF37_CD933FAD5AF6__INCLUDED_)

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

Web Developer
Australia Australia
Name: Ash Rowe
From: Canberra, Australia
Qualifications: Diploma in Game Programming
Age: 19 (Getting old and feeling it)

Tutorials I have written in the past, I have done so in a fashion that would enable even the newest of programmers to get a grasp on what is actually happening with the code I submit. I am looking at writing even more in the near future to further assist others as well as gain a better understanding myself of the code I end up with.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170118.1 | Last Updated 16 Apr 2002
Article Copyright 2001 by Ashman
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid