Home > Software engineering >  How to get the window, and then mapped on the screen??
How to get the window, and then mapped on the screen??

Time:11-03

Similar to QQ screenshots automatically when the selection window, don't know whether BitBlt for scenes of the screen image replication, the following code

 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 GetWindowDC Lib "user32" (ByVal HWND) As Long As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal HWND As Long, lpRect As the RECT) 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, ByValhSrcDC 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 Type POINTAPI
X As Long
Y As Long
End Type

Private Type the RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Private Sub Timer1_Timer ()
Dim the xy As POINTAPI
As the RECT Dim R
The GetCursorPos xy
Jb=WindowFromPoint (x, y, x, y, y)
GetWindowRect jb, R
Dc GetWindowDC (jb)
Dc1=GetWindowDC (GetDesktopWindow)
BitBlt dc, 0, 0, R.R d.light - R.L eft, r. b ottom - R.T op, dc1, 0, 0,
vbSrcCopy 'copy drawingReleaseDC jb, dc 'release
ReleaseDC GetDesktopWindow dc1 'release
End Sub



CodePudding user response:

Look at this, might be helpful to you
http://blog.csdn.net/worldy/article/details/7381106

CodePudding user response:

I just want to draw on the screen, thank you

CodePudding user response:

Where which is drawn on the screen, full screen after naming is a form a screenshot shows,
Refer to the following resources, I use vb to do two options:
http://download.csdn.net/detail/sysdzw/3191717
  •  Tags:  
  • API
  • Related