Page 1 of 1

Recent Colors Used

Posted: Wed Sep 20, 2017 12:06 pm
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.

Re: Recent Colors Used

Posted: Wed Sep 20, 2017 12:22 pm
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

Re: Recent Colors Used

Posted: Wed Sep 20, 2017 2:32 pm
by RMan
Thanks so much that works much better than saving to the registry and reading the values from there. :D

Re: Recent Colors Used

Posted: Wed Sep 20, 2017 2:33 pm
by Sasha - Tracker Dev Team
:)