diff options
-rw-r--r-- | MySpace/srmm_icon.cpp | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/MySpace/srmm_icon.cpp b/MySpace/srmm_icon.cpp index 6283237..b32aa6e 100644 --- a/MySpace/srmm_icon.cpp +++ b/MySpace/srmm_icon.cpp @@ -10,7 +10,7 @@ int WindowEvent(WPARAM wParam, LPARAM lParam) { MessageWindowEventData *wd = (MessageWindowEventData *)lParam;
if(wd->uType != MSG_WINDOW_EVT_OPEN) return 0;
- HANDLE hContact = wd->hContact, hSub = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0);
+ HANDLE hContact = wd->hContact, hSub = ServiceExists(MS_MC_GETMOSTONLINECONTACT) ? (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)hContact, 0) : 0;
bool hide = false;
if((hSub == 0 && !CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hContact, (LPARAM)MODULE)) || (hSub && !CallService(MS_PROTO_ISPROTOONCONTACT, (WPARAM)hSub, (LPARAM)MODULE)))
@@ -62,7 +62,7 @@ HANDLE hEventIconPressed = 0, hEventWindow = 0, hEventContactAdded; void InitSRMMIcon() {
// add icon to srmm status icons
if(ServiceExists(MS_MSG_ADDICON)) {
- hZapIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ZAPS));
+ hZapIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_ZAPS), IMAGE_ICON, 0, 0, 0);//LoadIcon(hInst, MAKEINTRESOURCE(IDI_ZAPS));
// create icon hidden
StatusIconData sid = {0};
sid.cbSize = sizeof(sid);
@@ -72,23 +72,10 @@ void InitSRMMIcon() { sid.szTooltip = Translate("Send ZAP");
CallService(MS_MSG_ADDICON, 0, (LPARAM)&sid);
- // hook the window events so that we can can change the status of the icon for myspace contacts and metacontacts if necessary
- if(ServiceExists(MS_MC_GETMOSTONLINECONTACT)) // metas installed
- hEventWindow = HookEvent(ME_MSG_WINDOWEVENT, WindowEvent);
+ // hook the window events so that we can can change the status of the icon for myspace contacts, new contacts, and metacontacts if necessary
+ hEventWindow = HookEvent(ME_MSG_WINDOWEVENT, WindowEvent);
hEventIconPressed = HookEvent(ME_MSG_ICONPRESSED, IconPressed);
- /*
- // show for all MySpace contacts
- HANDLE hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
- while ( hContact != NULL ) {
- char* szProto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, ( WPARAM ) hContact, 0 );
- if ( szProto != NULL && !strcmp( szProto, MODULE)) {
- sid.flags = 0;
- CallService(MS_MSG_MODIFYICON, (WPARAM)hContact, (LPARAM)&sid);
- }
- hContact = ( HANDLE ) CallService( MS_DB_CONTACT_FINDNEXT, ( WPARAM ) hContact, 0 );
- }
- */
}
hEventContactAdded = HookEvent(ME_DB_CONTACT_ADDED, ContactAdded);
|