From 95aa036670a1ce2c461ffd9bd3a586d191ee4675 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 19 Jul 2012 22:48:01 +0000 Subject: - various icolib fixes; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@1061 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/CountryFlags/src/icons.cpp | 60 ++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 31 deletions(-) (limited to 'plugins/CountryFlags/src') diff --git a/plugins/CountryFlags/src/icons.cpp b/plugins/CountryFlags/src/icons.cpp index 3b456a4d11..cde97ff74e 100644 --- a/plugins/CountryFlags/src/icons.cpp +++ b/plugins/CountryFlags/src/icons.cpp @@ -226,53 +226,51 @@ static INT_PTR ServiceCreateMergedFlagIcon(WPARAM wParam,LPARAM lParam) void InitIcons(void) { - HIMAGELIST himl; - SKINICONDESC sid; char szId[20]; - int i,index; - HICON hIcon; WCHAR szName[64]; - LCID locale; - locale=(LCID)CallService(MS_LANGPACK_GETLOCALE,0,0); - + LCID locale = (LCID)CallService(MS_LANGPACK_GETLOCALE,0,0); /* register icons */ - ZeroMemory(&sid,sizeof(sid)); - sid.cbSize=sizeof(sid); - sid.pszName=szId; - sid.cx=GetSystemMetrics(SM_CXSMICON); - sid.cy=GetSystemMetrics(SM_CYSMICON); - sid.flags=SIDF_SORTED|SIDF_TCHAR; - sid.ptszSection=TranslateT("Country Flags"); + SKINICONDESC sid = { 0 }; + sid.cbSize = sizeof(sid); + sid.pszName = szId; + sid.cx = GetSystemMetrics(SM_CXSMICON); + sid.cy = GetSystemMetrics(SM_CYSMICON); + sid.flags = SIDF_SORTED | SIDF_TCHAR; + sid.ptszSection = TranslateT("Country Flags"); + /* all those flag icons do not need any transparency mask (flags are always opaque), * storing them in a large bitmap to reduce file size */ - himl=ImageList_LoadImage(hInst,MAKEINTRESOURCE(IDB_FLAGS),sid.cx,0,CLR_NONE,IMAGE_BITMAP,LR_CREATEDIBSECTION); - if(himl!=NULL) { - phIconHandles=(HANDLE*)mir_alloc(nCountriesCount*sizeof(HANDLE)); - if(phIconHandles!=NULL) - for(i=0;i