cs_cyrilp
Messages postés140Date d'inscriptionmercredi 4 octobre 2000StatutMembreDernière intervention12 août 2009
-
18 déc. 2001 à 10:36
ZTPdiffusion
Messages postés46Date d'inscriptionlundi 16 avril 2001StatutMembreDernière intervention 7 mars 2002
-
18 déc. 2001 à 12:46
%-6
Bonjour à tous !
Je souhaiterais pouvoir prendre une "photo d'écran" depuis VB.
Quelqu'un sait comment faire ?
De plus, j'utilise dans mon programme, les fonctions SMTP pour envoyer un mail (sans passer par un client de messagerie) mais comment faire pour envoyer une piece jointe ? (en l'occurence la photo d'écran)
ZTPdiffusion
Messages postés46Date d'inscriptionlundi 16 avril 2001StatutMembreDernière intervention 7 mars 2002 18 déc. 2001 à 12:40
Salut
voici la réponse pour le screenshot sous vb
'Pour ce projet il faut : 2 feuilles (form1 et form2)
'Mettre pour form2 : Propriété AUTOREDRAW sur TRUE, BORDERSTYLE sur NONE, VISIBLE sur FALSE, WINDOWSTATE sur MAXIMIZED
'Sur la feuille 1 (form1) mettre 2 boutons (Command1 et Command2)
Public Const SRCCOPY = &HCC0020
Public Const SRCAND = &H8800C6
Public Const SRCINVERT = &H660046
Public 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
Public Declare Function GetDesktopWindow Lib "user32" () As Long
Public Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
La capture d'écran se sauvegarde dans le même répertoire que le projet sous le nom "screenshot.bmp"
Concernant l'envoi de pièces jointes, ça doit être un peu plus difficile mais je cherche