How do I read from Clipboard?

How do I read from Clipboard?

Postby dutch » Tue Oct 31, 2017 8:37 am

Dear all,

I need to copy to clipboard and use button to read from clipboard without pressing on keyboard.

I can use as below to copy to clipboard.
oGet:SelectAll()
oGet:Copy()

But I need to paste in another program (FWH) and I need to use button for paste from clipboard.

Thank you in advance for any idea.
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1553
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: How do I read from Clipboard?

Postby dutch » Tue Oct 31, 2017 8:55 am

Dear All,

I test by oGet:Paste() but it got an error;
Code: Select all  Expand view  RUN
  Error description: Error BASE/1111  Argument error: LEN
   Args:
     [   1] = U  

Stack Calls
===========
   Called from:  => LEN( 0 )
   Called from: TGET.PRG => TGET:PASTE( 1867 )
   Called from: testget.prg => (b)MAIN( 25 )

Error this line in TGET.PRG
Code: Select all  Expand view  RUN
     nLen = Len( ::oGet:Buffer )
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1553
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: How do I read from Clipboard?

Postby Enrico Maria Giordano » Tue Oct 31, 2017 9:08 am

Try this:

Code: Select all  Expand view  RUN
oClp = TClipBoard():New( , oDlg )

oClp:Open()

cTxt = oClp:GetText()

oClp:Close()


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8719
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: How do I read from Clipboard?

Postby dutch » Tue Oct 31, 2017 10:39 am

Dear EMG,

Thanks a lot. I've got it.
Enrico Maria Giordano wrote:Try this:

Code: Select all  Expand view  RUN
oClp = TClipBoard():New( , oDlg )

oClp:Open()

cTxt = oClp:GetText()

oClp:Close()


EMG
Regards,
Dutch

FWH 19.01 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio
FWPPC 10.02 / Harbour for PPC (FTDN)
ADS V.9 / MySql / MariaDB
R&R 12 Infinity / Crystal Report XI R2
(Thailand)
User avatar
dutch
 
Posts: 1553
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 47 guests