summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src/modern_clui.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-01-23 15:26:17 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-01-23 15:26:17 +0000
commit5be50e1630a2f6a97c6becaf678e000fcd23656a (patch)
tree86cfd8f8f3f9dee1e2b7868901030473ad74457c /plugins/Clist_modern/src/modern_clui.cpp
parent286818877f50dc103288ae15495c08e6663b1818 (diff)
- main menu icon excluded from toolbar_icons.dll, it's grabbed via SKIN_OTHER_MAINMENU instead;
- code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@3249 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/src/modern_clui.cpp')
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp31
1 files changed, 14 insertions, 17 deletions
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index b9094b3a25..9459856ce4 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -1669,8 +1669,10 @@ static BOOL FileExists(TCHAR * tszFilename)
HANDLE RegisterIcolibIconHandle(char * szIcoID, char *szSectionName, char * szDescription, TCHAR * tszDefaultFile, int iDefaultIndex, HINSTANCE hDefaultModuleInst, int iDefaultResource )
{
+ if (hDefaultModuleInst == NULL)
+ return LoadSkinnedIconHandle(iDefaultResource);
+
TCHAR fileFull[MAX_PATH] = {0};
- HANDLE hIcolibItem = NULL;
SKINICONDESC sid = { sizeof(sid) };
sid.cx = sid.cy = 16;
@@ -1678,27 +1680,22 @@ HANDLE RegisterIcolibIconHandle(char * szIcoID, char *szSectionName, char * szD
sid.pszName = szIcoID;
sid.flags |= SIDF_PATH_TCHAR;
sid.pszDescription = szDescription;
+ sid.ptszDefaultFile = fileFull;
- if (tszDefaultFile)
- {
- CallService( MS_UTILS_PATHTOABSOLUTET, ( WPARAM )tszDefaultFile, ( LPARAM )fileFull );
- if ( !FileExists(fileFull)) fileFull[0] = _T('\0');
+ if (tszDefaultFile) {
+ CallService(MS_UTILS_PATHTOABSOLUTET, (WPARAM)tszDefaultFile, (LPARAM)fileFull);
+ if ( !FileExists(fileFull))
+ fileFull[0] = _T('\0');
}
+
if (fileFull[0] != _T('\0'))
- {
- sid.ptszDefaultFile = fileFull;
sid.iDefaultIndex = iDefaultIndex;
- sid.hDefaultIcon = NULL;
- }
- else
- {
- sid.pszDefaultFile = NULL;
- sid.iDefaultIndex = 0;
- sid.hDefaultIcon = LoadSmallIcon( hDefaultModuleInst, MAKEINTRESOURCE(iDefaultResource));
+ else {
+ GetModuleFileName(hDefaultModuleInst, fileFull, SIZEOF(fileFull));
+ sid.iDefaultIndex = iDefaultResource;
}
- hIcolibItem = Skin_AddIcon(&sid);
- if ( sid.hDefaultIcon ) DestroyIcon(sid.hDefaultIcon);
- return hIcolibItem;
+
+ return Skin_AddIcon(&sid);
}
// MAIN WINPROC MESSAGE HANDLERS