Click here to Skip to main content
15,892,737 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalsyntex error in wchar.h and xlocale in vc++ Pin
Maninish7-Mar-08 17:55
Maninish7-Mar-08 17:55 
QuestionHow to use CDaoDatabase to open SQL server database? Pin
realtimeforme7-Mar-08 16:08
realtimeforme7-Mar-08 16:08 
AnswerRe: How to use CDaoDatabase to open SQL server database? Pin
ramana.g7-Mar-08 18:05
ramana.g7-Mar-08 18:05 
AnswerRe: How to use CDaoDatabase to open SQL server database? Pin
Hamid_RT9-Mar-08 0:56
Hamid_RT9-Mar-08 0:56 
GeneralGetting handle of hidden window from another process Pin
act_x7-Mar-08 8:30
act_x7-Mar-08 8:30 
GeneralRe: Getting handle of hidden window from another process Pin
Randor 7-Mar-08 8:51
professional Randor 7-Mar-08 8:51 
GeneralRe: Getting handle of hidden window from another process Pin
Rajkumar R8-Mar-08 1:41
Rajkumar R8-Mar-08 1:41 
GeneralIcon in system tray Pin
RoyceF7-Mar-08 8:27
RoyceF7-Mar-08 8:27 
Hi,

I am re-posting this because I am still having this problem and I am desperate to figure it out. I am trying to create a tray icon. I downloaded Chris Maunder's project and it works for me in my test dialog which is modal. Now I am trying to get it to work in a modeless dialog that ultimately I want to be hidden. I cannot get the tray icon create logic to work. The call to ::Shell_NotifyIcon() fails but I have no idea why. The NOTIFYICONDATA struct seems to be filled in correctly and GetLastError() returns 0. I have tried it with and without a visible modeless dialog. I need the tray icon only to let my user know that my service is running. My code is below.

I call the logic to create the icon below:

m_iconTray.Create( this, <br />
               WM_ICON_NOTIFY,     // Icon notify message to use<br />
      _T("AutoFileHandler is running"), // tooltip to use<br />
      ::LoadIcon( NULL, IDI_ASTERISK ), // Icon to use<br />
      IDR_TRAYICON );           // ID of tray icon


The Icon Create() logic:

    m_tnd.cbSize = sizeof(NOTIFYICONDATA);<br />
    m_tnd.hWnd   = pParent->GetSafeHwnd()? pParent->GetSafeHwnd() : m_hWnd;<br />
    m_tnd.uID    = uID;<br />
    m_tnd.hIcon  = icon;<br />
    m_tnd.uFlags = NIF_ICON | NIF_TIP;	// NIF_MESSAGE;<br />
    m_tnd.uCallbackMessage = uCallbackMessage;<br />
    _tcscpy(m_tnd.szTip, szToolTip);<br />
<br />
    // Set the tray icon<br />
    VERIFY(m_bEnabled = ::Shell_NotifyIcon(NIM_ADD, &m_tnd));

Any help appreciated
GeneralRe: Icon in system tray Pin
JudyL_MD7-Mar-08 9:29
JudyL_MD7-Mar-08 9:29 
GeneralRe: Icon in system tray Pin
Mark Salsbery7-Mar-08 13:07
Mark Salsbery7-Mar-08 13:07 
GeneralRe: Icon in system tray Pin
Royce Fickling7-Mar-08 16:09
Royce Fickling7-Mar-08 16:09 
GeneralRe: Icon in system tray Pin
Mark Salsbery8-Mar-08 8:10
Mark Salsbery8-Mar-08 8:10 
GeneralRe: Icon in system tray Pin
Royce Fickling8-Mar-08 13:11
Royce Fickling8-Mar-08 13:11 
GeneralRe: Icon in system tray Pin
Mark Salsbery8-Mar-08 13:23
Mark Salsbery8-Mar-08 13:23 
Generalquestion to the pros: nasty ASSERTION in BOOST Pin
andreas.schaerer7-Mar-08 7:54
andreas.schaerer7-Mar-08 7:54 
GeneralRe: question to the pros: nasty ASSERTION in BOOST Pin
Maxwell Chen7-Mar-08 8:11
Maxwell Chen7-Mar-08 8:11 
GeneralRe: question to the pros: nasty ASSERTION in BOOST Pin
Nemanja Trifunovic7-Mar-08 8:19
Nemanja Trifunovic7-Mar-08 8:19 
Generalavi file on Status bar Pin
ptr_Electron7-Mar-08 3:18
ptr_Electron7-Mar-08 3:18 
GeneralRe: avi file on Status bar Pin
toxcct7-Mar-08 3:38
toxcct7-Mar-08 3:38 
GeneralRe: avi file on Status bar Pin
ptr_Electron7-Mar-08 5:21
ptr_Electron7-Mar-08 5:21 
GeneralRe: avi file on Status bar Pin
super_ttd7-Mar-08 7:02
super_ttd7-Mar-08 7:02 
GeneralRe: avi file on Status bar Pin
led mike7-Mar-08 7:18
led mike7-Mar-08 7:18 
GeneralRe: avi file on Status bar Pin
Randor 7-Mar-08 7:08
professional Randor 7-Mar-08 7:08 
GeneralRe: avi file on Status bar Pin
super_ttd7-Mar-08 7:13
super_ttd7-Mar-08 7:13 
GeneralRe: avi file on Status bar Pin
Randor 7-Mar-08 7:29
professional Randor 7-Mar-08 7:29 

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.