- Home
·
- Graphics
·
- Paints a picture from a picture box onto the screen. It will paint over any program or you can chan
Paints a picture from a picture box onto the screen. It will paint over any program or you can chan
Paints a picture from a picture box onto the screen. It will paint over any program or you can change the handle to a specific program. Notes:
API Declarations
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) 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
Rate Paints a picture from a picture box onto the screen. It will paint over any program or you can chan
(1(1 Vote))
Dim hParent As Long, hHandle As Long, hHDC As Long
'these two get the handle of the screen to paint on
hParent = FindWindow("Progman", "")
hHandle = FindWindowEx(hParent, 0, "SHELLDLL_DefView", vbNullString)
'convert the handle to an hDC
'this is needed to paint the picture onto the screen
hHDC = GetWindowDC(hHandle)
'paint Picture1 onto the desktop/screen
BitBlt hHDC, 0, 0, Picture1.ScaleWidth / 15, Picture1.ScaleHeight / 15, Picture1.hdc, 0, 0, vbSrcCopy
'do not remove this line!
ReleaseDC hHandle, hHDC
End Sub
Paints a picture from a picture box onto the screen. It will paint over any program or you can chan Comments
No comments yet — be the first to post one!
Post a Comment