diff options
Diffstat (limited to 'plugins/Mwclist/clisttray.cpp')
-rw-r--r-- | plugins/Mwclist/clisttray.cpp | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/plugins/Mwclist/clisttray.cpp b/plugins/Mwclist/clisttray.cpp index 82ce1a2f16..d0e6e3ae93 100644 --- a/plugins/Mwclist/clisttray.cpp +++ b/plugins/Mwclist/clisttray.cpp @@ -106,38 +106,20 @@ static INT_PTR BuildTrayMenu(WPARAM wParam,LPARAM lParam) static INT_PTR AddTrayMenuItem(WPARAM wParam,LPARAM lParam)
{
- CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
TMO_MenuItem tmi;
- OptParam op;
-
- if (mi->cbSize != sizeof(CLISTMENUITEM)) return 0;
-
- memset(&tmi,0,sizeof(tmi));
- tmi.cbSize = sizeof(tmi);
- tmi.flags = mi->flags;
- tmi.hIcon = mi->hIcon;
- tmi.hotKey = mi->hotKey;
- tmi.pszName = mi->pszName;
- tmi.position = mi->position;
-
- //pszPopupName for new system mean root level
- //pszPopupName for old system mean that exists popup
- tmi.root = (HGENMENU)mi->pszPopupName;
-
- tmi.ownerdata = NULL;
+ CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
+ if ( !pcli->pfnConvertMenu(mi, &tmi))
+ return NULL;
- {
- lpTrayMenuExecParam mmep;
- mmep = (lpTrayMenuExecParam)mir_alloc(sizeof(TrayMenuExecParam));
- if (mmep == NULL)
- return 0;
+ lpTrayMenuExecParam mmep = (lpTrayMenuExecParam)mir_alloc(sizeof(TrayMenuExecParam));
+ if (mmep == NULL)
+ return 0;
- //we need just one parametr.
- mmep->szServiceName = mir_strdup(mi->pszService);
- mmep->Param1 = mi->popupPosition;
+ mmep->szServiceName = mir_strdup(mi->pszService);
+ mmep->Param1 = mi->popupPosition;
+ tmi.ownerdata = mmep;
- tmi.ownerdata = mmep;
- }
+ OptParam op;
op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hTrayMenuObject,(LPARAM)&tmi);
op.Setting = OPT_MENUITEMSETUNIQNAME;
op.Value = (INT_PTR)mi->pszService;
|