summaryrefslogtreecommitdiff
path: root/plugins/Watrack/proto
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-22 21:27:15 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-22 21:27:15 +0000
commitfbfa53dcd5e9622613286c32ee2cab42aec0897e (patch)
treee7305d55dd44df287c22b3eac0b73bb456ff1672 /plugins/Watrack/proto
parent88790eed4ffd9ca555c8f9b73cb014a93b57a34f (diff)
Menu_ModifyItem applied to the pascal code
git-svn-id: http://svn.miranda-ng.org/main/trunk@14335 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Watrack/proto')
-rw-r--r--plugins/Watrack/proto/proto.pas35
1 files changed, 5 insertions, 30 deletions
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);