WEB开发网
开发学院WEB开发综合 用VB获取桌面图象 阅读

用VB获取桌面图象

 2006-02-27 11:52:40 来源:WEB开发网   
核心提示:PublicDeclareFunctionGetDesktopWindowLib"user32"()AsLongPublicDeclareFunctionGetDCLib"user32"(ByValhwndAsLong)AsLongPublicDeclareFunctionBit
PublicDeclareFunctionGetDesktopWindowLib"user32"()AsLong
PublicDeclareFunctionGetDCLib"user32"(ByValhwndAsLong)AsLong
PublicDeclareFunctionBitBltLib"gdi32"_
(ByValhDestDCAsLong,_
ByValxAsLong,_
ByValyAsLong,_
ByValnWidthAsLong,_
ByValnHeightAsLong,_
ByValhSrcDCAsLong,_
ByValxSrcAsLong,_
ByValySrcAsLong,_
ByValdwRopAsLong)AsLong

PRivateSubForm_Load()
DimlDesktopAsLong
DimlDCAsLong
Form1.AutoRedraw=True
Form1.ScaleMode=1
lDesktop=GetDesktopWindow()'取得桌面窗口
lDC=GetDC(lDesktop)'取得桌面窗口的设备场景
BitBltMe.hDC,0,0,Screen.Width,Screen.Height,lDC,0,0,vbSrcCopy'将桌面图象绘制到窗体
EndSub->

Tags:VB 获取 桌面

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接