Viper87
04-09-2006, 09:13 AM
Hi,
I want to translate thic code to VB NET 2005 EE from VB 6.0:
Option Explicit
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 Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Const SRCCOPY = &HCC0020
Private Sub Form_Load()
Me.AutoRedraw = True
Me.ScaleMode = 3
End Sub
Private Sub Form_Unload(Cancel As Integer)
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
Dim scr_hwnd As Long
Dim dc_hwnd As Long
Dim pt1 As POINTAPI
Static pt2 As POINTAPI
GetCursorPos pt1
If pt1.x = pt2.x And pt1.y = pt2.y Then
Exit Sub
Else
pt2.x = pt1.x
pt2.y = pt1.y
End If
scr_hwnd = GetDesktopWindow
dc_hwnd = GetDC(scr_hwnd)
Me.Cls
BitBlt Me.hDC, 0, 0, Me.ScaleWidth, Me.ScaleHeight, dc_hwnd, pt1.x - Me.ScaleWidth / 2, pt1.y - Me.ScaleHeight / 2, SRCCOPY
End Sub
Could you help me? I want to send this preview to remote computer in LAN, but I don't know how I can do it... (I never code client-server application) Could you prompt me any sugestions?
I want to translate thic code to VB NET 2005 EE from VB 6.0:
Option Explicit
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 Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Const SRCCOPY = &HCC0020
Private Sub Form_Load()
Me.AutoRedraw = True
Me.ScaleMode = 3
End Sub
Private Sub Form_Unload(Cancel As Integer)
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
Dim scr_hwnd As Long
Dim dc_hwnd As Long
Dim pt1 As POINTAPI
Static pt2 As POINTAPI
GetCursorPos pt1
If pt1.x = pt2.x And pt1.y = pt2.y Then
Exit Sub
Else
pt2.x = pt1.x
pt2.y = pt1.y
End If
scr_hwnd = GetDesktopWindow
dc_hwnd = GetDC(scr_hwnd)
Me.Cls
BitBlt Me.hDC, 0, 0, Me.ScaleWidth, Me.ScaleHeight, dc_hwnd, pt1.x - Me.ScaleWidth / 2, pt1.y - Me.ScaleHeight / 2, SRCCOPY
End Sub
Could you help me? I want to send this preview to remote computer in LAN, but I don't know how I can do it... (I never code client-server application) Could you prompt me any sugestions?