Click here to Skip to main content
16,008,010 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Change Dialog Menu Text Pin
ColinDavies27-Nov-01 8:58
ColinDavies27-Nov-01 8:58 
GeneralRe: Change Dialog Menu Text Pin
Nish Nishant27-Nov-01 16:31
sitebuilderNish Nishant27-Nov-01 16:31 
GeneralRe: Change Dialog Menu Text Pin
ColinDavies27-Nov-01 17:02
ColinDavies27-Nov-01 17:02 
GeneralRe: Change Dialog Menu Text Pin
Nish Nishant27-Nov-01 17:47
sitebuilderNish Nishant27-Nov-01 17:47 
GeneralRe: Change Dialog Menu Text Pin
ColinDavies27-Nov-01 19:22
ColinDavies27-Nov-01 19:22 
GeneralRe: Change Dialog Menu Text Pin
Nish Nishant27-Nov-01 19:32
sitebuilderNish Nishant27-Nov-01 19:32 
GeneralRe: Change Dialog Menu Text Pin
ColinDavies27-Nov-01 20:16
ColinDavies27-Nov-01 20:16 
GeneralRe: Change Dialog Menu Text Pin
Nish Nishant27-Nov-01 22:47
sitebuilderNish Nishant27-Nov-01 22:47 
Colin

You need to make some changes

First open up SystemTray.cpp

scroll down to CSystemTray::OnTrayNotification

You'll see the following line at the beginning of the function [3rd or 4th line]

CWnd *pTargetWnd = GetTargetWnd();

Comment that out and replace the line with this line :-

CWnd *pTargetWnd = AfxGetApp()->m_pMainWnd;

Okay, so far?

Now add a new public function to the class as follows

void CSystemTray::ChangeMenuText()
{
CMenu menu, *pSubMenu;



pSubMenu = AfxGetApp()->m_pMainWnd->GetMenu()->GetSubMenu(0);
if (!pSubMenu)
return ;


pSubMenu->ModifyMenu(2,MF_BYPOSITION,2,"YYYYYYYYYYYYY");
}

Okay???

Now in your main dlg class do this to the OnMenuSend:-

void CNishTestDlg::OnMenuSend()
{
// TODO: Add your command handler code here
m_TrayIcon.ChangeMenuText();
AfxMessageBox("Send");
}

Now run the program.
When you click on send once you'll change it to YYYYY

Happy, now???

Cheers

Nish

p.s. I messed up the project here. so I cant send it to you. After it was workin properly I messed it up Smile | :)

But if you want it badly I can send you one quicklymade up project.

p.s. to p.s :- you sure chris and mike will like newbies like colin and nish messin up their cool tray-icon class??



Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
GeneralRe: Change Dialog Menu Text Pin
ColinDavies28-Nov-01 2:25
ColinDavies28-Nov-01 2:25 
GeneralRe: Change Dialog Menu Text Pin
Nish Nishant28-Nov-01 4:39
sitebuilderNish Nishant28-Nov-01 4:39 
GeneralRe: Change Dialog Menu Text Pin
Nish Nishant28-Nov-01 19:08
sitebuilderNish Nishant28-Nov-01 19:08 
GeneralScrolling a Tab Pane Pin
D.Pfaster26-Nov-01 23:08
D.Pfaster26-Nov-01 23:08 
GeneralHKM_GETHOTKEY Pin
Fred/M26-Nov-01 22:53
Fred/M26-Nov-01 22:53 
GeneralODBC Localisation Pin
James Spibey26-Nov-01 21:45
James Spibey26-Nov-01 21:45 
GeneralRe: ODBC Localisation Pin
Martin Ziacek27-Nov-01 6:13
Martin Ziacek27-Nov-01 6:13 
QuestionCan VC use the class exporting by other compiler? Pin
wenxi7926-Nov-01 21:31
wenxi7926-Nov-01 21:31 
AnswerRe: Can VC use the class exporting by other compiler? Pin
Rashid Thadha26-Nov-01 22:40
Rashid Thadha26-Nov-01 22:40 
GeneralATL - Error Pin
Bernhard26-Nov-01 20:31
Bernhard26-Nov-01 20:31 
GeneralRe: ATL - Error Pin
Rashid Thadha26-Nov-01 22:44
Rashid Thadha26-Nov-01 22:44 
GeneralRe: ATL - Error Pin
Bernhard26-Nov-01 22:57
Bernhard26-Nov-01 22:57 
Generalcreating a operator delete Pin
26-Nov-01 19:35
suss26-Nov-01 19:35 
QuestionHowto Serialize a STL container? Pin
Alex Dong26-Nov-01 16:59
Alex Dong26-Nov-01 16:59 
AnswerRe: Howto Serialize a STL container? Pin
Christian Graus26-Nov-01 17:05
protectorChristian Graus26-Nov-01 17:05 
GeneralRe: Howto Serialize a STL container? Pin
Alex Dong26-Nov-01 18:28
Alex Dong26-Nov-01 18:28 
GeneralRe: Howto Serialize a STL container? Pin
Christian Graus26-Nov-01 18:36
protectorChristian Graus26-Nov-01 18:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.