Jump to content

How to write file copy path information to clipboard


Recommended Posts

QUOTE (Ton @ Dec 16 2008, 05:13 AM)

Hi,

if you look at the code of the Code Capture Tool, there is a piece of code to do that.

However in LabVIEW 8.x you can sent any string to the OS clipboard, and I don't think there is a special 'path' type.

Ton

Hi ton,

Thanks your quickly reply, I think you comment is not correct, LabVIEW8.X sent string to OS clipboard is different from right click mouse on a file and select "copy", LabVIEW8.X sent string to OS, it is just send text to OS, if you don't think so, you can try with below steps

1. create a txt file on C driver, name it "1.txt" .

2. sent "c:\1.txt" to clipboard with LabVIEW8.X sent string to clipboard function.

3. go to D driver, and right click mouse, select paste.

4. see whether you can paste "1.txt" file from C driver ??!

with sum up operation, you would know what I said.

thanks.

Link to comment

QUOTE (Ton @ Dec 16 2008, 01:13 AM)

You would be surprised how many different MS sanctioned clipboard formats there can be. There is certainly some form of special path type and I believe it can even come in various flavors such as shell ITEMIDLISTS but also other types. Either, although possible, is not practical to do without some external code in form of a DLL.

QUOTE (asbo @ Dec 17 2008, 07:57 PM)

He's looking to intercept/emulate the file move/copy functionality of the context menu in Windows Explorer. Unfortunately, I don't know enough about how that works to comment - it may use DDE messages or something similar.

Nowadays this is usually done with shell COM objects. Either IDropSource or IDropTarget depending on if you are the source of or a registered target for possible drag operation. You also implement IDataObject to contain the actual data object itself which can contain support for one or more different clibboard formats. It is certainly not something you can do directly in LabVIEW but which requires some external code in form of a DLL, a good understanding of COM in general and the poor mans shell implementation of it and of drag and drop operations in general. If you do not know C/C++ quite well you are in for a steep learning curve.

Rolf Kalbermatter

Link to comment
  • 3 weeks later...

QUOTE (rolfk @ Jan 5 2009, 09:48 PM)

WOW, Rolfk,Thank you very much, your help quite similar save my life, :D , it works. :thumbup:

but, as I open the example vi, it seems missing a BMP lib.

Link to comment

QUOTE (Cool-LV @ Jan 5 2009, 07:54 PM)

WOW, Rolfk,Thank you very much, your help quite similar save my life, :D , it works. :thumbup:

but, as I open the example vi, it seems missing a BMP lib.

You can get that lib from the aformentioned code capture tool. The clipboard library is only a utility to the bitmap library functionality so said example should actually have been put in the bitmap lib instead of into the clipboard lib.

Ahh well, if everything would be perfect! But then it comes for free, doesn't it? :rolleyes:

Rolf Kalbermatter

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.