Click here to Skip to main content
15,921,716 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC list view control question.... Pin
David Z25-Feb-02 19:31
David Z25-Feb-02 19:31 
GeneralRe: MFC list view control question.... Pin
Nish Nishant25-Feb-02 20:14
sitebuilderNish Nishant25-Feb-02 20:14 
GeneralIcon Question.... Pin
Joseph Dempsey25-Feb-02 15:16
Joseph Dempsey25-Feb-02 15:16 
GeneralRe: Icon Question.... Pin
Shog925-Feb-02 15:49
sitebuilderShog925-Feb-02 15:49 
GeneralGDI+ question! Pin
G.Richard25-Feb-02 14:16
G.Richard25-Feb-02 14:16 
GeneralClipping Pin
alex.barylski25-Feb-02 13:19
alex.barylski25-Feb-02 13:19 
GeneralRe: Clipping Pin
Shog925-Feb-02 15:51
sitebuilderShog925-Feb-02 15:51 
GeneralRe: Clipping Pin
alex.barylski25-Feb-02 18:50
alex.barylski25-Feb-02 18:50 
GeneralRe: Clipping Pin
Paul M Watt25-Feb-02 19:10
mentorPaul M Watt25-Feb-02 19:10 
GeneralRe: Clipping Pin
Shog925-Feb-02 19:47
sitebuilderShog925-Feb-02 19:47 
QuestionDoc/view question...?? Pin
alex.barylski25-Feb-02 13:15
alex.barylski25-Feb-02 13:15 
AnswerRe: Doc/view question...?? Pin
Jay Beckert25-Feb-02 13:43
Jay Beckert25-Feb-02 13:43 
GeneralRe: Doc/view question...?? Pin
alex.barylski25-Feb-02 14:06
alex.barylski25-Feb-02 14:06 
GeneralRe: Doc/view question...?? Pin
Jay Beckert26-Feb-02 10:37
Jay Beckert26-Feb-02 10:37 
AnswerRe: Doc/view question...?? Pin
Mazdak25-Feb-02 17:01
Mazdak25-Feb-02 17:01 
Generalvc6 macros: Object model shortcomings & bugs Pin
rseidl25-Feb-02 11:29
rseidl25-Feb-02 11:29 
GeneralRe: vc6 macros: Object model shortcomings & bugs Pin
J Patel25-Feb-02 11:36
J Patel25-Feb-02 11:36 
GeneralWTL Question - Pointers to different dialogs Pin
David Stidolph25-Feb-02 11:07
David Stidolph25-Feb-02 11:07 
GeneralRe: WTL Question - Pointers to different dialogs Pin
Joaquín M López Muñoz25-Feb-02 11:26
Joaquín M López Muñoz25-Feb-02 11:26 
GeneralWorks ok in app but not in dll :( Pin
Muralia Dhar25-Feb-02 10:44
Muralia Dhar25-Feb-02 10:44 
GeneralRe: Works ok in app but not in dll :( Pin
Joaquín M López Muñoz25-Feb-02 11:08
Joaquín M López Muñoz25-Feb-02 11:08 
GeneralRe: Works ok in app but not in dll :( Pin
Muralia Dhar25-Feb-02 19:46
Muralia Dhar25-Feb-02 19:46 
GeneralRe: Works ok in app but not in dll :( Pin
Joaquín M López Muñoz25-Feb-02 20:16
Joaquín M López Muñoz25-Feb-02 20:16 
GeneralDamn Tray Notification Icon! Pin
25-Feb-02 9:22
suss25-Feb-02 9:22 
It just won't work. I try the simplest trayicon program and I can't do it. I did it 2 years ago but the code was lost.
The simplest stuff if to use MFC to create a Dialog based project. When a button is pressed this code is called
NOTIFYICONDATA pnid;
pnid.cbSize=sizeof(NOTIFYICONDATA);
pnid.uID=1;
pnid.hWnd=this->m_hWnd;
pnid.uFlags=NIF_MESSAGE|NIF_ICON|NIF_TIP;
pnid.uCallbackMessage=WM_NOTIFYICON;
strcpy(pnid.szTip,"Hello");
pnid.hIcon=AfxGetApp()->LoadIcon(IDR_MAINFRAME);
Shell_NotifyIcon(NIM_ADD,&pnid);
I used View->ResourceSymbols to declare WM_NOTIFYICON to 666 (it must be the devil's hand hereSmile | :) )
Afterwards in trayDlg.cpp I added in the BEGIN_MESSAGE_MAP section the line ON_MESSAGE(WM_NOTIFYICON,On_WM_TrayIcon) wich means if the WM_NOTIFYICON is sent then call On_WM_TrayIcon
and added at the end of the program the function
void CTrayDlg::On_WM_TrayIcon(WPARAM wParam, LPARAM lParam)
{
switch((UINT) lParam)
{
case WM_LBUTTONDOWN:
AfxMessageBox("L BUT DOWN");
break;
case WM_RBUTTONDOWN:
AfxMessageBox("R BUT DOWN");
break;
}
return;
}
in trayDlg.h in the Generated Message Map Function section added the line afx_msg void On_WM_TrayIcon(WPARAM wParam, LPARAM lParam);
Compiling result is 0 warnings and errors.
Now whenever I push the button and tray icon is created if I try to place the mouse over it, it dissapears. If I remove the NIF_MESSAGE flag it doesn't dissapear.
Now I've spend 5 hours on this and come to the end of my patience so my deepest thanks goes to the person that helps me a little here.Roll eyes | :rolleyes:
GeneralRe: Damn Tray Notification Icon! Pin
Roger Stewart25-Feb-02 11:25
professionalRoger Stewart25-Feb-02 11:25 

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.