标题:将指定文件复制到剪贴板,只有bmp格式文件成功,求其它类型,需要改哪些代码 ...
取消只看楼主
shschy
Rank: 1
等 级:新手上路
帖 子:33
专家分:5
注 册:2022-3-13
结帖率:0
 问题点数:0 回复次数:1 
将指定文件复制到剪贴板,只有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()
搜索更多相关主题的帖子: string INTEGER DEFINE Long 代码 
2022-03-27 12:20
shschy
Rank: 1
等 级:新手上路
帖 子:33
专家分:5
注 册:2022-3-13
得分:0 
2022-03-27 12:22



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-508675-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.121207 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved