From c4582dd65b444e5dae29ada7cc3f6c9a9c20edf3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 2 Dec 2012 18:19:49 +0000 Subject: new easy standard way of registering icons: Icon_Register git-svn-id: http://svn.miranda-ng.org/main/trunk@2601 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AuthState/src/commonheaders.h | 1 + plugins/AuthState/src/main.cpp | 30 ++++++++---------------------- 2 files changed, 9 insertions(+), 22 deletions(-) (limited to 'plugins/AuthState/src') diff --git a/plugins/AuthState/src/commonheaders.h b/plugins/AuthState/src/commonheaders.h index a234517f03..ba5fd1ebc6 100644 --- a/plugins/AuthState/src/commonheaders.h +++ b/plugins/AuthState/src/commonheaders.h @@ -44,6 +44,7 @@ #include #include #include +#include #include "resource.h" #include "Version.h" diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp index cf2e215e72..e6b6f4496e 100644 --- a/plugins/AuthState/src/main.cpp +++ b/plugins/AuthState/src/main.cpp @@ -169,31 +169,17 @@ int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam) return 0; } +static IconItem iconList[] = +{ + { LPGEN("Auth"), "auth_icon", IDI_AUTH }, + { LPGEN("Grant"), "grant_icon", IDI_GRANT }, + { LPGEN("Auth & Grant"), "authgrant_icon", IDI_AUTHGRANT } +}; + int onModulesLoaded(WPARAM wParam,LPARAM lParam) { // IcoLib support - TCHAR szFile[MAX_PATH]; - GetModuleFileName(g_hInst, szFile, MAX_PATH); - - SKINICONDESC sid = { sizeof(sid) }; - sid.flags = SIDF_PATH_TCHAR; - sid.ptszDefaultFile = szFile; - sid.pszSection = "Auth State"; - - sid.pszDescription = LPGEN("Auth"); - sid.pszName = "auth_icon"; - sid.iDefaultIndex = -IDI_AUTH; - Skin_AddIcon(&sid); - - sid.pszDescription = LPGEN("Grant"); - sid.pszName = "grant_icon"; - sid.iDefaultIndex = -IDI_GRANT; - Skin_AddIcon(&sid); - - sid.pszDescription = LPGEN("Auth & Grant"); - sid.pszName = "authgrant_icon"; - sid.iDefaultIndex = -IDI_AUTHGRANT; - Skin_AddIcon(&sid); + Icon_Register(g_hInst, "Auth State", iconList, SIZEOF(iconList)); // extra icons hExtraIcon = ExtraIcon_Register("authstate", "Auth State", "authgrant_icon"); -- cgit v1.2.3