diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-08-23 19:59:55 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-08-23 19:59:55 +0300 |
commit | 8983afc0314cb42ddc7ff709b78ae32b6fd1f900 (patch) | |
tree | 9ba248d49c9ec6cdf6427889b2ee9bf6348b6321 /icons.cpp | |
parent | 35daa0c0ba771eb0bab7f870f12eaf265ec58a2d (diff) |
modified: commonheaders.h
modified: icons.cpp
modified: icons/secured.ico
modified: icons/unsecured.ico
modified: init.cpp
modified: new_gpg.rc
modified: new_gpg.vcproj
modified: options.cpp
modified: resource.h
modified: utilities.cpp
Diffstat (limited to 'icons.cpp')
-rw-r--r-- | icons.cpp | 60 |
1 files changed, 60 insertions, 0 deletions
@@ -16,6 +16,66 @@ #include "commonheaders.h"
+HANDLE IconLibDefine(TCHAR* desc, TCHAR* section, char* ident, HICON icon, char* def_file, int def_idx, int size) +{ + SKINICONDESC sid = {0}; + HANDLE hIcon; + + if(!size) + size = 16; + + sid.cbSize = SKINICONDESC_SIZE; + sid.ptszSection = section; + sid.ptszDescription = desc; + sid.flags = SIDF_TCHAR; + + sid.pszName = ident; + sid.pszDefaultFile = def_file; + sid.iDefaultIndex = def_idx; + sid.hDefaultIcon = icon; + sid.cx = sid.cy = size; + + hIcon = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); + + return hIcon; +} +
+
+void InitIconLib() +{ + extern HINSTANCE hInst; + char lib[MAX_PATH]; + GetModuleFileNameA(hInst, lib, MAX_PATH); + TCHAR *module = mir_a2t(szGPGModuleName); + + IconLibDefine(_T("Secured"), module, "secured", NULL, lib, -IDI_SECURED,0); + IconLibDefine(_T("Unsecured"), module, "unsecured", NULL, lib, -IDI_UNSECURED,0); + mir_free(module); +} + + + + + +HICON IconLibGetIcon(const char* ident) +{ + return (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)ident); +} + + + +void IconLibReleaseIcon(const char* ident) +{ + CallService(MS_SKIN2_RELEASEICON, 0, (LPARAM)ident); +} + + + +HANDLE IconLibHookIconsChanged(MIRANDAHOOK hook) +{ + return HookEvent(ME_SKIN2_ICONSCHANGED, hook); +} +
// обновляет иконки в clist и в messagew
void ShowStatusIcon(HANDLE hContact,bool enabled) {
|