将指定文件复制到剪贴板,只有bmp格式文件成功,求其它类型,需要改哪些代码,谢谢
将指定文件复制到剪贴板,只有bmp格式文件成功,求其它类型,需要改哪些代码,谢谢代码如下
DECLARE INTEGER OpenClipboard IN user32 INTEGER
DECLARE INTEGER CloseClipboard IN user32
DECLARE INTEGER EmptyClipboard IN user32
DECLARE INTEGER SetClipboardData IN user32 INTEGER,INTEGER
DECLARE INTEGER LoadImage IN WIN32API INTEGER,string,INTEGER,INTEGER,INTEGER,INTEGER
DECLARE INTEGER GetClipboardData IN user32 INTEGER
DECLARE INTEGER GdipCreateBitmapFromHBITMAP in GdiPlus.dll INTEGER, INTEGER, INTEGER @
DECLARE INTEGER GdipSaveImageToFile in GdiPlus.dll INTEGER,String,String @,String @
DECLARE Long GdipCreateHBITMAPFromBitmap IN GDIPLUS.DLL Long nativeImage, Long @, Long
DECLARE Long GdipCreateBitmapFromFile IN GDIPLUS.DLL String FileName, Long @nBitmap
DECLARE Long CopyImage IN WIN32API Long hImage, Long, Long, Long , Long
#DEFINE CF_BITMAP 2
#DEFINE CF_DIB 8
#DEFINE IMAGE_BITMAP 0
#DEFINE LR_LOADFROMFILE 16
#define CLSID_BMP "{557CF400-1A04-11D3-9A73-0000F81EF32E}"
#define CLSID_JPEG "{557CF401-1A04-11D3-9A73-0000F81EF32E}"
#define CLSID_GIF "{557CF402-1A04-11D3-9A73-0000F81EF32E}"
#define CLSID_TIFF "{557CF405-1A04-11D3-9A73-0000F81EF32E}"
#define CLSID_PNG "{557CF406-1A04-11D3-9A73-0000F81EF32E}"
*VFP应用程式算法群:12787940 行者孙:310727570
*功能1:将图形文件保存到剪切板
imagefile=tupian_wj_loc
imagefile="d:\无标题1.bmp"
hBitmap=LoadImage(0,imagefile,IMAGE_BITMAP,0,0,LR_LOADFROMFILE)
OpenClipboard (0)
EmptyClipboard()
SetClipboardData (CF_BITMAP,hBitmap)
CloseClipboard()