First, I'd like to say
HI!!
I'm back...kinda
I'm a noob when it comes to programming and thought that I'll try something easy for a start, but I already noticed that it isn't easy at all...
The (simple) idea was, that when I type a command like "/isi" (stands for Internal Sound Identifier) in the conversation window, to get the Internal Sound Identifier from the clipboard (if it's present) and send the sound to the contact (maybe by sending the ISI prefixed with "/sound ", or is there an easier way?).
well, here's the code I've got so far, for getting the ISI from the clipboard:
(may or may not be complete bs)
code:
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");
}
The part with IsClipboardFormatAvailable is probably not useful, because I need to check if it's a Sound Identifier ala #D9586E19B0CB not if there's text
This code should actually check if there is text in the clipboard, then get it from there and display it in the debug window, but it's not working..dunno why and all my other attempts to get it working have failed.
So...any help would be appreciated
Btw, I did this based on the C++ code on
http://www.codeproject.com/clipboard/archerclipboard1.asp