From fbfa53dcd5e9622613286c32ee2cab42aec0897e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 22 Jun 2015 21:27:15 +0000 Subject: Menu_ModifyItem applied to the pascal code git-svn-id: http://svn.miranda-ng.org/main/trunk@14335 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Watrack/proto/proto.pas | 35 +++++------------------------------ 1 file changed, 5 insertions(+), 30 deletions(-) (limited to 'plugins/Watrack/proto/proto.pas') 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); -- cgit v1.2.3