Windows - clipboard doesn't work

I’ve just run into a conundrum with my app - I’m running Windows 8.1.
The clipboard feature doesn’t seem to work. I’m doing everything right, but it doesn’t want to copy!
I know for a fact it works on Mac - but not on Windows. It worked on Windows 7…
Does anybody have any similar problems and/or solutions?

I have the problem with pictures:
feedback://showreport?report_id=30269

Your code would help.

It’s exactly the same as in the online examples.

I took the very simple example from the LR :

Dim c As New Clipboard Dim s As String s = c.Text c.Close

Modified it to :

  • Copy from a textfield to Windows
  • Fill the textfield from the Windows clipboard
  • Copy from an image to Windows
  • Set the window backdrop from the Windows clipboard

It works in all 4 cases under Windows 8.1 64 bit. Applications are Notepad and Paint.

  • Which application are you copying from ?
  • Which application are you pasting into ?
  • Text or graphics ?

Did you double check your code ?

Hi Sean and Michel,

The code works when it is run in Windows 8.1 64 on a Mac running parallels.

The code does not work when running Windows8.1 64 bit on its own.

Edit: I stand corrected, it worked 1 out of 4 tries on Windows 8.1 64 bit on its own

Hmm… Don’t know what to tell you… all examples on Xojo Clipboard Docs are working know.

I tested on Windows 8.1 64 bit on a hardware PC AMD dual core 3.1 Mhz. Reproductible results…

3.1 Ghz
I guess. :wink:

You could setfocus to the textfield and use a sendkeys (see other threads regarding this) function to send the ctrl+C (copy) keys for a safe 100% guaranteed-to-work workaround.

So in pseudo terms:

Dim s as String = SendKeys (CopyKeys)
Dim c as new Clipboard
C.Text = s
C.close

If you really want to use the clipboard object still, otherwise omit it. You can use a SendKeys function to do all sorts of neat things Xojo Classes instantly do not do. (Ie automate copy paste (any key events) between two different apps… using the object handles)

Forgot to add
Textfield.setfocus before declaring “s” in the pseudo code above.

[quote=98227:@Andre Kuiper]3.1 Ghz
I guess. ;)[/quote]

Of course. Thank you for correcting.