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

System Tray Icons - Minimize Your Application to the SysTray

, 6 Nov 2000
Minimize your application to system tray instead of the taskbar
trayicons_demo.zip
TrayIcons_demo
res
MyTray.ico
MyTray.dsp
MyTray.dsw
Release
MyTray.exe
trayicons_src.zip
// MyTrayDlg.h : header file
//

#if !defined(AFX_MYTRAYDLG_H__DA41ECA7_B494_11D4_BFA7_00C0DF034AED__INCLUDED_)
#define AFX_MYTRAYDLG_H__DA41ECA7_B494_11D4_BFA7_00C0DF034AED__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
// CMyTrayDlg dialog

#include "TrayDialog.h"

class CMyTrayDlg : public CTrayDialog
{
// Construction
public:
	CMyTrayDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CMyTrayDlg)
	enum { IDD = IDD_MYTRAY_DIALOG };
		// NOTE: the ClassWizard will add data members here
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CMyTrayDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CMyTrayDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnTraymenuItem1();
	afx_msg void OnTraymenuItem2();
	afx_msg void OnTraymenuItem3();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_MYTRAYDLG_H__DA41ECA7_B494_11D4_BFA7_00C0DF034AED__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.

License

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

Share

About the Author

Daniel Zilcsak
Software Developer
United States United States
No Biography provided

| Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 7 Nov 2000
Article Copyright 2000 by Daniel Zilcsak
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid