Lu,
Donc mon problême n'est pas exactement de créer l'icône, j'y suis arrivé...
Seulement elle disparaît, systèmatiquement et instantannément, dès que je la survole avec la souris !
J'ai vu quelqu'un qui avait eu le même problême sur le forum mais la solution qu'il semble avoir trouvée n'a pas lieu chez moi

Donc je vous donne le code et j'attends vos suggestions

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
NOTIFYICONDATA m_NotifyIconData;
 
void __fastcall TForm1::Button2Click(TObject *Sender)
{
   HWND hwnd;
   HINSTANCE hInst;
   HICON hicon = ExtractIcon(hInst,"Project1.exe",0);
 
   Form1->Hide();
 
   m_NotifyIconData.cbSize = sizeof m_NotifyIconData;
   m_NotifyIconData.hWnd = hwnd;
   m_NotifyIconData.uID = 1;
   m_NotifyIconData.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
   m_NotifyIconData.uCallbackMessage = WM_USER;
   m_NotifyIconData.hIcon = hicon;
   strcpy(m_NotifyIconData.szTip, "Appli de test de trayicon");
   Shell_NotifyIcon(NIM_ADD, &m_NotifyIconData);
 
   Sleep(5000);
 
   m_NotifyIconData.uFlags = 0;
   Shell_NotifyIcon(NIM_DELETE, &m_NotifyIconData);
 
   Form1->Show();
}
Merci d'avance !