简体   繁体   中英

IDocHostUIHandler TranslateAccelerator not allowing keyboard input

I implemented an AxWebBrowser control and added the IDocHostUIHandler to my Document at Navigation for custom contextmenu.

After research i found out that i have to

throw new System.Runtime.InteropServices.COMException("", 1); 

in the implementation of the TranslateAccelerator function, to calrify that i dont handle keyboard inputs.

First it worked, but today i compiled and Visual Studio is breaking with a first chance expression and keyboard inputs are not recognized anymore.

Background: used the approach to implement the interface like described in this link: http://www.codeproject.com/Articles/2491/Using-MSHTML-Advanced-Hosting-Interfaces

Found the answer. The problem was that i implemented ProcessCMDKey in my class which extends AxWebBrowser which is used in my manager class that implements the IDocHostUIHandler.

Just remove ProcessCMDKey and it works again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM