SIMULER LA METHODE IMAGE D'UNE FORM OU PICTURE

wtor Messages postés 59 Date d'inscription dimanche 23 novembre 2003 Statut Membre Dernière intervention 18 mars 2011 - 26 sept. 2008 à 02:31
wtor Messages postés 59 Date d'inscription dimanche 23 novembre 2003 Statut Membre Dernière intervention 18 mars 2011 - 26 sept. 2008 à 03:27
Comment capturer l'image d'une form ou picturebox comme la méthode Form1.Image avec les API windows et avec seulement le hWnd ou le hDC de la fom


merci d'avence

2 réponses

PCPT Messages postés 13272 Date d'inscription lundi 13 décembre 2004 Statut Membre Dernière intervention 3 février 2018 47
26 sept. 2008 à 03:12
Private Declare Function 
PrintWindow 
Lib 
"user32" 
(
ByVal 
hWnd 
As Long

ByVal 
hdcBlt 
As Long
,
ByVal
nFlags
As Long
)
As
Long


Private Declare Function 
FindWindow 
Lib 
"user32" 
Alias 
"FindWindowA" 
(
ByVal 
lpClassName 
As String

ByVal 
lpWindowName
As String
)
As Long


Private Sub 
Form_Load()


    'KPD-Team
2001


    'URL:
http://www.allapi.net/


    'E-Mail:
KPDTeam@Allapi.net

    Dim mWnd As Long
    'launch notepad
    Shell "notepad.exe", vbNormalNoFocus
    DoEvents
    'set the graphics mode
to persistent
    Me.AutoRedraw = True
    'search the handle of the
notepad window
    mWnd = FindWindow("Notepad", vbNullString)
    If mWnd = 0 Then
        Me.Print "NotePad window not
found!"
    Else
        'draw the image of the notepad window on our
form
        PrintWindow mWnd, Me.hDC, 0
    End If
End Sub


<hr size="2" width="100%" />
Prenez un instant pour répondre à [sujet-SONDAGE-POP3-POUR-CS_769706.aspx ce sondage] svp
0
wtor Messages postés 59 Date d'inscription dimanche 23 novembre 2003 Statut Membre Dernière intervention 18 mars 2011
26 sept. 2008 à 03:27
Merci PCPT pour ta réponse mais si la fenêtre est réduite l’image affichée est complètement noire ça veut dire que l’API ne peut pas capturer l’image de la forme, si tu a une solution pour capturer la totalité de l’image je suis preneur


Merci
0
Rejoignez-nous