Avoid right clicking on a document

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

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

Post Reply
afischer
User
Posts: 2
Joined: Thu Oct 20, 2016 12:08 pm

Avoid right clicking on a document

Post by afischer » Thu Oct 20, 2016 12:20 pm

Hello guys,

how can I suppress right clicking on a document?
Or how is it possible to suppress the shown context menu when right clicking on the document?

We are using the ActiveX element.

We tried with DenyAllContextMenus, but it didn´t work.

Maybe someone can help us.

Thanks!

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13376
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Avoid right clicking on a document

Post by Tracker Supp-Stefan » Thu Oct 20, 2016 2:31 pm

Hello afischer,

You can listen for mouse events, and when the right click is over the rendering area - just skip it:
http://help.tracker-software.com/DEV/de ... xactphrase

Regards,
Stefan

afischer
User
Posts: 2
Joined: Thu Oct 20, 2016 12:08 pm

Re: Avoid right clicking on a document

Post by afischer » Fri Oct 21, 2016 10:04 am

Hello Stefan,

thank you for your answer. I expressed myself indistinctly.
I dont want to avoid the Mouseclick itself. I want to avoid the Context Menu which is shown.
We are using a Touch Panel. When you tap and hold on the document, it simulates a right click.
And i guess it is not a mouse event.
Do you understand what i mean?

Thanks in advance!

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13376
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Avoid right clicking on a document

Post by Tracker Supp-Stefan » Fri Oct 21, 2016 10:29 am

Hello afischer,

I think I understood you correctly - maybe my reply was not 100% clear. Apologies for that!
The "skip" I refer to will make the Viewer ignore the right mouse click, so the event itself is there, and the user is not preventing from holding down on the screen. Just instead of showing the context menu, the Viewer will do nothing.
You can of course listen only for specific events (e.g. WM_RBUTTONDOWN) - detect over which part of the Viewer control this occurred, and then decide whether to allow the Viewer to process that normally (e.g. if it's a right click over a toolbar), or ignore it if it's over the main document area, and if you want - you can then implement some of your own custom logic and do other tasks when such a right click occurs.
Please check the code sample on the page I linked - hopefully it will clarify what happens when you handle the mouse events in the Viewer.

Regards,
Stefan

Post Reply