How to disable a command like 'Exclusive Mode' on startup

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
MaSeife
User
Posts: 16
Joined: Thu Jun 27, 2019 11:21 am

How to disable a command like 'Exclusive Mode' on startup

Post by MaSeife »

How do I programmatically disable the 'Exclusive Mode' (the crown button) on startup / initialization of the PDF-XChange? The command ID is cmd.tool.exclusiveMode but when I try something like

Code: Select all

getInst().Settings().SetBool("cmd.tool.exclusiveMode", false)
I get a 'com.sun.jna.platform.win32.COM.COMException: Falscher Parameter.(HRESULT: 80070057) (puArgErr=)'.

Am I just using the wrong ID or do I generally use the wrong approach for this? When calling it at the same code position for example with

Code: Select all

getInst().Settings().SetBool("Tools.Line.ExclusiveMode", false)
I don't get the error. But this is not the right key for the actual user case :-)
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: How to disable a command like 'Exclusive Mode' on startup

Post by Tracker Supp-Stefan »

Hello MaSeife,

I believe that this property is stored per type of tool, so you will likely need to get the active tool:
https://sdkhelp.pdf-xchange.com/vi ... ActiveTool
check it's exclusive mode:
https://sdkhelp.pdf-xchange.com/vi ... sExclusive
and toggle it once you know for which tool you want to apply that.

Kind regards,
Stefan
MaSeife
User
Posts: 16
Joined: Thu Jun 27, 2019 11:21 am

Re: How to disable a command like 'Exclusive Mode' on startup

Post by MaSeife »

Hallo Stefan,

when opening/initializing the app, there is neither an active document nor an active tool. Therefore the getActiveTool()-Method isn't really applicable at this moment and isExclusive() can't be called.

And even if it were I couldn't find a corresponding setExclusive()-method to deactivate the 'Exclusive Mode'.

Isn't it possible to get some useful object with the id 'cmd.tool.exclusiveMode'?

Regards,
Markus
MaSeife
User
Posts: 16
Joined: Thu Jun 27, 2019 11:21 am

Re: How to disable a command like 'Exclusive Mode' on startup

Post by MaSeife »

Hi Stefan,

after some trial and error and initially setting an empty document I found a solution :-) The following did what I needed:

Code: Select all

if (getActiveDocument().ActiveTool().IsExclusive(getActiveDocument())) {
	getInst().ExecUICmd("cmd.tool.exclusiveMode", getInst().ActiveMainFrm().Obj());
}
Regards,
Markus
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17824
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: How to disable a command like 'Exclusive Mode' on startup

Post by Tracker Supp-Stefan »

Hello Markus,

Glad to hear that you have figured it out!

Kind regards,
Stefan
Post Reply