Right, I can understand as the subject has sightly changed. I will try to explain in as much detail as possible.

I am trying to take a screenshot of an object within my form. The object is a picture box. I have some code that does this, however you have to move a picture (looks like a crosshairover) the object like below:



So, i am trying to get a screenshot of the picture box (that has a web browser inside) without moving the crosshair image over.

Heres some of the code:
VB Code:
  1. Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
  2. Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
  3. Private Declare Function GetCursorPos Lib "user32" (lpPoint As PointAPI) As Long
  4. Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
  5. Private Type RECT
  6.     Left As Long
  7.     Top As Long
  8.     Right As Long
  9.     Bottom As Long
  10. End Type
  11. Private Type PointAPI
  12.     X As Long
  13.     Y As Long
  14. End Type
  15. Dim SelWnd As Long
  16.  
  17.  
  18. Private Sub Command1_Click()
  19.  
  20. Dim WndRECT As RECT
  21. GetWindowRect SelWnd, WndRECT
  22. SavePicture hDCToPicture(GetDC(SelWnd), 0, 0, (WndRECT.Right - WndRECT.Left), (WndRECT.Bottom - WndRECT.Top)), App.Path & "\ok.bmp"
  23. Set Image1.Picture = hDCToPicture(GetDC(SelWnd), 0, 0, (WndRECT.Right - WndRECT.Left), (WndRECT.Bottom - WndRECT.Top))
  24. End Sub
  25.  
  26. Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  27. Me.MousePointer = 99
  28. Me.MouseIcon = Picture1.Picture
  29. Picture1.Visible = False
  30.  
  31. End Sub
  32.  
  33. Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  34. Dim mousexy As PointAPI
  35. GetCursorPos mousexy
  36. SelWnd = WindowFromPoint(mousexy.X, mousexy.Y)
  37. Me.MousePointer = 0
  38. Picture1.Visible = True
  39.  
  40. End Sub
  41.  
  42. Private Sub Timer1_Timer()
  43. Dim mousexy As PointAPI
  44. GetCursorPos mousexy
  45. label2.Caption = WindowFromPoint(mousexy.X, mousexy.Y)
  46. End Sub
  47.  
  48. Private Sub form_load()
  49. WebBrowser1.Navigate ("http://www.runescape.com")
  50. End Sub

For the whole code take a look at this:

http://vtforce.com/cruel/window_bitblt.zip

Thanks! Hope that clears a few things up...