Hi, im trying to load an icon into a NotifyIcon structure, however it wont work when i try to load from a resource:
m_pNotifyIcon->Icon = new System:rawing::Icon(GetType(), "App.ico"
The only way i can get it to work is if i load it directly from disk (by doing Icon("App.ico"). But i would rather it load from the embedded icon in the resource. I have included the resource.h and the icons ID is IDI_APP.
Here is the code for the constructor:
frmSysTray::frmSysTray()
{
m_pContextMenu = new Windows::Forms::ContextMenu();
m_pContextMenu->MenuItems->Add("Test1"
m_pContextMenu->MenuItems->Add("Test2"
m_pNotifyIcon = new NotifyIcon();
m_pNotifyIcon->Icon = new Drawing::Icon(GetType(), "App.ico"
m_pNotifyIcon->ContextMenu = m_pContextMenu;
m_pNotifyIcon->Visible = true;
}
Cheers
Skute
"There are 10 types of people in this World, those that understand binary, and those that don't!"
m_pNotifyIcon->Icon = new System:rawing::Icon(GetType(), "App.ico"
The only way i can get it to work is if i load it directly from disk (by doing Icon("App.ico"). But i would rather it load from the embedded icon in the resource. I have included the resource.h and the icons ID is IDI_APP.
Here is the code for the constructor:
frmSysTray::frmSysTray()
{
m_pContextMenu = new Windows::Forms::ContextMenu();
m_pContextMenu->MenuItems->Add("Test1"
m_pContextMenu->MenuItems->Add("Test2"
m_pNotifyIcon = new NotifyIcon();
m_pNotifyIcon->Icon = new Drawing::Icon(GetType(), "App.ico"
m_pNotifyIcon->ContextMenu = m_pContextMenu;
m_pNotifyIcon->Visible = true;
}
Cheers
Skute
"There are 10 types of people in this World, those that understand binary, and those that don't!"