How to detect between Save and Save AS

PDF-XChange Editor SDK for Developers

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

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
docu-track99
User
Posts: 495
Joined: Thu Dec 06, 2007 8:13 pm

How to detect between Save and Save AS

Post by docu-track99 » Fri May 20, 2016 8:43 pm

I would like to detect if user does Save or Save As.

I have implemented ON Event for pdfCtrl. See below.

Private Sub PdfCtrl_OnEvent(ByVal sender As Object, ByVal e As AxPDFXEdit._IPXV_ControlEvents_OnEventEvent) Handles pdfCtrl.OnEvent

My issue is, regardless what user clicks (Save or Save AS) it generates e.nEventID same (2264 gets genereted bor both Save and Save As). I would like to execute different code when doing Save As. Is there a programmatic way to detect which button has been pressed?

User avatar
Sasha - Tracker Dev Team
User
Posts: 4316
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to detect between Save and Save AS

Post by Sasha - Tracker Dev Team » Mon May 23, 2016 8:02 am

Hello docu-track99,

The best way would be to handle the command execution itself by implementing a custom command handler - there you will now the command ID that was executed:
https://gist.github.com/Polaringu/ad31ad433401c1c004d0

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

docu-track99
User
Posts: 495
Joined: Thu Dec 06, 2007 8:13 pm

Re: How to detect between Save and Save AS

Post by docu-track99 » Wed May 25, 2016 6:21 pm

Hello docu-track99,

The best way would be to handle the command execution itself by implementing a custom command handler - there you will now the command ID that was executed:
https://gist.github.com/Polaringu/ad31ad433401c1c004d0

Cheers,
Alex
Last edited by docu-track99 on Wed May 25, 2016 6:22 pm, edited 1 time in total.

docu-track99
User
Posts: 495
Joined: Thu Dec 06, 2007 8:13 pm

Re: How to detect between Save and Save AS

Post by docu-track99 » Wed May 25, 2016 6:22 pm

Hello Alex,

The link you gave me has code for OpenFileDialog, I still need tracker's code to implement FileSave in my customizeSaveCommandToolStripMenuItem.click.

Thanks,

User avatar
Sasha - Tracker Dev Team
User
Posts: 4316
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: How to detect between Save and Save AS

Post by Sasha - Tracker Dev Team » Thu May 26, 2016 7:09 am

The link I gave illustrates how to implement an overall custom command handler. The open command was given earlier to someone as an example. You'll need to implement something like that for save command. This will allow you to monitor when the command was executed.
One more thing - you will need a listener handler, meaning that you'll need to redirect all of the methods to previous handler. That all would look like this:
https://gist.github.com/Polaringu/16bb2 ... 7cbe36f4e6

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Post Reply