Цитата: Как?
Цитата: SetClipboardData(CF_TEXT
SetClipboardData(CF_LOCALE
(Добавление)
Копирование в буфер.
CODE:#define CF_TEXT 1
#define CF_LOCALE 16
external(INT, "OpenClipboard", "OpenClipboard", "User32.dll");
external(INT, "CloseClipboard", "CloseClipboard", "User32.dll");
external(INT, "EmptyClipboard", "EmptyClipboard", "User32.dll");
external(INT, "SetClipboardData", "SetClipboardData", "User32.dll");
external(INT, "GlobalAlloc", "GlobalAlloc", "Kernel32.dll");
external(INT, "GlobalLock", "GlobalLock", "Kernel32.dll");
external(INT, "GlobalUnlock", "GlobalUnlock", "Kernel32.dll");
external(INT, "GlobalFree", "GlobalFree", "Kernel32.dll");
string s = "Привет Hello 123";
write_clipboard(s);
function write_clipboard(string text)
{
int Len = size(text);
if(OpenClipboard(0))
{
EmptyClipboard();
int hMem = GlobalAlloc(0, Len+1);
int Mem = GlobalLock(hMem);
writeaddress(text, Mem);
GlobalUnlock(Mem);
SetClipboardData(CF_TEXT, hMem);
GlobalFree(hMem);
hMem = GlobalAlloc(0, 4);
Mem = GlobalLock(hMem);
writeaddress(0x419, Mem);
GlobalUnlock(Mem);
SetClipboardData(CF_LOCALE, hMem);
GlobalFree(hMem);
CloseClipboard();
}
else messagebox("Буфер не открылся");
} |