FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Copy a string into windows clipboard
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
Copy a string into windows clipboard
Posted: Mon Nov 24, 2014 10:45 PM

Hi all,
I need to write the string "ok" into the Windows clipboard.
I usually use
DEFINE CLIPBOARD oClp OF oWnd
oClp:SetText("ok")

but this is a Windows console application so I haven't a oWnd object. Any ideas ?

Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Copy a string into windows clipboard
Posted: Mon Nov 24, 2014 10:55 PM
Marco,
HB_GTINFO( HB_GTI_CLIPBOARDDATA, cTxt )
EMG
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
Re: Copy a string into windows clipboard
Posted: Tue Nov 25, 2014 10:11 AM

Hi Enrico,
I tried the following code but there is nothing in the clipboard.
Do you see anything wrong ?

include "FiveWin.ch"

define HB_GTI_CLIPBOARDDATA 15

function Main()

hb_gtInfo( HB_GTI_CLIPBOARDDATA, "test")
quit

Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Copy a string into windows clipboard
Posted: Tue Nov 25, 2014 10:46 AM
This works fine here:
#include "Hbgtinfo.ch"


FUNCTION MAIN()

    HB_GTINFO( HB_GTI_CLIPBOARDDATA, "Hello!" )

    RETURN NIL
EMG
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Copy a string into windows clipboard
Posted: Tue Nov 25, 2014 10:47 AM
Code (fw): Select all Collapse
#include "FiveWin.ch"


You can't use FW.

EMG

Continue the discussion