bb.donnay-software.com

Donnay Software Web Forums
It is currently Tue Aug 04, 2020 1:49 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: Wed Mar 18, 2020 2:12 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4144
Location: Boise, Idaho USA
We would need to know what the Input() class is.
Where does it come from?

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
PostPosted: Thu Mar 19, 2020 3:10 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 864
Location: Sijsele, Belgium
Hi Roger,

I suppose it comes from ot4xb.

_________________
Best regards,

Chris.
www.aboservice.be


Top
 Profile  
 
PostPosted: Thu Mar 19, 2020 5:00 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 864
Location: Sijsele, Belgium
The following code comes from the htmleditor. It can be used to send a keystroke to the active application.

Problem is that I don't succeed to set the dc_htmlviewer as active or as focused component/dialog.
In the htmleditor code there is a COPY method and a SETFOCUS() method. It looks as the setfocus doesn't work when a PDF file is shown in the htmlviewer. The methods hasfocus() and focus() don't exist in the adobe activex for the pdf viewer.

I tried with events as ldDblClick, Killinputfocus, setInputFocus but I don't succeed.


Code:
*****************************
PROCEDURE SendCtrlKey( xKey )
*****************************
LOCAL oInput := Input():New()
LOCAL nEvents:=  4
LOCAL nSize  := oInput:_sizeof_()
LOCAL pBuffer:= _xgrab( nSize * nEvents  )

oInput:_link_( pBuffer , .F.)
   oInput:type  := INPUT_KEYBOARD
   oInput:ki:wVk:= VK_CONTROL

GwstArrayNext(oInput)
   oInput:type  := INPUT_KEYBOARD
   oInput:ki:wVk:= xKey

GwstArrayNext(oInput)
   oInput:type      := INPUT_KEYBOARD
   oInput:ki:wVk    := VK_CONTROL
   oInput:ki:dwFlags:= KEYEVENTF_KEYUP

GwstArrayNext(oInput)
   oInput:type      := INPUT_KEYBOARD
   oInput:ki:wVk    := xKey
   oInput:ki:dwFlags:= KEYEVENTF_KEYUP

@user32:SendInput( nEvents, pBuffer, nSize )

oInput:_unlink_()
_xfree( pBuffer)
RETURN


*********************
BEGIN STRUCTURE INPUT
*********************
   MEMBER DWORD type
   BEGIN UNION
   MEMBER @ MOUSEINPUT mi
   MEMBER @ KEYBDINPUT ki
   MEMBER @ HARDWAREINPUT hi
   END UNION
END STRUCTURE // 28 // BYTES

**************************
BEGIN STRUCTURE MOUSEINPUT
**************************
   MEMBER LONG dx
   MEMBER LONG dy
   MEMBER DWORD mouseData
   MEMBER DWORD dwFlags
   MEMBER DWORD time
   MEMBER DWORD dwExtraInfo
END STRUCTURE // 24 BYTES

**************************
BEGIN STRUCTURE KEYBDINPUT
**************************
   MEMBER WORD wVk
   MEMBER WORD wScan
   MEMBER DWORD dwFlags
   MEMBER DWORD time
   MEMBER DWORD dwExtraInfo
END STRUCTURE // 16 BYTES

*****************************
BEGIN STRUCTURE HARDWAREINPUT
*****************************
   MEMBER DWORD uMsg
   MEMBER WORD wParamL
   MEMBER WORD wParamH
END STRUCTURE // 8 BYTES


_________________
Best regards,

Chris.
www.aboservice.be


Top
 Profile  
 
PostPosted: Thu Mar 19, 2020 7:21 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4144
Location: Boise, Idaho USA
Do you have a sample program that I can work with?

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
PostPosted: Thu Mar 19, 2020 7:36 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 864
Location: Sijsele, Belgium
Hi Roger,

The above comes from c:\exp20\Samples\HtmlEdit_2\

It is working when there is HTML in the viewer. Then there is oHtmlviewer:document. When there is a PDF showing, it isn't clear to me how to set focus to i

_________________
Best regards,

Chris.
www.aboservice.be


Top
 Profile  
 
PostPosted: Thu Mar 19, 2020 8:19 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 864
Location: Sijsele, Belgium
Roger,

Meanwhile I added some code to your fileviewer sample. This way it will be easier to start with it.

I added a button to send the CTRL-C to the active-X window.

This should be possible:
- Double click a word in the PDF.
- Click on the 'send CTRL-C' button, so the selected word is copied to the clipboard.

If you use CTRL-C on the keyboard, the copy is done.

There is some testing code in it, so you can see what I tried.

It is ready to compile and run.


Attachments:
fileviewer.zip [608.68 KiB]
Downloaded 106 times

_________________
Best regards,

Chris.
www.aboservice.be
Top
 Profile  
 
PostPosted: Thu Mar 19, 2020 8:22 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 864
Location: Sijsele, Belgium
I copied some methods from the html viewer sample. I also copied some functions that are used in that sample. This way the input object is created.

The necessary include files are also added.

I suppose you have the ot4xb.dll? If not, I added it to the zip-file.


Attachments:
fileviewer.zip [800.25 KiB]
Downloaded 108 times

_________________
Best regards,

Chris.
www.aboservice.be
Top
 Profile  
 
PostPosted: Thu Mar 19, 2020 9:05 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4144
Location: Boise, Idaho USA
I tried a bunch of changes to your test app but I cannot determine a way to do this.

My guess is that the PDFViewer ActiveX Control does not receive events from the XbpHtmlViewer Active X control.

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
PostPosted: Thu Mar 19, 2020 9:40 am 
Offline

Joined: Thu Jan 28, 2010 1:22 am
Posts: 864
Location: Sijsele, Belgium
Roger,

I tried it also in different ways, but I also didn't succeed.

Thanks for taking your time to test this.

_________________
Best regards,

Chris.
www.aboservice.be


Top
 Profile  
 
PostPosted: Thu Mar 19, 2020 11:30 am 
Offline
User avatar

Joined: Wed Feb 24, 2010 3:44 pm
Posts: 1189
hi,
skiman wrote:
I suppose it comes from ot4xb.

SendInput* is a API function which is used now while keybd_event** API function is deprecated
read more about Keyboard Input here***

* https://docs.microsoft.com/de-de/windows/win32/api/winuser/nf-winuser-sendinput?redirectedfrom=MSDN
** https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-keybd_event
*** https://docs.microsoft.com/de-de/windows/win32/inputdev/keyboard-input

Quote:
In the htmleditor code there is a COPY method and a SETFOCUS() method. It looks as the setfocus doesn't work when a PDF file is shown in the htmlviewer. The methods hasfocus() and focus() don't exist in the adobe activex for the pdf viewer.

you have to use Windows API function "SetFocus" not Xbase++ function

_________________
greetings by OHR
Jimmy


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: Google [Bot] and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group