Remove Send Local option from Send Mail

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
aurimas
User
Posts: 4
Joined: Mon Mar 23, 2020 4:14 pm

Remove Send Local option from Send Mail

Post by aurimas »

Good day,

I was searching this forum for a way to hide an option from send mail list by default as I don't want my users saving files on their local disk and did not find one. Do you have a quick solution how to hide Local from the picture below?
send local.png
send local.png (15.07 KiB) Viewed 1762 times
I thought I would just hide the whole list (cmd.emailMethods.list), but then you can go to Manage and set the default method to Local. And I can't hide Manage as other mailing clients need to be set up.

Thanks,
Aurimas
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Remove Send Local option from Send Mail

Post by Sasha - Tracker Dev Team »

Hello aurimas,

Here's how you can do this:
viewtopic.php?f=66&t=31093&p=130537&hil ... er#p125354

Only you should extract the IUIX_List from the IUIX_Obj - then you can Remove the needed items.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
aurimas
User
Posts: 4
Joined: Mon Mar 23, 2020 4:14 pm

Re: Remove Send Local option from Send Mail

Post by aurimas »

Thanks for the reply,

I have implemented the handler and unfortunately my code does nothing, i thought this is because i should do things in OnCreateNewCtl(), but then it just breaks with no error. Could you point me to an exact place in the implementation of handler where do i put my deleting code?

Code: Select all

Public Sub OnNotify(nCode As Integer, pCmd As IUIX_Cmd, pItem As IUIX_CmdItem, pOwner As IUIX_Obj, nNotifyData As UInteger) Implements IUIX_CmdHandler.OnNotify
                Dim emailMethodsList As IUIX_List = CType(pItem.Ctl.Impl, IUIX_List)
                emailMethodsList.RemoveItems(1, 1)
                OldHandler.OnNotify(nCode, pCmd, pItem, pOwner, nNotifyData)
            End Sub
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Remove Send Local option from Send Mail

Post by Sasha - Tracker Dev Team »

Hello aurimas,

Please read all the way to the bottom:
viewtopic.php?f=66&t=31093&p=130537&hil ... er#p130537

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
aurimas
User
Posts: 4
Joined: Mon Mar 23, 2020 4:14 pm

Re: Remove Send Local option from Send Mail

Post by aurimas »

I have changed my implementation of a handler and moved logic to OnCreate

Code: Select all

Public Sub OnCreateNewCtl(pCmd As IUIX_Cmd, pParent As IUIX_CmdBar, ByRef pCtl As IUIX_Obj) Implements IUIX_CmdHandler.OnCreateNewCtl
                OldHandler.OnCreateNewCtl(pCmd, pParent, pCtl)

                Dim outPtr As IntPtr
                pCtl.QueryImpl(GetType(IUIX_List).GUID, Nothing, outPtr)
                Dim emailOptionsList As IUIX_List = CType(System.Runtime.InteropServices.Marshal.GetObjectForIUnknown(outPtr), IUIX_List)
                emailOptionsList.RemoveItems(2, 1)
            End Sub
This This did not remove anything and you can still set it as default under Preferences window. I need it gone from Preferences window too as you can set it as default and then use it with a click, with no list. Any further thoughts or am i still doing something wrong?
manage window.png
Should I assign the new handler on event when 'Manage' command is activated or the picker clicked, because when i try to assign new handler where other custom buttons are created, then i get error that command is not found :(
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Remove Send Local option from Send Mail

Post by Sasha - Tracker Dev Team »

Hello aurimas,

Well there is no other way of tweaking this unless removing the items from the list. The problem is that you don't know when you should remove that item. What can be done, is disabling the execution of the operation itself if the user clicks on Local in any window. If that works for you I can tell you how to do that.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply