April 23, 2024, 12:31:36 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Clipboard problem

Started by billhsln, November 20, 2017, 05:41:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

billhsln

November 20, 2017, 05:41:28 PM Last Edit: November 20, 2017, 08:36:14 PM by billhsln
For work, I end up taking 2 rows in an Excel spread sheet and merging the text and then putting the merged text into on cell.  I would like to be able to copy it into the clipboard and then click on an IWB program  which will read the clipboard, merge the text with a blank if needed and then reload the merged text into the clipboard.

I have tried to start from one of the examples, but it does not seem to take the info from the clipboard.

I know I must be doing some thing wrong, but not sure where to start.

Thanks,
Bill

When all else fails, get a bigger hammer.

LarryMc

Are you reading the Excel spreadsheet with IWB and putting the cell info on the clipboard; or are you putting the cell info on the clipboard directly from within Excel?

If it is the latter then, as I understand it, it gets complicated because you can only have one "owner" of the clipboard at a time and messages would have to be sent back and forth between Excel and IWB while Excel is the owner and the IWB and Excel when IWB is the owner.

You can read here to see if you get the same idea:

https://msdn.microsoft.com/en-us/library/ms649012(v=vs.85).aspx
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

billhsln

I see, so what I am trying is much more complicated than I thought.  I was doing the copy directly from Excel, then switching over to my program and doing a Ctrl-V, which gave me back nothing.

Ok, will figure out another way to do it.

Thanks,
Bill
When all else fails, get a bigger hammer.

fasecero

QuoteI was doing the copy directly from Excel, then switching over to my program and doing a Ctrl-V, which gave me back nothing.

I think in this case your program should work with a few tweaks

DECLARE "user32",OpenClipboard(hwnd:WINDOW),INT

It needs to be changed to

DECLARE "user32",OpenClipboard(hwnd:INT),INT

then

OpenClipboard(w)

by

OpenClipboard(w.hwnd)

I'm not familiar with clipboard "ownership" so no idea when/how it can interfere with this code, though.