From b03e423cdb55d973230e20842bfc0fd826718201 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Thu, 27 Sep 2012 20:17:40 +0000 Subject: added protocol icon git-svn-id: http://svn.miranda-ng.org/main/trunk@1693 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/Skype.vcxproj | 1 + protocols/Skype/Skype.vcxproj.filters | 3 +++ protocols/Skype/src/skype.cpp | 2 ++ protocols/Skype/src/skype.h | 6 ++++-- protocols/Skype/src/skype_events.cpp | 3 --- protocols/Skype/src/skype_icons.cpp | 6 ++++-- protocols/Skype/src/skype_proto.cpp | 11 ++++++++++- 7 files changed, 24 insertions(+), 8 deletions(-) (limited to 'protocols/Skype') diff --git a/protocols/Skype/Skype.vcxproj b/protocols/Skype/Skype.vcxproj index e98db9ce2f..278c9c5f2e 100644 --- a/protocols/Skype/Skype.vcxproj +++ b/protocols/Skype/Skype.vcxproj @@ -107,6 +107,7 @@ + diff --git a/protocols/Skype/Skype.vcxproj.filters b/protocols/Skype/Skype.vcxproj.filters index f830252540..a9d8ee45eb 100644 --- a/protocols/Skype/Skype.vcxproj.filters +++ b/protocols/Skype/Skype.vcxproj.filters @@ -22,6 +22,9 @@ Source Files + + Source Files + diff --git a/protocols/Skype/src/skype.cpp b/protocols/Skype/src/skype.cpp index 1f6edceb20..418d4040ed 100644 --- a/protocols/Skype/src/skype.cpp +++ b/protocols/Skype/src/skype.cpp @@ -103,6 +103,8 @@ extern "C" int __declspec(dllexport) Load(void) pd.fnUninit = (pfnUninitProto)SkypeProtoUninit; CallService(MS_PROTO_REGISTERMODULE, 0, reinterpret_cast(&pd)); + IconsLoad(); + return 0; } diff --git a/protocols/Skype/src/skype.h b/protocols/Skype/src/skype.h index 2c16c608cf..469e2373a6 100644 --- a/protocols/Skype/src/skype.h +++ b/protocols/Skype/src/skype.h @@ -27,12 +27,12 @@ #include #include #include -//#include +#include //#include //#include //#include //#include -//#include +#include #include #include //#include @@ -63,6 +63,8 @@ extern HINSTANCE g_hInstance; #include "skype_subclassing.h" +void IconsLoad(); + static const char* g_keyFileName = "..\\..\\..\\SkypeKit\\keypair.crt"; extern CSkype* g_skype; diff --git a/protocols/Skype/src/skype_events.cpp b/protocols/Skype/src/skype_events.cpp index d899e593b8..1546ed6e85 100644 --- a/protocols/Skype/src/skype_events.cpp +++ b/protocols/Skype/src/skype_events.cpp @@ -1,10 +1,7 @@ #include "skype_proto.h" -//void IconsLoad(); - int CSkypeProto::OnModulesLoaded(WPARAM, LPARAM) { - //IconsLoad(); this->HookEvent(ME_OPT_INITIALISE, &CSkypeProto::OnOptionsInit); return 0; diff --git a/protocols/Skype/src/skype_icons.cpp b/protocols/Skype/src/skype_icons.cpp index cbd893fb2d..db213b8197 100644 --- a/protocols/Skype/src/skype_icons.cpp +++ b/protocols/Skype/src/skype_icons.cpp @@ -17,17 +17,19 @@ void IconsLoad() { TCHAR szFile[MAX_PATH]; char szSettingName[100]; + TCHAR szSectionName[100]; SKINICONDESC sid = {0}; unsigned i; - GetModuleFileName(hInst, szFile, MAX_PATH); + GetModuleFileName(g_hInstance, szFile, MAX_PATH); sid.cbSize = sizeof(SKINICONDESC); sid.flags = SIDF_ALL_TCHAR; sid.ptszDefaultFile = szFile; sid.pszName = szSettingName; - sid.ptszSection = _T(MODULE); + sid.ptszSection = szSectionName; + mir_sntprintf(szSectionName, SIZEOF(szSectionName), _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE)); for (i = 0; i < SIZEOF(iconList); i++) { mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", MODULE, iconList[i].szName); diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp index 9f9918aa60..498239053b 100644 --- a/protocols/Skype/src/skype_proto.cpp +++ b/protocols/Skype/src/skype_proto.cpp @@ -74,7 +74,16 @@ DWORD_PTR __cdecl CSkypeProto:: GetCaps(int type, HANDLE hContact) } } -HICON __cdecl CSkypeProto::GetIcon( int iconIndex ) { return 0; } +HICON __cdecl CSkypeProto::GetIcon( int iconIndex ) +{ + if (LOWORD(iconIndex) == PLI_PROTOCOL) + { + HICON ico = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"Skype_main"); + return CopyIcon(ico); + } else + return 0; +} + int __cdecl CSkypeProto::GetInfo( HANDLE hContact, int infoType ) { return 0; } HANDLE __cdecl CSkypeProto::SearchBasic( const TCHAR* id ) { return 0; } -- cgit v1.2.3