What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [UPDATED] Clipboard Functions (that WORK)

[UPDATED] Clipboard Functions (that WORK)
Author: Message:
andrey
elite shoutboxer
****

Avatar

Posts: 795
Reputation: 48
– / Male / Flag
Joined: Aug 2004
RE: [UPDATED] Clipboard Functions (that WORK)
hmm..there's still something wrong with this, at some occasions my clipboard is still not getting closed again

save this as a new script:
code:
//ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ <-- for testing

Interop.Call("user32", "CloseClipboard");
Debug.Trace(readClipboard());

function readClipboard() {
var CF_TEXT = 1;
var CF_OEMTEXT = 7;
var CF_UNICODETEXT = 13;
try {
if (Interop.Call("User32", "OpenClipboard", 0)) {
if (Interop.Call("User32", "IsClipboardFormatAvailable", CF_TEXT | CF_OEMTEXT)) {
var hClipboardData = Interop.Call("User32", "GetClipboardData", CF_UNICODETEXT);
var pchData = Interop.Call("Kernel32", "GlobalLock", hClipboardData);
var size = Interop.Call("Kernel32", "GlobalSize", hClipboardData);
var str = "";
Interop.Call("Kernel32", "RtlMoveMemory", str, pchData, size);
var unlocked = Interop.Call("Kernel32", "GlobalUnlock", hClipboardData);
} else {
Interop.Call("User32", "CloseClipboard");
return false;
}
Interop.Call("User32", "CloseClipboard");
}
} catch(ex) {
Interop.Call("User32", "CloseClipboard");
return false;
}
return str;
}
now copy (to the clipboard)
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ
and save the script, everything works fine and we get a 'False'
quote:
Originally posted by Script Debugging
Script has been stopped
Script is starting
Interop.Call failed to locate function "YZABCDEFGHIJKLMNOPQRSTUVWXYZ"
False
Script is now loaded and ready
but now delete the 3rd row
"Interop.Call("user32", "CloseClipboard");"
or put it as comment, again copy
ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ
and save the script. Now we get an error
quote:
Originally posted by Script Debugging
Script has been stopped
Script is starting
Interop.Call failed to locate function "YZABCDEFGHIJKLMNOPQRSTUVWXYZ"
Interop.Call failed to locate function "QRSTUVWXYZ"
Error: .
       Line: 26. Code: -2147467259.
Script has failed to start
the script fails, and the clipboard isn't closed.


Edit:
Thanks dt, that worked.
deAd, please update your post with dt's code

This post was edited on 07-12-2006 at 12:02 PM by andrey.
[Image: w2kzw8qp-sq2_dz_b_xmas.png]
07-12-2006 02:58 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[UPDATED] Clipboard Functions (that WORK) - by deAd on 07-11-2006 at 09:27 PM
RE: Clipboard Functions (that WORK) - by andrey on 07-11-2006 at 09:44 PM
RE: Clipboard Functions (that WORK) - by deAd on 07-11-2006 at 09:46 PM
RE: Clipboard Functions (that WORK) - by ShawnZ on 07-11-2006 at 10:45 PM
RE: Clipboard Functions (that WORK) - by deAd on 07-11-2006 at 10:56 PM
RE: [UPDATED] Clipboard Functions (that WORK) - by alexp2_ad on 07-12-2006 at 12:32 AM
RE: [UPDATED] Clipboard Functions (that WORK) - by andrey on 07-12-2006 at 02:58 AM
RE: [UPDATED] Clipboard Functions (that WORK) - by -dt- on 07-12-2006 at 04:45 AM
RE: [UPDATED] Clipboard Functions (that WORK) - by Dempsey on 07-12-2006 at 07:28 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On