Home > database >  PB from the clipboard chart
PB from the clipboard chart

Time:09-24

I call a QQ screenshots OCX, double-click the control when the images copied to the clipboard, but I want to keep the clipboard images, how to do?

The Function int CameraSubArea (int utype) LIBRARY "CameraDll. DLL
"The FUNCTION ulong GetClipboardData (ulong wFormat) LIBRARY "user32. DLL
"The FUNCTION ulong IsClipboardFormatAvailable (ulong wFormat) LIBRARY "user32. DLL
"The FUNCTION ulong GlobalLock (ulong hMem) LIBRARY "kernel32. DLL
"The FUNCTION ulong GlobalUnlock (ulong hMem) LIBRARY "kernel32. DLL
"The FUNCTION ulong GlobalSize (ulong hMem) LIBRARY "kernel32. DLL
"Subroutine copymemory (REF blob Destionation, blob Source, long length) library "kernel32. DLL
"//subroutine copymemory (REF string Destionation, string Source, long length) library "kernel32. DLL
"The FUNCTION ulong OpenClipboard (ulong HWND) LIBRARY "user32. DLL
"
Li_return_msg=CameraSubArea (0)
IF li_return_msg=1 THEN
If IsClipboardFormatAvailable (2)=1 then
HGlobal=GetClipBoardData (2)
Lp=GlobalLock (hGlobal)
//blobtemp=space (GlobalSize (lp))
//copymemory (ref blbResult BlobTemp, lp)
GlobalUnlock (hGlobal)
In_bitmap. Of_WriteBlob (" c: \ 1. BMP, "blob (blbResult))
End the if
END the IF


On the Internet to find such a, but is an error, not
Please help, thank you

CodePudding user response:

http://download.csdn.net/source/1626134

CodePudding user response:

The I, is not working, not cut the whole screen, is a custom screen,
QQ has a control can be realized, like QQ screenshots, useful,
But after the QQ screenshots are saved to the clipboard, I'd like to keep the clipboard data into images,
Just don't know how to save, to find on the Internet for a long time can't get a

Experts advise, please, thank you

CodePudding user response:

Which expert to consult

CodePudding user response:

You give examples should be done

Blob blobtemp
If IsClipboardFormatAvailable (2)=1 then
HGlobal=GetClipBoardData (2)
Lp=GlobalLock (hGlobal)
Blobtemp=space (GlobalSize (lp))
The copymemory (ref blbResult BlobTemp, lp)
GlobalUnlock (hGlobal)
End the if
This time is within a BMP image of blobtemp put
You can have a look at the picture control
Picture. SetPicture (blobtemp)
Should be able to show pictures to

What's left is to save the contents of the Blobtemp to file.

CodePudding user response:

Such an error, no one's really tested, counsel, urgent

CodePudding user response:

HGlobal=OpenClipboard (Handle (the Parent))
HGlobal=GetClipBoardData (1)
Lp=GlobalLock (hGlobal)
Li_count=GlobalSize (lp)
MemoryCopy (ls_a, lp, li_count)
GlobalUnlock (hGlobal)
CloseClipboard ()

If the above code, it is no problem, ls_a is clipboard text
But if it is GetClipBoardData (2), to take pictures, GlobalLock returns 0, don't know why

CodePudding user response:

Tried, not really.
This method is a copy of the string.
Copy image with this method is very troublesome.
To use copyimage copy pictures for memory,
And then put the pictures of the memory is saved as a file.

CodePudding user response:

Can post specific code, thank you

CodePudding user response:

The FUNCTION ulong GetClipboardData (ulong wFormat) LIBRARY "user32. DLL
"The FUNCTION ulong IsClipboardFormatAvailable (ulong wFormat) LIBRARY "user32. DLL
"The Function long CloseClipboard () Library "user32
"The FUNCTION ulong OpenClipboard (ulong HWND) LIBRARY "user32. DLL
"The Function ulong CopyImage (ulong handle, long un1, long n1, long n2, long un2) LIBRARY "user32. DLL
"
Ulong hglobal, ll_hbitmap
If IsClipboardFormatAvailable (2)=1 then
OpenClipboard (handle (the parent))
HGlobal=GetClipBoardData (2)
CloseClipboard();
Ll_hbitmap=copyimage (hglobal, 0,0,0,4)
End the If
Ll_hbitmap is memory picture
But you would have a memory images in the file you trouble

To save HBITMAP handle for local BMP bitmap link:
(VC source code)
http://blog.csdn.net/ok208043624/archive/2008/10/27/3151822.aspx

CodePudding user response:

In the 1st floor is the answer, seemingly or imported, the original poster can be perfectly solved attentively,

CodePudding user response:

Mark, download to learn on March 18, 2010, 23 16 minutes and 6 seconds when

CodePudding user response:

1/f, said the program is very powerful, when can write such PB program is ok,

CodePudding user response:

Learning.

CodePudding user response:

I have a similar problem here, everyone seems to look at!
http://blog.csdn.net/shengli333/archive/2010/12/24/6096000.aspx

CodePudding user response:

Attention, was about to make this a few days ago, this two days busy doing something else, which day is study

CodePudding user response:

//FUNCTION Boolean OpenClipboard (ULong hWndNewOwner) LIBRARY "user32. DLL
"//FUNCTION Boolean CloseClipboard () LIBRARY "user32. DLL
"//FUNCTION ULong GetClipboardData (ULong wFormat) LIBRARY "user32. DLL
"//FUNCTION ulong IsClipboardFormatAvailable (ulong wFormat) LIBRARY "user32. DLL
"//FUNCTION ULong GetDesktopWindow () LIBRARY "user32. DLL
"//FUNCTION ULong GetDC (ULong hWnd) LIBRARY "user32. DLL
"//FUNCTION ULong CreateCompatibleDC (ULong HDC) LIBRARY "gdi32. DLL
"//FUNCTION ULong SelectObject (ULong HDC, ULong hgdiobj) LIBRARY "gdi32. DLL
"//FUNCTION Int GetDIBits (ULong HDC, ULong HBMP, UInt uStartScan, UInt cScanLines, REF Blob lpvBits, REF bitmapinfo lpbi, UInt uUsage) LIBRARY "gdi32. DLL
"nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related