quote:
Originally posted by J-Thread
The CF_TEXT and CF_OEMTEXT are constants, don't use them as strings:
code:
var CF_TEXT = 516; // check these
var CF_OEMTEXT = 7;
if (Interop.Call("User32", "OpenClipboard", 0))
{
if (Interop.Call("User32", "IsClipboardFormatAvailable", CF_TEXT | CF_OEMTEXT))
{
var hClipboardData = Interop.Call("User32", "GetClipboardData", CF_TEXT);
var pchData = Interop.Call("Kernel32", "GlobalLock", hClipboardData);
var strFromClipboard = pchData;
Debug.Trace(strFromClipboard);
Interop.Call("Kernel32", "GlobalUnlock", hClipboardData);
}
else
{
Debug.Trace("There is no text data on the Clipboard.");
}
Interop.Call("User32", "CloseClipboard");
}
Not tested, but should work better
no sorry..still doesn't work for me...
btw, what should i do with the CF_TEXT and CF_OEMTEXT vars and why did you use 516 and 7 ? got it
hmm...any help?