@@ -34,6 +34,9 @@ ConfigFile::ConfigFile(const TCHAR *configDir, const TCHAR *pluginDir, HINSTANCE
3434ConfigFile::~ConfigFile ()
3535{
3636 // TODO: Clean up
37+ // DeleteImage
38+ //
39+
3740}
3841
3942
@@ -44,8 +47,7 @@ void ConfigFile::readConfig()
4447 TCHAR buffer[500 ];
4548
4649
47- HICON defaultIcon = LoadIcon (m_hInst, MAKEINTRESOURCE (IDI_PYTHON));
48- HICON hIcon;
50+ HBITMAP hIcon;
4951
5052 while (startupFile.good ())
5153 {
@@ -70,16 +72,16 @@ void ConfigFile::readConfig()
7072 TCHAR *iconPath = _tcstok_s (NULL , _T (" /" ), &context);
7173 if (!iconPath || !(*iconPath))
7274 {
73- hIcon = defaultIcon ;
75+ hIcon = static_cast <HBITMAP>( LoadImage (m_hInst, MAKEINTRESOURCE (IDB_PYTHON), IMAGE_BITMAP, 0 , 0 , LR_DEFAULTSIZE)) ;
7476 iconPath = NULL ;
7577 }
7678 else
7779 {
78- hIcon = static_cast <HICON >(LoadImage (NULL , iconPath, IMAGE_ICON , 16 , 16 , LR_DEFAULTCOLOR ));
80+ hIcon = static_cast <HBITMAP >(LoadImage (NULL , iconPath, IMAGE_BITMAP , 16 , 16 , LR_LOADMAP3DCOLORS | LR_LOADFROMFILE ));
7981 }
8082
8183
82- m_toolbarItems.push_back (pair<tstring, pair<HICON , tstring> >(tstring (element), pair<HICON , tstring>(hIcon, iconPath ? tstring (iconPath) : tstring ())));
84+ m_toolbarItems.push_back (pair<tstring, pair<HBITMAP , tstring> >(tstring (element), pair<HBITMAP , tstring>(hIcon, iconPath ? tstring (iconPath) : tstring ())));
8385 }
8486 else if (0 == _tcscmp (element, _T (" SETTING" )))
8587 {
@@ -131,8 +133,8 @@ void ConfigFile::addMenuItem(const tstring scriptPath)
131133
132134void ConfigFile::addToolbarItem (const tstring scriptPath, const tstring iconPath)
133135{
134- HICON hIcon = static_cast <HICON >(LoadImage (m_hInst, iconPath.c_str (), IMAGE_ICON , 16 , 16 , LR_DEFAULTCOLOR ));
135- m_toolbarItems.push_back (pair<tstring, pair<HICON , tstring> >(scriptPath, pair<HICON , tstring>(hIcon, iconPath)));
136+ HBITMAP hIcon = static_cast <HBITMAP >(LoadImage (m_hInst, iconPath.c_str (), IMAGE_BITMAP , 16 , 16 , LR_LOADMAP3DCOLORS ));
137+ m_toolbarItems.push_back (pair<tstring, pair<HBITMAP , tstring> >(scriptPath, pair<HBITMAP , tstring>(hIcon, iconPath)));
136138}
137139
138140void ConfigFile::setSetting (const tstring& settingName, const tstring settingValue)
0 commit comments