ShortcutText

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

tamih
User
Posts: 15
Joined: Wed Apr 03, 2013 12:43 pm

ShortcutText

Post by tamih »

Hi
I need to enable the user to use all the short-cut keys like "Ctlr+C" "Ctlr+V"...
I found that the application may use MsgToCommandAndExec , but when I try to use it an error happens.

Code: Select all

PDFView1.OpenDocument(val, 0, 0, 0); // open the file
 docID = PDFView1.Property("Documents.Active", 0);
 PDFView1.SetDocumentProperty(docID, "ReadOnly", "false", 0); // disables editing for specified document
 PDFView1.DoVerb("", "ExecuteCommand", "ToggleAllBars", 0, 0);
 PDFView1.DoVerb("", "MsgToCommandAndExec", DataIn(WM_KEYDOWN, 'O', 0, FCONTROL), DataOut, 0);		
			  
can anyone please write the correct syntax/code for enable all the keyboard shortcut.
thanks
Tami
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: ShortcutText

Post by Vasyl - PDF-XChange »

Hi, Tami.

In C# it will be:

Code: Select all

// turn on the shortcuts handling:
object dataIn = 1;
PDFView1.SetProperty("General.AllowAllAccelerators", dataIn, 0);
...
// run shortcut:
object[] args = new object[3];
args[0] = WM_KEYDOWN;
args[1] = 'O';
args[2] = FCONTROL; // 0x08
object dataIn = args;
object dataOut = null;
PDFView1.DoVerb(null, "MsgToCommandAndExec", dataIn, out dataOut, 0);
HTH
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.