<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[TrayIcon wieder löschen]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>ich hab einen Dialog in einer DLL. Der wird beim Start von meinem Prog mit create erstellt und in den Tray geladen. Wenn ich das Programm beende wird der Dialog mot destroywindow oder so ähnlich beendet.<br />
Aber der Icon bleibt noch im Tray bis ich mit der Maus drüber fahr. Wieso? Ist echt ärgerlich, denn beim nächsten Start hab ich dann zwei, 3 usw. Icons im Tray.</p>
<p>Ciao,</p>
<p>Stalin</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/47430/trayicon-wieder-löschen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 28 Apr 2026 03:49:50 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/47430.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 29 Aug 2003 13:34:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to TrayIcon wieder löschen on Fri, 29 Aug 2003 13:34:37 GMT]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>ich hab einen Dialog in einer DLL. Der wird beim Start von meinem Prog mit create erstellt und in den Tray geladen. Wenn ich das Programm beende wird der Dialog mot destroywindow oder so ähnlich beendet.<br />
Aber der Icon bleibt noch im Tray bis ich mit der Maus drüber fahr. Wieso? Ist echt ärgerlich, denn beim nächsten Start hab ich dann zwei, 3 usw. Icons im Tray.</p>
<p>Ciao,</p>
<p>Stalin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/343303</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/343303</guid><dc:creator><![CDATA[Stalin]]></dc:creator><pubDate>Fri, 29 Aug 2003 13:34:37 GMT</pubDate></item><item><title><![CDATA[Reply to TrayIcon wieder löschen on Fri, 29 Aug 2003 16:06:51 GMT]]></title><description><![CDATA[<p>Schau mal bitte in die FAQ, dort gibt es ein ausführliches Thema zum Thema <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> TrayIcon (und wieder löschen)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/343419</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/343419</guid><dc:creator><![CDATA[C-O-M-M-A-N-D-E-R]]></dc:creator><pubDate>Fri, 29 Aug 2003 16:06:51 GMT</pubDate></item><item><title><![CDATA[Reply to TrayIcon wieder löschen on Mon, 01 Sep 2003 07:44:49 GMT]]></title><description><![CDATA[<p>Was glaubst was ich gemacht habe. Danke für die Antwort und für die absolut keine Hilfe. Ich hab hier<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39045" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic.php?t=39045</a><br />
mal reingeschaut und das ganze so implementiert.<br />
Aber mein Icon bleibt trotzdem noch im Tray.<br />
So und jetzt?</p>
<p>Ciao,</p>
<p>Stalin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/344713</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/344713</guid><dc:creator><![CDATA[Stalin]]></dc:creator><pubDate>Mon, 01 Sep 2003 07:44:49 GMT</pubDate></item><item><title><![CDATA[Reply to TrayIcon wieder löschen on Mon, 01 Sep 2003 07:49:46 GMT]]></title><description><![CDATA[<p>Dann geb uns doch mal den Source den du bei dir eingebunden hast!<br />
Wir sind keine Hellseher! Vieleicht hast du da ja nur was vergessen oder ne kleinigkeit übersehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/344717</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/344717</guid><dc:creator><![CDATA[C-O-M-M-A-N-D-E-R]]></dc:creator><pubDate>Mon, 01 Sep 2003 07:49:46 GMT</pubDate></item><item><title><![CDATA[Reply to TrayIcon wieder löschen on Mon, 01 Sep 2003 13:30:25 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">afx_msg void TapiRecieveDlg::OnSetinTray()
{
  if(!m_pCallManager)
  {
	SetinTray();
  }
}

afx_msg LRESULT TapiRecieveDlg::OnTrayNotify(WPARAM wParam, LPARAM lParam)
{
  switch(lParam)
  {
  case WM_LBUTTONDBLCLK:
	{
	  ShowWindow(SW_SHOWNORMAL);
	  UpdateData(FALSE);

	  //set this dialog in forground
      SetForegroundWindow();

	  NOTIFYICONDATA tnd;

	  tnd.cbSize = sizeof(NOTIFYICONDATA);
	  tnd.hWnd   = GetSafeHwnd();
	  tnd.uID	   = 1;
	  return Shell_NotifyIcon(NIM_DELETE, &amp;tnd);
	}
  }

  return 0;
}

...

void TapiRecieveDlg::SetinTray()
{
  NOTIFYICONDATA tnd;

  HINSTANCE hinst = ::AfxGetResourceHandle();

  ::AfxSetResourceHandle(GetBPhoneInstance());

  ZeroMemory(&amp;tnd, sizeof(NOTIFYICONDATA));

  tnd.cbSize = sizeof(NOTIFYICONDATA);
  tnd.hWnd 	 = this-&gt;GetSafeHwnd();
  tnd.uID	 = 1;
  tnd.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP;
  tnd.uCallbackMessage = WM_NOTIFICATION;
  tnd.hIcon  = GetIconFromResource(AfxGetResourceHandle()); 
  lstrcpyn(tnd.szTip, &quot;Addison Telefonie&quot;, sizeof(tnd.szTip));
  Shell_NotifyIcon(NIM_ADD, &amp;tnd);

  ShowWindow(SW_HIDE);

  //delete all contents of the listbox
  ((CNListBox*)GetDlgItem(ID_CTRL_TEXT))-&gt;ResetContent();
  m_strNumber = &quot;&quot;;

  ::AfxSetResourceHandle(hinst);
}

...

LRESULT TapiRecieveDlg::CallfromTray()
{
  NOTIFYICONDATA tnd;

  HINSTANCE hinst = ::AfxGetResourceHandle();

  ::AfxSetResourceHandle(GetBPhoneInstance());

  tnd.cbSize = sizeof(NOTIFYICONDATA);
  tnd.hWnd   = GetSafeHwnd();
  tnd.uID	   = 1;
  tnd.hIcon  = GetIconFromResource(AfxGetResourceHandle());

  ::AfxSetResourceHandle(hinst);

  return Shell_NotifyIcon(NIM_DELETE, &amp;tnd);
}

...

#define WM_NOTIFICATION (WM_APP+100)
</code></pre>
<p>So die CallfromTray Funktion wid kurz vor dem Destroy aufgerufen, da ich dachte das ich das ganze aus dem Tray holen muss bevor ich ein destroy machen kann. So ist da irgendwo ein Fehler?</p>
<p>Ciao und danke</p>
<p>Stalin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/344998</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/344998</guid><dc:creator><![CDATA[Stalin]]></dc:creator><pubDate>Mon, 01 Sep 2003 13:30:25 GMT</pubDate></item><item><title><![CDATA[Reply to TrayIcon wieder löschen on Mon, 01 Sep 2003 19:43:35 GMT]]></title><description><![CDATA[<p>Ich vermisse die Defenition aus der Header :</p>
<pre><code class="language-cpp">afx_msg LRESULT OnTrayNotification(WPARAM wParam, LPARAM lParam);
</code></pre>
<p>ebenfalls vermisse ich das:</p>
<pre><code class="language-cpp">BEGIN_MESSAGE_MAP(CDeinDlg, CDialog) 
    ON_MESSAGE(WM_NOTIFICATION, OnTrayNotification) 
END_MESSAGE_MAP()
</code></pre>
<p>check das mal...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/345247</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/345247</guid><dc:creator><![CDATA[C-O-M-M-A-N-D-E-R]]></dc:creator><pubDate>Mon, 01 Sep 2003 19:43:35 GMT</pubDate></item><item><title><![CDATA[Reply to TrayIcon wieder löschen on Tue, 02 Sep 2003 06:25:51 GMT]]></title><description><![CDATA[<p>Nur habe ich halt nur das essentielle gepostet. Es funzt ja während dem Betireb wunderbar nur wird halt der Icon nach dem destroy-Aufruf von dem Dialog nicht gelöscht aus dem Tray, wenn der Dialog noch dort war.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/345372</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/345372</guid><dc:creator><![CDATA[Stalin]]></dc:creator><pubDate>Tue, 02 Sep 2003 06:25:51 GMT</pubDate></item><item><title><![CDATA[Reply to TrayIcon wieder löschen on Fri, 05 Sep 2003 06:00:53 GMT]]></title><description><![CDATA[<p>In der MSDN findest du an dieser (shellcc/Shell/Shell_Int/Taskbar.htm#tbnotify_taskbarlist) Stelle folgendes:</p>
<pre><code class="language-cpp">// MyTaskBarDeleteIcon - deletes an icon from the taskbar status area. 
// Returns TRUE if successful, or FALSE otherwise. 
// hwnd - handle to the window that added the icon. 
// uID - identifier of the icon to delete. 
BOOL MyTaskBarDeleteIcon(HWND hwnd, UINT uID) 
{ 
    BOOL res; 
    NOTIFYICONDATA tnid; 

    tnid.cbSize = sizeof(NOTIFYICONDATA); 
    tnid.hWnd = hwnd; 
    tnid.uID = uID; 

    res = Shell_NotifyIcon(NIM_DELETE, &amp;tnid); 
    return res; 
}
</code></pre>
<p>Funktioniert super!</p>
<p>Das steht unter dem Thema: Handling the Taskbar</p>
]]></description><link>https://www.c-plusplus.net/forum/post/347644</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/347644</guid><dc:creator><![CDATA[estartu_de]]></dc:creator><pubDate>Fri, 05 Sep 2003 06:00:53 GMT</pubDate></item></channel></rss>