Remember the clever ideas of the non-window (windowless) npapiwindowless API plug-in and then the superb experience process to solve the problem.

Source: Internet
Author: User

Remember the clever ideas of the non-window (windowless) npapiwindowless API plug-in and then the superb experience process to solve the problem.

1: Problem

Integrates third-party ocx controls for pdf display and signature. If you use a window extension, load ocx to the window and display it on the webpage. However, this has a disadvantage. That is, the window will float on the webpage element, thus blocking the webpage element. Such as the webpage pop-up layer and drop-down box.

2: Solution

The handle of the non-window (windowless) Plug-in of Npapi is only an HDC, and only the items to be displayed can be drawn and output on this HDC. The following method is used:

1: create a window, load the ocx control in the window, hide the window, and process the event in the HandleEvent (windowless) of the plug-in, refresh the message in real time according to the ocx window handle (bmp format), and then output it to the interface through HDC In the bitmap. It seems that the solution has been solved.

However, ........ In this way, the mouse event cannot be performed in the ocx window. The windowless plug-in is an HDC, where all mouse events occur. It is also invalid to forward the mouse message to the ocx window through handlevent. As a result, it is difficult to scale down, zoom in, drag PDF files, and so on, which has an extreme impact on the user experience and require seamless support.

3. Transfer

Let's talk about it again, because I used to do some reverse engineering. Although the technology is very good, I have seen how others play, that is the basis, it reminds me of the methods used to capture technologies such as QQ passwords. That is: Get an invisible mask layer in the QQ Password box. When you enter the password, this mask layer is also responding to the corresponding message, and is always compatible with all problems. A radical spirit makes things turn around.

4: The technical difficulties to implement this method are as follows:

1) The Window follows, that is, the handle of the target window is obtained, the target window is tracked, and the coordinates of the target window are obtained through the sentence, so that the mask layer follows. The Npapi windowless plug-in has no handle and is an hdc. Hard!

2) coordinates of the Npapi plug-in relative to the browser and the screen.

3) the coordinates and sizes of the large web pages of the Npapi plug-in.

4) when the Npapi moves the mouse, it needs to remove the mask layer from the screen or hide it. Otherwise, it returns to the beginning and will float at the top of the page element, although invisible. However, operations on Webpage elements are affected because mouse messages are intercepted by the webpage.

5) Coordinate Conversion in multiple browsers

6) Coordinate Conversion and handle operations of multiple plug-ins on a single webpage.

7) Other small pitfalls ....

Conclusion:

Through baidu and google. In the end, it was a pitfall. The implementation process is complicated, but after solving the problem, it is indeed full of mood. Like.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.