Click here to Skip to main content
15,905,323 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: Damn Tray Notification Icon! Pin
Nish Nishant25-Feb-02 14:47
sitebuilderNish Nishant25-Feb-02 14:47 
GeneralDatabase: mfc-odbc api getting column information Pin
25-Feb-02 8:29
suss25-Feb-02 8:29 
Questionhow do i use the "reinterpret_cast" operator? Pin
Pyropat25-Feb-02 8:13
Pyropat25-Feb-02 8:13 
AnswerRe: how do i use the "reinterpret_cast" operator? Pin
Tim Deveaux25-Feb-02 8:34
Tim Deveaux25-Feb-02 8:34 
AnswerRe: how do i use the "reinterpret_cast" operator? Pin
Paul M Watt25-Feb-02 9:30
mentorPaul M Watt25-Feb-02 9:30 
AnswerRe: how do i use the "reinterpret_cast" operator? Pin
Nish Nishant25-Feb-02 16:19
sitebuilderNish Nishant25-Feb-02 16:19 
AnswerRe: how do i use the "reinterpret_cast" operator? Pin
Sef Tarbell27-Feb-02 4:59
Sef Tarbell27-Feb-02 4:59 
GeneralRe: (corrected)how do i use the "reinterpret_cast" operator? Pin
Sef Tarbell27-Feb-02 5:01
Sef Tarbell27-Feb-02 5:01 
GeneralDirectX or OpenGL Pin
Nnamdi Onyeyiri25-Feb-02 7:54
Nnamdi Onyeyiri25-Feb-02 7:54 
GeneralRe: DirectX or OpenGL Pin
Christian Graus25-Feb-02 8:34
protectorChristian Graus25-Feb-02 8:34 
GeneralRe: DirectX or OpenGL Pin
Jeremy Falcon25-Feb-02 8:41
professionalJeremy Falcon25-Feb-02 8:41 
GeneralSubclassing a CComBSTR Pin
Mauricio Ritter25-Feb-02 6:48
Mauricio Ritter25-Feb-02 6:48 
GeneralRe: Subclassing a CComBSTR Pin
Michael Dunn25-Feb-02 7:25
sitebuilderMichael Dunn25-Feb-02 7:25 
Generalmodeless dialog & sockets Pin
25-Feb-02 6:47
suss25-Feb-02 6:47 
GeneralRe: modeless dialog & sockets Pin
Joaquín M López Muñoz25-Feb-02 6:59
Joaquín M López Muñoz25-Feb-02 6:59 
GeneralRe: modeless dialog & sockets Pin
25-Feb-02 7:30
suss25-Feb-02 7:30 

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.