could someone give me some code dealing with
bitblt
setcursorpos
getcursorpos
this would help me out alot thanx for any help or ideas
Printable View
could someone give me some code dealing with
bitblt
setcursorpos
getcursorpos
this would help me out alot thanx for any help or ideas
It depends on what you want to do with the cursor. I don't understand what you mean by "bitblt" but if it is for general knowledge then I can help:
Private Type POINTAPI
x as Long
y as Long
End Type
Private Declare Function GetCursorPos Lib "User32" Alias "GetCursorPos" (lpPoint As POINTAPI) As Long
Private Declare Function SetCursorPos Lib "User32" Alias "SetCursorPos" (ByVal X As Long, ByVal Y As Long) As Long
Call them like this in a sub: 'Needs a timer
Dim z as POINTAPI
GetCursorPos z
Edit1 = z.x
Edit2 = z.y
----------------------------------------
SetCursorPos (###,###) ' x-y coordinates on screen
Hope this helps....
Here's a little snip for using BitBlt():
VB Code:
Option Explicit Private Declare Function GetDesktopWindow Lib "user32" () As Long Private Declare Function GetWindowDC 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 Sub cmdCopy_Click() Dim hWndDesktop As Long Dim hDCDesktop As Long 'get desktop's window handle hWndDesktop = GetDesktopWindow 'get desktop's device context hDCDesktop = GetWindowDC(hWndDesktop) With picDesktop 'picturebox with autoredraw=true, scalemode=3 (pixel) .Cls 'copy a chunk of the desktop image with dimensions 'of the picturebox BitBlt .hDC, 0, 0, .ScaleWidth, .ScaleHeight, hDCDesktop, 0, 0, vbSrcCopy End With 'free the device context ReleaseDC hWndDesktop, hDCDesktop End Sub