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

Shell Tray Info - Arrange your system tray icons

, 26 Jun 2005 CPOL
A tool with full source code that enumerates tray icons and allows you to reposition them as well as send mouse messages.
// ShellTrayInfoView.h : interface of the CShellTrayInfoView class

#pragma once

#include "Util.h"
#include <vector>
using namespace std;

class CShellTrayInfoView : public CListView

// Attributes
	HWND m_hTrayWnd;	
	CImageList m_Image16List;
	vector<TrayItemInfo> m_TifoVec;
	HFONT m_hHiddenFont;
	HFONT m_hRegularFont;

// Operations

// Overrides
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnInitialUpdate(); // called first time after construct

// Implementation
	virtual ~CShellTrayInfoView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;


// Generated message map functions
	void ListTrayIcons(int defindex = 0);
	afx_msg void OnEditCopy();
	afx_msg void OnDoubleClick();
	afx_msg void OnRightClick();
	afx_msg void OnLeftClick();
	afx_msg void OnMoveLeft();
	afx_msg void OnMoveRight();
	afx_msg void OnRefresh();
	void PostMessageToTrayIcon(LPARAM lParam);
	afx_msg void OnNMCustomdraw(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnNMDblclk(NMHDR *pNMHDR, LRESULT *pResult);

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Nish Sivakumar

United States United States
Nish is a real nice guy who has been writing code since 1990 when he first got his hands on an 8088 with 640 KB RAM. Originally from sunny Trivandrum in India, he has been living in various places over the past few years and often thinks it’s time he settled down somewhere.
Nish has been a Microsoft Visual C++ MVP since October, 2002 - awfully nice of Microsoft, he thinks. He maintains an MVP tips and tricks web site - where you can find a consolidated list of his articles, writings and ideas on VC++, MFC, .NET and C++/CLI. Oh, and you might want to check out his blog on C++/CLI, MFC, .NET and a lot of other stuff -
Nish loves reading Science Fiction, P G Wodehouse and Agatha Christie, and also fancies himself to be a decent writer of sorts. He has authored a romantic comedy Summer Love and Some more Cricket as well as a programming book – Extending MFC applications with the .NET Framework.
Nish's latest book C++/CLI in Action published by Manning Publications is now available for purchase. You can read more about the book on his blog.
Despite his wife's attempts to get him into cooking, his best effort so far has been a badly done omelette. Some day, he hopes to be a good cook, and to cook a tasty dinner for his wife.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.141223.1 | Last Updated 27 Jun 2005
Article Copyright 2005 by Nish Sivakumar
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid