VB代码转VB.net
vb.net吧
全部回复
仅看楼主
level 8
qq1279797868 楼主
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal hWnd As Long, ByVal hdc As Long) As Long
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Const SRCCOPY = &HCC0020
Private Sub Timer1_Timer()
Dim lngDesktopHwnd As Long
Dim lngDesktopDC As Long
Me.Picture1.Picture = LoadPicture("")
Picture1.AutoRedraw = True
Picture1.ScaleMode = vbPixels
lngDesktopHwnd = GetDesktopWindow '该函数返回桌面窗口的句柄
lngDesktopDC = GetDC(lngDesktopHwnd)
Picture1.Width = Screen.Width
Picture1.Height = Screen.Height
Call BitBlt(Picture1.hdc, 0, 0, Screen.Width, Screen.Height, lngDesktopDC, 0, 0, SRCCOPY)
Picture1.Picture = Picture1.Image
Call ReleaseDC(lngDesktopHwnd, lngDesktopDC) '清理DC
End Sub
2014年12月22日 17点12分 1
level 8
qq1279797868 楼主
上面这段代码怎么转到VB.net
2014年12月22日 17点12分 2
level 8
qq1279797868 楼主
[委屈][泪]
2014年12月22日 17点12分 3
level 12
你直接用VS 打开vb的工程 VS会帮你升级代码,当然部分代码需要你自己修改。
2014年12月23日 02点12分 4
level 10
long改成integer,integer改为short,涉及指针的参数类型建议改为intptr
参数前缀为空的改为byref
只是想截图,VB.NET有更好的办法,百度就有各种代码
2014年12月24日 11点12分 5
好吧我已经找到代码了
2014年12月24日 13点12分
1