Recent Colors Used

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
RMan
User
Posts: 221
Joined: Tue Jul 02, 2013 10:06 pm

Recent Colors Used

Post by RMan »

Is there anyway to read and change the Recently Used Colors values?

I know we can save the settings to the registry and read the values there but I figured there must be a direct way to get them also. I found the Misc.ColorRecents in the settings Cab but the Count is always 0 even after adding in some custom colors.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Recent Colors Used

Post by Sasha - Tracker Dev Team »

Hello RMan,

The mentioned CAB array updates when the e.app.beforeSaveUserSettings event is fired. Then the values that you put there will be shown. You can fire this event by yourself by using something like this:

Code: Select all

var evtID = pdfCtl.Inst.Str2ID("e.app.beforeSaveUserSettings", false);
IntPtr unkPtr = System.Runtime.InteropServices.Marshal.GetIUnknownForObject(Doc);
PDFXEdit.IEvent evt = Doc.EventServer.CreateNewEvent(evtID, (uint)unkPtr);
Doc.EventServer.FireEvent(evt, Doc);
Loading the settings from CAB is done by using the IPXV_Inst::LoadUserSettings method (sadly, that's the only way right now).

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
RMan
User
Posts: 221
Joined: Tue Jul 02, 2013 10:06 pm

Re: Recent Colors Used

Post by RMan »

Thanks so much that works much better than saving to the registry and reading the values from there. :D
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Recent Colors Used

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply