
欢迎扫码订阅
程序员

欢迎扫码订阅
今天一整个下午的结果
win32 api 定义
Function ulong GlobalAlloc(ulong uFlags, ulong dwBytes) library “Kernel32.dll” ;
Function ulong GlobalLock(ulong lm) library “Kernel32.dll” ;
Function boolean GlobalUnlock(ulong lm) library “Kernel32.dll” ;
Function ulong CopyMemory(ulong des, String src, ulong length) library “Kernel32.dll” ALIAS FOR “RtlMoveMemory”
function boolean OpenClipboard(ulong _null ) Library “user32.dll”
function boolean EmptyClipboard() Library “user32.dll”
function ulong RegisterClipboardFormatA(ref String format) Library “user32.dll”
function ulong GetClipboardData( ulong winhandle) Library “user32.dll”
function ulong SetClipboardData( ulong winhandle,ulong lp_d) Library “user32.dll”
function boolean CloseClipboard() Library “user32.dll”
将数据保存到剪切板的函数
public subroutine tormrclip (string msg);
boolean lb_1
String ls_f
ls_f = msg +char(0)
lb_1 =this.openclipboard(0)
if lb_1 = false then return
if this.EmptyClipboard() = false then return
ulong lm,lv,lf
lm =this.GlobalAlloc(2,len(ls_f) + 1 )
if lm = 0 then return
lv = this.GlobalLock(lm)
if lv = 0 then return
this.copymemory(lv,ls_f,len(ls_f) + 1 )
this.GlobalUnlock(lm)
this.SetClipboardData(50269,lm)
this.CloseClipboard()
end subroutine