Please Help. I have written my bar code program and it does what I originally wanted. It displays or prints a bar code. Now I am been asked if the bar code can be copied and pasted. I either need to write the bar code as an image that can be copied/saved or I need to output directly to the clipboard so it can be pasted straight away. Anyone have any ideas how it can be done.
Thanks
TonyM
			
			
			
				Hi Tony,
Replace the call to PrintWindow with this:		'PrintWindow Win2
		int left, top, width, height
		GetClientSize Win2, left, top, width, height
		CopyBarToClipboard(Win2, left, top, width, height)
The CopyBarToClipboard subroutine:$include "windowssdk.inc"
sub CopyBarToClipboard(window win, int left,int top,int width,int height)
	if (OpenClipboard(win.hwnd))
		' create a memory bitmap
		HDC hdc = GetDC(0)
		HDC cdc = CreateCompatibleDC(hdc)
		HBITMAP hbm = SelectObject(cdc, CreateCompatibleBitmap(hdc, width, height))
		' copy window pixels to this bitmap
		HDC dc = GetHDC(win)
		BitBlt(cdc, 0, 0, width, height, dc, left, top, SRCCOPY)
		ReleaseHDC(win, dc)
		hbm = SelectObject(cdc, hbm)
		DeleteDC(cdc)
		ReleaseDC(0, hdc)
		' put the bitmap into clipboard
		EmptyClipboard()
		SetClipboardData(CF_BITMAP, hbm) ' do not delete hbm after this!
		CloseClipboard()
	endif
endsub
			
			
			
				Cheers Sapero. Your genius triumphs again.