PDA

View Full Version : Copy to clipboard


Derek
08-27-2002, 11:07 AM
Anybody know the best way to copy text to clipboard thru AMS4? Dont want to use Ctrl+C ... looking to achieve it with a mouse click /ubbthreads/images/icons/smile.gif

There's gotta be a dll function for this??

Lorne
08-27-2002, 11:27 AM
Design time, or run time?

Derek
08-27-2002, 11:30 AM
Run time

Brett
08-27-2002, 02:27 PM
Derek,

There is no built-in way to do that with AMS40. However, through the use of DLLs and the File.CallDLLFunction action, it is very easy.

I put together a small DLL today that has 3 functions that it exports:

BOOL IsTextOnClipboard() - Returns TRUE or FALSE depending on whether or not there is text available on the Windows clipboard.

BOOL CopyTextToClipboard(LPCTSTR strText) - Puts text onto the Windows clipboard. Returns TRUE if successful or FALSE if it fails (I don't see why it would ever fail).

LPCTSTR GetTextFromClipboard() - Gets the contents of the Windows clipboard if there is text available, returns an empty string ("") if not there.

All of these functions are easy to call from AMS40. I have attached a zip file (http://www.indigorose.com/ubbthreads/uploads/10644-ClipboardTestDLL.zip) that has the DLL and a sample project for you to try out. Unzip it to "...\My Documents\AutoPlay Media Studio Projects\Clipboard DLL Test", keeping the Distribution folder in place.

You (or any registered AMS40 user) may use and distribute this DLL freely at your own risk. Indigo Rose has not tested this DLL fully and it is not a supported Indigo Rose product. You get the idea...

Let me know how it works for you!

- Brett

10644-ClipboardTestDLL.zip (http://www.indigorose.com/ubbthreads/uploads/10644-ClipboardTestDLL.zip)

Derek
08-27-2002, 03:43 PM
Well I never expected that! /ubbthreads/images/icons/shocked.gif

Thank you very much. I have tried it and it works just fine. This could be extremely handy in many projects, I'm sure.
Thanx Brett. Thanx IR /ubbthreads/images/icons/smile.gif

Brett
08-27-2002, 03:46 PM
No problem... glad it worked for ya.

/ubbthreads/images/icons/smile.gif