Cool-LV Posted December 17, 2008 Report Share Posted December 17, 2008 Hi all, I want to write the file copy path information to clipboard, it is similar with move mouse on a file, and right click mouse, select copy function, and I find some clipboard toolkit, thare are copy text and image to clipboard, but no this kind of function, anybody knows how to do? thanks for your thread. Quote Link to comment
LAVA 1.0 Content Posted December 17, 2008 Report Share Posted December 17, 2008 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 Quote Link to comment
Cool-LV Posted December 17, 2008 Author Report Share Posted December 17, 2008 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. Quote Link to comment
asbo Posted December 18, 2008 Report Share Posted December 18, 2008 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. Quote Link to comment
Rolf Kalbermatter Posted December 19, 2008 Report Share Posted December 19, 2008 QUOTE (Ton @ Dec 16 2008, 01: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 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 Quote Link to comment
Cool-LV Posted January 6, 2009 Author Report Share Posted January 6, 2009 Enclosed is a source code package which from my friend helps to Call API to handle this case, but he just uses VB language, ant it works, so sad, I am not very familar with VB language, some part, I still fail to call API, should anybody help to "CONVERT" it to LabVIEW ? many thanks. Quote Link to comment
Rolf Kalbermatter Posted January 6, 2009 Report Share Posted January 6, 2009 QUOTE (Cool-LV @ Jan 5 2009, 03:51 AM) Enclosed is a source code package which from my friend helps to Call API to handle this case, but he just uses VB language, ant it works, so sad, I am not very familar with VB language, some part, I still fail to call API, should anybody help to "CONVERT" it to LabVIEW ? many thanks. Here is the clipbrd.llb file from the Code Capture Tool enhanced with three functions to handle CF_HDROP. LabVIEW 6.0 format http://lavag.org/old_files/post-349-1231192068.llb'>Download File:post-349-1231192068.llb Rolf Kalbermatter Quote Link to comment
Cool-LV Posted January 6, 2009 Author Report Share Posted January 6, 2009 QUOTE (rolfk @ Jan 5 2009, 09:48 PM) Here is the clipbrd.llb file from the Code Capture Tool enhanced with three functions to handle CF_HDROP.LabVIEW 6.0 format http://lavag.org/old_files/post-349-1231192068.llb'>Download File:post-349-1231192068.llb Rolf Kalbermatter WOW, Rolfk,Thank you very much, your help quite similar save my life, , it works. :thumbup: but, as I open the example vi, it seems missing a BMP lib. Quote Link to comment
Rolf Kalbermatter Posted January 7, 2009 Report Share Posted January 7, 2009 QUOTE (Cool-LV @ Jan 5 2009, 07:54 PM) WOW, Rolfk,Thank you very much, your help quite similar save my life, , 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? Rolf Kalbermatter Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.