summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Actman/ua/i_uaplaces.inc53
-rw-r--r--plugins/QuickSearch/quicksearch.dpr5
-rw-r--r--plugins/QuickSearch/sr_window.pas11
-rw-r--r--plugins/Watrack/i_gui.inc21
-rw-r--r--plugins/Watrack/lastfm/lastfm.pas34
-rw-r--r--plugins/Watrack/make.bat20
-rw-r--r--plugins/Watrack/myshows/myshows.pas36
-rw-r--r--plugins/Watrack/popup/pop_vars.inc2
-rw-r--r--plugins/Watrack/popup/popups.pas14
-rw-r--r--plugins/Watrack/proto/proto.pas35
-rw-r--r--plugins/Watrack/stat/statlog.pas19
-rw-r--r--plugins/mRadio/i_tray.inc36
-rw-r--r--plugins/mRadio/i_visual.inc33
13 files changed, 69 insertions, 250 deletions
diff --git a/plugins/Actman/ua/i_uaplaces.inc b/plugins/Actman/ua/i_uaplaces.inc
index a36c8d511c..632c92434e 100644
--- a/plugins/Actman/ua/i_uaplaces.inc
+++ b/plugins/Actman/ua/i_uaplaces.inc
@@ -479,25 +479,25 @@ end;
function PreBuildMenu(mtype:tMenuType;hContact:TMCONTACT=0):int;
var
- i:integer;
- mi:TCListMenuItem;
+ mflags,i:integer;
+ hidden:Boolean;
+ icon:HICON;
p,extra:pWideChar;
begin
result:=0;
- FillChar(mi,SizeOf(mi),0);
-
for i:=0 to HIGH(UActionList) do
begin
- mi.flags:=CMIM_FLAGS;
- p:=nil;
with UActionList[i] do
begin
with UAMenuItem[mtype] do
begin
if hMenuItem<>0 then // it means, we process that item here
begin
- mi.szName.w:=nil;
+ hidden := false;
+ mflags := 0;
+ icon := HICON(-1);
+
// Show / hide
if isVarsInstalled then
begin
@@ -507,7 +507,8 @@ begin
if p<>nil then
begin
if StrCmpW(p,'1')<>0 then
- mi.flags:=CMIM_FLAGS or CMIF_HIDDEN;
+ hidden := true;
+ Menu_ShowItem(hMenuItem, 0);
mFreeMem(p);
end;
end;
@@ -515,25 +516,22 @@ begin
// change if need to show only
// (popup can be used by many items, keep unchanged)
- if (mi.flags and CMIF_HIDDEN)=0 then
+ if not hidden then
begin
- //!!!! icon (check for contact menu)
- mi.flags:=mi.flags or CMIM_ICON or CMIM_FLAGS{ or CMIF_ICONFROMICOLIB};
-
if (mtype=contact_menu) and IsLocalItem(UActionList[i]) then
begin
lastContact:=hContact;
if ((flags and UAF_2STATE)<>0) and
(DBReadByte(hContact,opt_ua,szNameID)<>0) then
begin
- mi.flags:=mi.flags or CMIF_CHECKED;
- mi.hIcon:=hIcolibIconPressed;
+ mflags:=mflags or CMIF_CHECKED;
+ icon:=hIcolibIconPressed;
extra:='1';
flags:=flags or UAF_PRESSED;
end
else
begin
- mi.hIcon:=hIcolibIcon;
+ icon:=hIcolibIcon;
flags:=flags and not UAF_PRESSED;
extra:='0';
end;
@@ -543,37 +541,36 @@ begin
begin
if (flags and (UAF_2STATE+UAF_PRESSED))=(UAF_2STATE+UAF_PRESSED) then
begin
- mi.flags:=mi.flags or CMIF_CHECKED;
- mi.hIcon:=hIcolibIconPressed;
+ mflags:=mflags or CMIF_CHECKED;
+ icon:=hIcolibIconPressed;
extra:='1';
end
else
begin
- mi.hIcon:=hIcolibIcon;
+ icon:=hIcolibIcon;
extra:='0';
end;
end;
// new name
- mi.flags:=mi.flags or CMIM_NAME or CMIF_UNICODE;
if (szMenuNameVars<>nil) and (szMenuNameVars^<>#0) then
begin
if (menu_opt and UAF_MNAMVAR)<>0 then
- mi.szName.w:=ParseVarString(szMenuNameVars,hContact,extra)
+ p:=ParseVarString(szMenuNameVars,hContact,extra)
else
- mi.szName.w:=szMenuNameVars;
+ p:=szMenuNameVars;
end
else
- mi.szName.w:=nil;
- if mi.szName.w=nil then
- mi.szName.w:=szActDescr;
+ p:=nil;
+ if p=nil then
+ p:=szActDescr;
end;
- CallService(MS_CLIST_MODIFYMENUITEM,hMenuItem,LPARAM(@mi));
+ Menu_ModifyItem(hMenuItem, p, icon, mflags);
- if (mi.szName.w<>szActDescr) and
- (mi.szName.w<>szMenuNameVars) then
- mFreeMem(mi.szName.w);
+ if (p<>szActDescr) and
+ (p<>szMenuNameVars) then
+ mFreeMem(p);
end;
end;
end;
diff --git a/plugins/QuickSearch/quicksearch.dpr b/plugins/QuickSearch/quicksearch.dpr
index 621aaabbe0..c712d74d88 100644
--- a/plugins/QuickSearch/quicksearch.dpr
+++ b/plugins/QuickSearch/quicksearch.dpr
@@ -47,14 +47,9 @@ end;
function IconChanged(wParam:WPARAM;lParam:LPARAM):int;cdecl;
var
- mi:TCListMenuItem;
ttb:TTBButton;
begin
result:=0;
- FillChar(mi,SizeOf(mi),0);
- mi.flags :=CMIM_ICON;
- mi.hIcon:=IcoLib_GetIcon(QS_QS,0);
- CallService(MS_CLIST_MODIFYMENUITEM,MainMenuItem,tlparam(@mi));
// toptoolbar
if ServiceExists(MS_TTB_GETBUTTONOPTIONS)<>0 then
diff --git a/plugins/QuickSearch/sr_window.pas b/plugins/QuickSearch/sr_window.pas
index cfb87558a2..ef57002e26 100644
--- a/plugins/QuickSearch/sr_window.pas
+++ b/plugins/QuickSearch/sr_window.pas
@@ -818,10 +818,7 @@ begin
mnuhandle:=Menu_AddContactMenuItem(@mi);
end
else
- begin
- mi.flags :=CMIM_FLAGS;
- CallService(MS_CLIST_MODIFYMENUITEM,mnuhandle,LPARAM(@mi));
- end;
+ Menu_ModifyItem(mnuhandle, nil, INVALID_HANDLE_VALUE, 0);
end;
end;
@@ -834,11 +831,7 @@ begin
end;
// Due to stupid miranda logic, we need to clear tails at service processing, not earlier
if doit then
- begin
- mi.flags :=CMIM_FLAGS or CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM,mnuhandle,LPARAM(@mi));
- end;
-
+ Menu_ShowItem(mnuhandle, 0);
end
else
result:=0;
diff --git a/plugins/Watrack/i_gui.inc b/plugins/Watrack/i_gui.inc
index 40f6683522..7b1dd90843 100644
--- a/plugins/Watrack/i_gui.inc
+++ b/plugins/Watrack/i_gui.inc
@@ -45,22 +45,12 @@ end;
procedure ChangeMenuIcons(f1:cardinal);
var
- mi:tClistMenuItem;
p:PAnsiChar;
begin
- FillChar(mi,sizeof(mi),0);
- mi.flags :=CMIM_NAME+CMIM_FLAGS+CMIM_ICON+f1;
if f1<>0 then
- begin
- mi.hIcon :=IcoLib_GetIcon(IcoBtnDisable,0);
- mi.szName.a:='Enable WATrack';
- end
+ Menu_ModifyItem(hMenuDisable, 'Enable WATrack', IcoLib_GetIcon(IcoBtnDisable,0), f1)
else
- begin
- mi.hIcon :=IcoLib_GetIcon(IcoBtnEnable,0);
- mi.szName.a:='Disable WATrack';
- end;
- CallService(MS_CLIST_MODIFYMENUITEM,hMenuDisable,lparam(@mi));
+ Menu_ModifyItem(hMenuDisable, 'Disable WATrack', IcoLib_GetIcon(IcoBtnEnable,0));
if ServiceExists(MS_TTB_SETBUTTONSTATE)<>0 then
begin
@@ -81,15 +71,10 @@ end;
function IconChanged(wParam:WPARAM;lParam:LPARAM):int;cdecl;
var
- mi:TCListMenuItem;
ttb:m_api.TTBButton;
begin
result:=0;
- FillChar(mi,SizeOf(mi),0);
- mi.flags :=CMIM_ICON;
-
- mi.hIcon:=IcoLib_GetIcon(IcoBtnEnable,0);
- CallService(MS_CLIST_MODIFYMENUITEM,hMenuDisable,tlparam(@mi));
+ Menu_ModifyItem(hMenuDisable, nil, IcoLib_GetIcon(IcoBtnEnable,0));
// toptoolbar
if ServiceExists(MS_TTB_GETBUTTONOPTIONS)<>0 then
diff --git a/plugins/Watrack/lastfm/lastfm.pas b/plugins/Watrack/lastfm/lastfm.pas
index bc7d3bf727..b814359974 100644
--- a/plugins/Watrack/lastfm/lastfm.pas
+++ b/plugins/Watrack/lastfm/lastfm.pas
@@ -17,7 +17,6 @@ const
IcoLastFM:pAnsiChar = 'WATrack_lasfm';
var
lfm_tries:integer;
- sic:THANDLE;
slastinf:THANDLE;
slast:THANDLE;
const
@@ -81,7 +80,6 @@ end;
function NewPlStatus(wParam:WPARAM;lParam:LPARAM):int;cdecl;
var
flag:integer;
- mi:TCListMenuItem;
begin
result:=0;
case wParam of
@@ -113,9 +111,7 @@ begin
else // like 1
exit
end;
- FillChar(mi,sizeof(mi),0);
- mi.flags :=CMIM_FLAGS+flag;
- CallService(MS_CLIST_MODIFYMENUITEM,hMenuLast,tlparam(@mi));
+ Menu_ModifyItem(hMenuLast, nil, INVALID_HANDLE_VALUE, flag);
end;
WAT_EVENT_PLAYERSTATUS: begin
@@ -135,17 +131,6 @@ end;
{$i i_last_dlg.inc}
-function IconChanged(wParam:WPARAM;lParam:LPARAM):int;cdecl;
-var
- mi:TCListMenuItem;
-begin
- result:=0;
- FillChar(mi,SizeOf(mi),0);
- mi.flags :=CMIM_ICON;
- mi.hIcon :=IcoLib_GetIcon(IcoLastFM,0);
- CallService(MS_CLIST_MODIFYMENUITEM,hMenuLast,tlparam(@mi));
-end;
-
function SrvLastFMInfo(wParam:WPARAM;lParam:LPARAM):int;cdecl;
var
data:tLastFMInfo;
@@ -160,19 +145,15 @@ begin
end;
function SrvLastFM(wParam:WPARAM;lParam:LPARAM):int;cdecl;
-var
- mi:TCListMenuItem;
begin
- FillChar(mi,sizeof(mi),0);
- mi.flags :=CMIM_NAME;
if odd(lfm_on) then
begin
- mi.szName.a:='Disable scrobbling';
+ Menu_ModifyItem(hMenuLast,'Disable scrobbling');
lfm_on:=lfm_on and not 1;
end
else
begin
- mi.szName.a:='Enable scrobbling';
+ Menu_ModifyItem(hMenuLast,'Enable scrobbling');
lfm_on:=lfm_on or 1;
if hTimer<>0 then
begin
@@ -180,7 +161,6 @@ begin
hTimer:=0;
end;
end;
- CallService(MS_CLIST_MODIFYMENUITEM,hMenuLast,tlparam(@mi));
result:=ord(not odd(lfm_on));
end;
@@ -220,9 +200,6 @@ begin
result:=0;
end;
-var
- plStatusHook:THANDLE;
-
function InitProc(aGetStatus:boolean=false):integer;
begin
slastinf:=CreateServiceFunction(MS_WAT_LASTFMINFO,@SrvLastFMInfo);
@@ -246,9 +223,8 @@ begin
slast:=CreateServiceFunction(MS_WAT_LASTFM,@SrvLastFM);
if hMenuLast=0 then
CreateMenus;
- sic:=HookEvent(ME_SKIN2_ICONSCHANGED,@IconChanged);
if (lfm_on and 4)=0 then
- plStatusHook:=HookEvent(ME_WAT_NEWSTATUS,@NewPlStatus);
+ HookEvent(ME_WAT_NEWSTATUS,@NewPlStatus);
end;
procedure DeInitProc(aSetDisable:boolean);
@@ -261,8 +237,6 @@ begin
CallService(MO_REMOVEMENUITEM,hMenuLast,0);
hMenuLast:=0;
DestroyServiceFunction(slast);
- UnhookEvent(plStatusHook);
- UnhookEvent(sic);
if hTimer<>0 then
begin
diff --git a/plugins/Watrack/make.bat b/plugins/Watrack/make.bat
index 4314ed0ac4..504991c712 100644
--- a/plugins/Watrack/make.bat
+++ b/plugins/Watrack/make.bat
@@ -15,16 +15,16 @@ set PROJECT=Watrack
if not exist %OUTDIR% mkdir %OUTDIR%
md tmp
-brcc32.exe res\watrack.rc -fores\watrack.res
-brcc32.exe lastfm\lastfm.rc -folastfm\lastfm.res
-brcc32.exe myshows\myshows.rc -fomyshows\myshows.res
-brcc32.exe players\mradio.rc -foplayers\mradio.res
-brcc32.exe kolframe\frm.rc -fokolframe\frm.res
-brcc32.exe popup\popup.rc -fopopup\popup.res
-brcc32.exe proto\proto.rc -foproto\proto.res
-brcc32.exe stat\stat.rc -fostat\stat.res
-brcc32.exe status\status.rc -fostatus\status.res
-brcc32.exe templates\templates.rc -fotemplates\templates.res
+rem brcc32.exe res\watrack.rc -fores\watrack.res
+rem brcc32.exe lastfm\lastfm.rc -folastfm\lastfm.res
+rem brcc32.exe myshows\myshows.rc -fomyshows\myshows.res
+rem brcc32.exe players\mradio.rc -foplayers\mradio.res
+rem brcc32.exe kolframe\frm.rc -fokolframe\frm.res
+rem brcc32.exe popup\popup.rc -fopopup\popup.res
+rem brcc32.exe proto\proto.rc -foproto\proto.res
+rem brcc32.exe stat\stat.rc -fostat\stat.res
+rem brcc32.exe status\status.rc -fostatus\status.res
+rem brcc32.exe templates\templates.rc -fotemplates\templates.res
%FPCBIN% @..\Utils.pas\fpc.cfg %PROJECT%.dpr %3 %4 %5 %6 %7 %8 %9
if errorlevel 1 exit /b 1
diff --git a/plugins/Watrack/myshows/myshows.pas b/plugins/Watrack/myshows/myshows.pas
index d70c7da8a3..af79485133 100644
--- a/plugins/Watrack/myshows/myshows.pas
+++ b/plugins/Watrack/myshows/myshows.pas
@@ -29,10 +29,7 @@ type
end;
var
msh_tries,
-// msh_timeout,
msh_scrobpos:integer;
- sic:THANDLE;
-// slastinf:THANDLE;
slast:THANDLE;
MSData:tMyShowsData;
const
@@ -100,7 +97,6 @@ end;
function NewPlStatus(wParam:WPARAM;lParam:LPARAM):int;cdecl;
var
flag:integer;
- mi:TCListMenuItem;
timervalue:integer;
begin
result:=0;
@@ -142,9 +138,7 @@ begin
else // like 1
exit
end;
- FillChar(mi,sizeof(mi),0);
- mi.flags :=CMIM_FLAGS+flag;
- CallService(MS_CLIST_MODIFYMENUITEM,hMenuMyShows,tlParam(@mi));
+ Menu_ModifyItem(hMenuMyShows, nil, INVALID_HANDLE_VALUE, flag);
end;
WAT_EVENT_PLAYERSTATUS: begin
@@ -164,17 +158,6 @@ end;
{$i i_myshows_dlg.inc}
-function IconChanged(wParam:WPARAM;lParam:LPARAM):int;cdecl;
-var
- mi:TCListMenuItem;
-begin
- result:=0;
- FillChar(mi,SizeOf(mi),0);
- mi.flags :=CMIM_ICON;
- mi.hIcon :=IcoLib_GetIcon(IcoMyShows,0);
- CallService(MS_CLIST_MODIFYMENUITEM,hMenuMyShows,tlParam(@mi));
-end;
-
(* kinopoisk link, cover, series?
function SrvMyShowsInfo(wParam:WPARAM;lParam:LPARAM):int;cdecl;
//var
@@ -193,19 +176,15 @@ begin
end;
*)
function SrvMyShows(wParam:WPARAM;lParam:LPARAM):int;cdecl;
-var
- mi:TCListMenuItem;
begin
- FillChar(mi,sizeof(mi),0);
- mi.flags :=CMIM_NAME;
if odd(msh_on) then
begin
- mi.szName.a:='Disable scrobbling';
+ Menu_ModifyItem(hMenuMyShows,'Disable scrobbling');
msh_on:=msh_on and not 1;
end
else
begin
- mi.szName.a:='Enable scrobbling';
+ Menu_ModifyItem(hMenuMyShows,'Enable scrobbling');
msh_on:=msh_on or 1;
if hTimer<>0 then
begin
@@ -213,7 +192,6 @@ begin
hTimer:=0;
end;
end;
- CallService(MS_CLIST_MODIFYMENUITEM,hMenuMyShows,tlParam(@mi));
result:=ord(not odd(msh_on));
end;
@@ -253,9 +231,6 @@ begin
result:=0;
end;
-var
- plStatusHook:THANDLE;
-
function InitProc(aGetStatus:boolean=false):integer;
begin
// slastinf:=CreateServiceFunction(MS_WAT_MYSHOWSINFO,@SrvMyShowsInfo);
@@ -279,9 +254,8 @@ begin
slast:=CreateServiceFunction(MS_WAT_MYSHOWS,@SrvMyShows);
if hMenuMyShows=0 then
CreateMenus;
- sic:=HookEvent(ME_SKIN2_ICONSCHANGED,@IconChanged);
if (msh_on and 4)=0 then
- plStatusHook:=HookEvent(ME_WAT_NEWSTATUS,@NewPlStatus);
+ HookEvent(ME_WAT_NEWSTATUS,@NewPlStatus);
end;
procedure DeInitProc(aSetDisable:boolean);
@@ -292,8 +266,6 @@ begin
;// DestroyServiceFunction(slastinf);
DestroyServiceFunction(slast);
- UnhookEvent(plStatusHook);
- UnhookEvent(sic);
if hTimer<>0 then
begin
diff --git a/plugins/Watrack/popup/pop_vars.inc b/plugins/Watrack/popup/pop_vars.inc
index 0eee668070..61e7edb9f7 100644
--- a/plugins/Watrack/popup/pop_vars.inc
+++ b/plugins/Watrack/popup/pop_vars.inc
@@ -19,7 +19,7 @@ var
IsFreeImagePresent:boolean;
var
hMenuInfo :THANDLE;
- ssmi,sic,
+ ssmi,
plStatusHook:THANDLE;
PopupPresent:bool;
onttbhook,
diff --git a/plugins/Watrack/popup/popups.pas b/plugins/Watrack/popup/popups.pas
index fe01254a62..cf149f0adf 100644
--- a/plugins/Watrack/popup/popups.pas
+++ b/plugins/Watrack/popup/popups.pas
@@ -312,7 +312,6 @@ end;
function NewPlStatus(wParam:WPARAM;lParam:LPARAM):int;cdecl;
var
- mi:TCListMenuItem;
flag:integer;
begin
result:=0;
@@ -333,22 +332,14 @@ begin
else // like 1
exit
end;
- FillChar(mi,sizeof(mi),0);
- mi.flags :=CMIM_FLAGS+flag;
- CallService(MS_CLIST_MODIFYMENUITEM,hMenuInfo,tlparam(@mi));
+ Menu_ModifyItem(hMenuInfo, nil, INVALID_HANDLE_VALUE, flag);
end;
end;
end;
function IconChanged(wParam:WPARAM;lParam:LPARAM):int;cdecl;
-var
- mi:TCListMenuItem;
begin
result:=0;
- FillChar(mi,SizeOf(mi),0);
- mi.flags :=CMIM_ICON;
- mi.hIcon :=IcoLib_GetIcon(IcoBtnInfo,0);
- CallService(MS_CLIST_MODIFYMENUITEM,hMenuInfo,tlparam(@mi));
if ActionList<>nil then
begin
mFreeMem(ActionList);
@@ -479,7 +470,7 @@ begin
sid.szDescription.a:='Music Info';
Skin_AddIcon(@sid);
DestroyIcon(sid.hDefaultIcon);
- sic:=HookEvent(ME_SKIN2_ICONSCHANGED,@IconChanged);
+ HookEvent(ME_SKIN2_ICONSCHANGED,@IconChanged);
FillChar(mi,SizeOf(mi),0);
mi.szPopupName.a:=PluginShort;
@@ -536,7 +527,6 @@ begin
CallService(MO_REMOVEMENUITEM,hMenuInfo,0);
UnhookEvent(plStatusHook);
DestroyServiceFunction(ssmi);
- UnhookEvent(sic);
freepopup;
diff --git a/plugins/Watrack/proto/proto.pas b/plugins/Watrack/proto/proto.pas
index dffc70e380..2d4e488d41 100644
--- a/plugins/Watrack/proto/proto.pas
+++ b/plugins/Watrack/proto/proto.pas
@@ -48,10 +48,7 @@ const
var
hSRM,
hGCI,
- icchangedhook,
- hAddUserHook,
- hContactMenuItem,
- contexthook:THANDLE;
+ hContactMenuItem: THANDLE;
ProtoText:pWideChar;
HistMask:cardinal;
@@ -299,15 +296,11 @@ begin
end;
function OnContactMenu(hContact:WPARAM;lParam:LPARAM):int;cdecl;
-var
- mi:TCListMenuItem;
begin
- FillChar(mi,SizeOf(mi),0);
if IsMirandaUser(hContact)<=0 then
- mi.flags:=CMIF_NOTOFFLINE or CMIF_NOTOFFLIST or CMIM_FLAGS or CMIF_HIDDEN
+ Menu_ShowItem(hContactMenuItem, 0)
else
- mi.flags:=CMIF_NOTOFFLINE or CMIF_NOTOFFLIST or CMIM_FLAGS;
- CallService(MS_CLIST_MODIFYMENUITEM,hContactMenuItem,tlparam(@mi));
+ Menu_ShowItem(hContactMenuItem, 1);
result:=0;
end;
@@ -323,18 +316,6 @@ begin
hSRM:=CreateProtoServiceFunction(PluginShort,PSR_MESSAGE ,@ReceiveMessageProcW);
end;
-function IconChanged(wParam:WPARAM;lParam:LPARAM):int;cdecl;
-var
- mi:TCListMenuItem;
-begin
- result:=0;
- FillChar(mi,SizeOf(mi),0);
- mi.flags :=CMIM_ICON;
-
- mi.hIcon:=IcoLib_GetIcon(IcoBtnContext,0);
- CallService(MS_CLIST_MODIFYMENUITEM,hContactMenuItem,tlparam(@mi));
-end;
-
procedure RegisterIcons;
var
sid:TSKINICONDESC;
@@ -349,8 +330,6 @@ begin
sid.szDescription.a:='Context Menu';
Skin_AddIcon(@sid);
DestroyIcon(sid.hDefaultIcon);
-//!!
- icchangedhook:=HookEvent(ME_SKIN2_ICONSCHANGED,@IconChanged);
end;
// ------------ base interface functions -------------
@@ -385,8 +364,8 @@ begin
SetProtocol;
RegisterContacts;
hGCI:=CreateServiceFunction(MS_WAT_GETCONTACTINFO,@SendRequest);
- contexthook :=HookEvent(ME_CLIST_PREBUILDCONTACTMENU,@OnContactMenu);
- hAddUserHook:=HookEvent(ME_DB_CONTACT_ADDED ,@HookAddUser);
+ HookEvent(ME_CLIST_PREBUILDCONTACTMENU,@OnContactMenu);
+ HookEvent(ME_DB_CONTACT_ADDED ,@HookAddUser);
end;
procedure DeInitProc(aSetDisable:boolean);
@@ -394,10 +373,6 @@ begin
if aSetDisable then
SetModStatus(0);
- UnhookEvent(hAddUserHook);
- UnhookEvent(contexthook);
- UnhookEvent(icchangedhook);
-
DestroyServiceFunction(hSRM);
DestroyServiceFunction(hGCI);
mFreeMem(ProtoText);
diff --git a/plugins/Watrack/stat/statlog.pas b/plugins/Watrack/stat/statlog.pas
index 461b4c31bf..38a8f01af8 100644
--- a/plugins/Watrack/stat/statlog.pas
+++ b/plugins/Watrack/stat/statlog.pas
@@ -515,7 +515,6 @@ end;
function NewPlStatus(wParam:WPARAM;lParam:LPARAM):int;cdecl;
var
flag:integer;
- mi:tClistMenuItem;
CurTime:dword;
begin
result:=0;
@@ -543,24 +542,11 @@ begin
else // like 1
exit
end;
- FillChar(mi,sizeof(mi),0);
- mi.flags :=CMIM_FLAGS+flag;
- CallService(MS_CLIST_MODIFYMENUITEM,hMenuReport,tlparam(@mi));
+ Menu_ModifyItem(hMenuReport, nil, INVALID_HANDLE_VALUE, flag);
end;
end;
end;
-function IconChanged(wParam:WPARAM;lParam:LPARAM):int;cdecl;
-var
- mi:TCListMenuItem;
-begin
- result:=0;
- FillChar(mi,SizeOf(mi),0);
- mi.flags :=CMIM_ICON;
- mi.hIcon :=IcoLib_GetIcon(IcoBtnReport,0);
- CallService(MS_CLIST_MODIFYMENUITEM,hMenuReport,tlparam(@mi));
-end;
-
// ------------ base interface functions -------------
function InitProc(aGetStatus:boolean=false):integer;
@@ -594,7 +580,6 @@ begin
sid.szDescription.a:='Create Report';
Skin_AddIcon(@sid);
DestroyIcon(sid.hDefaultIcon);
- sic:=HookEvent(ME_SKIN2_ICONSCHANGED,@IconChanged);
FillChar(mi, sizeof(mi), 0);
mi.szPopupName.a:=PluginShort;
@@ -612,8 +597,6 @@ begin
SetModStatus(0);
CallService(MO_REMOVEMENUITEM,hMenuReport,0);
- UnhookEvent(plStatusHook);
- UnhookEvent(sic);
DestroyServiceFunction(hPackLog);
DestroyServiceFunction(hMakeReport);
DestroyServiceFunction(hAddToLog);
diff --git a/plugins/mRadio/i_tray.inc b/plugins/mRadio/i_tray.inc
index 3ccdccc045..7ed794c1a7 100644
--- a/plugins/mRadio/i_tray.inc
+++ b/plugins/mRadio/i_tray.inc
@@ -232,45 +232,21 @@ begin
end;
function TrayPrebuild(wParam:WPARAM;lParam:LPARAM):int; cdecl;
-var
- mi:tClistMenuItem;
- playstr:pWideChar;
- ico:pAnsiChar;
begin
- FillChar(mi,sizeof(mi),0);
-
- mi.flags:=CMIM_NAME or CMIF_UNICODE;
if PluginStatus=ID_STATUS_ONLINE then
- begin
- playstr:='mRadio off';
- end
+ Menu_ModifyItem(trayprotoh, 'mRadio off')
else
- begin
- playstr:='mRadio on';
- end;
- mi.szName.w:=playstr;
- CallService(MS_CLIST_MODIFYMENUITEM,trayprotoh,tlparam(@mi));
+ Menu_ModifyItem(trayprotoh, 'mRadio on');
if gVolume<0 then
- begin
- ico:=IcoBtnOff;
- end
+ Menu_ModifyItem(traymute, nil, IcoLib_GetIcon(IcoBtnOff,0))
else
- begin
- ico:=IcoBtnOn;
- end;
- mi.flags:=CMIM_FLAGS or CMIM_ICON;
- mi.hIcon:=IcoLib_GetIcon(ico,0);
- CallService(MS_CLIST_MODIFYMENUITEM,traymute,tlparam(@mi));
- mi.hIcon:=0;
+ Menu_ModifyItem(traymute, nil, IcoLib_GetIcon(IcoBtnOn,0));
- mi.flags:=CMIM_NAME or CMIF_UNICODE;
if CallService(MS_RADIO_COMMAND,MRC_STATUS,RD_STATUS_GET)<>RD_STATUS_PLAYING then
- playstr:='Play'
+ Menu_ModifyItem(trayplay, 'Play')
else
- playstr:='Pause';
- mi.szName.w:=playstr;
- CallService(MS_CLIST_MODIFYMENUITEM,trayplay,tlparam(@mi));
+ Menu_ModifyItem(trayplay, 'Pause');
MakeStationsMenu();
result:=0;
diff --git a/plugins/mRadio/i_visual.inc b/plugins/mRadio/i_visual.inc
index 915c001aa0..f3ab3615a5 100644
--- a/plugins/mRadio/i_visual.inc
+++ b/plugins/mRadio/i_visual.inc
@@ -4,45 +4,24 @@ var
hCMenuItemPlay:THANDLE;
function OnContactMenu(hContact:WPARAM;lParam:LPARAM):int;cdecl;
-var
- mi:TCListMenuItem;
begin
- FillChar(mi,SizeOf(mi),0);
if StrCmp(Proto_GetProtoName(hContact),PluginName)<>0 then
- begin
- mi.flags:=CMIM_FLAGS or CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM,hCMenuItemPlay,tlparam(@mi));
- end
+ Menu_ShowItem(hCMenuItemPlay, 0)
else
begin
// play/Stop
- mi.flags:=CMIM_FLAGS or CMIM_ICON or CMIM_NAME;
if THANDLE(hContact)<>ActiveContact then
- begin
- mi.szName.a:='Start broadcasting';
- mi.hIcon:=IcoLib_GetIcon(IcoBtnOn,0);
- end
+ Menu_ModifyItem(hCMenuItemPlay, 'Start broadcasting', IcoLib_GetIcon(IcoBtnOn,0))
else
- begin
- mi.szName.a:='Stop broadcasting';
- mi.hIcon:=IcoLib_GetIcon(IcoBtnOff,0);
- end;
- CallService(MS_CLIST_MODIFYMENUITEM,hCMenuItemPlay,tlparam(@mi));
+ Menu_ModifyItem(hCMenuItemPlay, 'Stop broadcasting', IcoLib_GetIcon(IcoBtnOff,0));
// record
- mi.flags:=CMIM_FLAGS or CMIM_ICON or CMIM_NAME;
if Service_RadioRecord(0,1)<>0 then
- begin
- mi.szName.a:='Stop record';
- mi.hIcon:=IcoLib_GetIcon(IcoBtnRecDn,0);
- end
+ Menu_ModifyItem(hCMenuItemRec, 'Stop record', IcoLib_GetIcon(IcoBtnRecDn,0))
else
- begin
- mi.szName.a:='Start record';
- mi.hIcon:=IcoLib_GetIcon(IcoBtnRecUp,0);
- end;
+ Menu_ModifyItem(hCMenuItemRec, 'Start record', IcoLib_GetIcon(IcoBtnRecUp,0));
end;
- CallService(MS_CLIST_MODIFYMENUITEM,hCMenuItemRec,tlparam(@mi));
+
result:=0;
end;