Re: send CTRL-C to dchtmlviewer
Posted: Fri Mar 20, 2020 7:12 am
Hi,
Sending the key was working, the problem I had was setting focus to the PDF control in the htmlviewer. It seems as this isn't possible.
Once you click somewhere on an xbase++ control, the pdfcontrol loses the focus. There seems no way to set it back.
However, I found a solution for this with an eventhandler.
When a user select something in the pdfcontrol, the control has focus. As soon as the mouse cursor is out of the range of that pdfcontrol, the eventhandler detects this movement. The only thing you have to do is 'detecting' this and sending the CTRL-C. The PDFcontrol still has focus, and the CTRL-C is send to it.
Now I have the solution I want:
1. user clicks in the PDF control to select a word.
2. Moves the mouse cursor to a get. (CTRL-C is send by the event handler, so the selected text is put in the clipboard)
3. User clicks on the get, and in the gotfocus block, I read the clipboard.
My customer processes about 600 invoices a day, where ther need to copy/paste about 5 elements. This is about 3000 times a day to copy/paste. Now they can do it without these 3000 clicks.
Sending the key was working, the problem I had was setting focus to the PDF control in the htmlviewer. It seems as this isn't possible.
Once you click somewhere on an xbase++ control, the pdfcontrol loses the focus. There seems no way to set it back.
However, I found a solution for this with an eventhandler.
When a user select something in the pdfcontrol, the control has focus. As soon as the mouse cursor is out of the range of that pdfcontrol, the eventhandler detects this movement. The only thing you have to do is 'detecting' this and sending the CTRL-C. The PDFcontrol still has focus, and the CTRL-C is send to it.
Now I have the solution I want:
1. user clicks in the PDF control to select a word.
2. Moves the mouse cursor to a get. (CTRL-C is send by the event handler, so the selected text is put in the clipboard)
3. User clicks on the get, and in the gotfocus block, I read the clipboard.
My customer processes about 600 invoices a day, where ther need to copy/paste about 5 elements. This is about 3000 times a day to copy/paste. Now they can do it without these 3000 clicks.