bmp from clipboard ?

Miscellaneous Forums/Win32 Discussion/bmp from clipboard ?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi
1: You are right.
You need

Function GlobalFree(Mem:Int)

in the extern block and this
	Function TextToClipboard(txt:String)
		
		If txt$="" Return
		
		Local TextBuf:Byte Ptr
		Local Memblock:Int
		Local DataBuf:Byte Ptr
		
		TextBuf  = Txt.ToCString()
		Memblock = GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE, txt.length+1)
		DataBuf  = GlobalLock(Memblock)
		
		MemCopy DataBuf, TextBuf, Txt.length
		
		If OpenClipboard(0)
			EmptyClipboard
			SetClipboardData(CF_TEXT, DataBuf)
			CloseClipboard
		EndIf
		
		GlobalUnlock(Memblock)
		GlobalFree(Memblock)
		
	End Function


is the new function.

2: Yes, it´s possible. Give me some hours.