déclaration d'API pas ok, et Screen.Width utilisée avec BitBlt (twips :S)
allez :
Private Declare Function BitBlt Lib "gdi32.dll" (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 ReleaseDC Lib "user32.dll" (ByVal hwnd As Long, ByVal hdc As Long) As Long
Private Sub Form_Load()
Dim BureauhWnd As Long
Dim BureauDC As Long
salut Nix,
tout d'abord merci pour ta source, j'arrive un peu trop tard
7 ans apres lol : )
j'aurais une petite question concernant le bureau
est-ce que c'est possible de mettre le bureau dans une form?
bonne programmation ( en esperant que tu trouveras le temps de me répondre)
8 mars 2007 à 22:00
allez :
Private Declare Function BitBlt Lib "gdi32.dll" (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 ReleaseDC Lib "user32.dll" (ByVal hwnd As Long, ByVal hdc As Long) As Long
Private Sub Form_Load()
Dim BureauhWnd As Long
Dim BureauDC As Long
Me.AutoRedraw = True
BureauhWnd = GetDesktopWindow()
BureauDC = GetDC(BureauhWnd)
BitBlt Form1.hdc, 0&, 0&, Screen.Width \ Screen.TwipsPerPixelX, Screen.Height \ Screen.TwipsPerPixelY, BureauDC, 0&, 0&, vbSrcCopy
ReleaseDC BureauhWnd, BureauDC
End Sub
++
8 mars 2007 à 21:37
GetDC doit etre balancé par un ReleaseDC
22 oct. 2006 à 05:30
tout d'abord merci pour ta source, j'arrive un peu trop tard
7 ans apres lol : )
j'aurais une petite question concernant le bureau
est-ce que c'est possible de mettre le bureau dans une form?
bonne programmation ( en esperant que tu trouveras le temps de me répondre)