Проблема в следующем: есть вот такой вот класс. Все отлично, иконка в трей загружается, показываются балуны, но только в Windows 7 и я так подозреваю еще и в висте, но в XP они почему то не появляются. В чем может быть проблема, помогите пожалуйста 
| Код | #define _WIN32_IE 0x0600
#include <windows.h> #include "stdafx.h" #include "SysTray.h" SysTray::SysTray() { }
//sets values passed by the parameters void SysTray::SetParams ( int ID, HWND hWnd, int Message ) { _id = ID; // Set the id for the icon _hWnd = hWnd; // The handle to the window _message = Message; // The message sent to the window procedure when something happends }
// Function to set the application in the SysTray BOOL SysTray::SetInSysTray ( char* ToolTip, HICON hIcon ) { NOTIFYICONDATA nid;
nid.uID = _id; // Id for the icon nid.cbSize = sizeof ( NOTIFYICONDATA ); // Size of structure nid.hWnd = _hWnd; // Handle to the window nid.uFlags = NIF_MESSAGE|NIF_TIP|NIF_ICON; // Options nid.hIcon = hIcon; // The icon nid.uCallbackMessage = _message; // The message
lstrcpyn ( nid.szTip, ToolTip, sizeof ( nid.szTip ) ); // The tooltip
return Shell_NotifyIcon ( NIM_ADD, &nid ); // Add in the SysTray }
// Function to remove the application in the SysTray BOOL SysTray::RemoveFromSysTray () { NOTIFYICONDATA nid;
nid.uID = _id; // Id for the icon nid.cbSize = sizeof ( NOTIFYICONDATA ); // Size of structure nid.hWnd = _hWnd; // Handle to the window
return Shell_NotifyIcon ( NIM_DELETE, &nid ); // Delete the icon }
// Show a tooltip balloon BOOL SysTray::ShowBalloon ( char* Title, char* Message, int Icon ) { NOTIFYICONDATA nid;
nid.cbSize = sizeof ( NOTIFYICONDATA ); // Size of structure nid.hWnd = _hWnd; // Handle to parent window nid.uID = _id; // Id of the icon nid.uFlags = NIF_INFO; // Options: show balloon nid.dwInfoFlags = NIIF_INFO; //nid.dwInfoFlags = Icon; // Icon for the balloon nid.uTimeout = 1000; // Timeout when the balloon dissapear
lstrcpyn ( nid.szInfo, Message, sizeof ( nid.szInfo ) ); // Message lstrcpyn ( nid.szInfoTitle, Title, sizeof ( nid.szInfoTitle ) ); // Title
return Shell_NotifyIcon ( NIM_MODIFY, &nid ); // Show balloon }
|
|