damien174
Messages postés78Date d'inscriptionjeudi 4 janvier 2001StatutMembreDernière intervention 2 mars 2012
-
24 oct. 2005 à 16:38
nhervagault
Messages postés6063Date d'inscriptiondimanche 13 avril 2003StatutMembreDernière intervention15 juillet 2011
-
25 oct. 2005 à 22:14
bonjour , je souhaiterais sauvegardé un formulaire vers une image soit BMP ou JPEG, car je dessine des graph directement sur la form et je voudrais les avoir en jpeg, c'est pour quel soit généré automatiquement sur un site web.
damien174
Messages postés78Date d'inscriptionjeudi 4 janvier 2001StatutMembreDernière intervention 2 mars 2012 25 oct. 2005 à 21:47
slt j'ai essayer mais sans succes, soit il faut avoir le focus sur la
feuille ou sinon il prend tout l'ecran, c'est pas grave je ferais
autrement mes pages web
cs_Jack
Messages postés14006Date d'inscriptionsamedi 29 décembre 2001StatutModérateurDernière intervention28 août 201579 24 oct. 2005 à 20:44
Salut
Sous VB6, il n'existe pas de capture graphique.
Cherche du côté des sources qui parlent de 'capture d'écran' (ce n'est pas ce qui manque !).
Parmi elles, certaines savent gérer la capture de fenêtre seule et d'autres savent gérer la transformation BMP (ce que tu récupèreras de la capture) vers JPG.
Vala
Jack, MVP VB
NB : Je ne répondrai pas aux messages privés
Le savoir est la seule matière qui s'accroit quand on la partage. (Socrate)
Vous n’avez pas trouvé la réponse que vous recherchez ?
nhervagault
Messages postés6063Date d'inscriptiondimanche 13 avril 2003StatutMembreDernière intervention15 juillet 201137 24 oct. 2005 à 22:14
Re
Voila
Un code deniché sous google, pour faire voir la capture sous VB
General declarations
Private Declare Function FindWindow
Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal
lpWindowName As String) As Long
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias
"GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal
cch As Long) As Long
Public Const GW_HWNDFIRST = 0
Public Const GW_HWNDLAST = 1
Public Const GW_HWNDNEXT = 2
Public Const GW_HWNDPREV = 3
Public Const GW_OWNER = 4
Public Const GW_CHILD = 5
'--------------------------------------------------------------------------<wbr>-
' Put this in sub main or something:
hwnd = FindWindow(0&,"The Window's Caption")
Open "out.txt" for output as #1
Call PrintWindow(hwnd, 1, 0)
'--------------------------------------------------------------------------<wbr>-
Private Sub PrintWindows(hwnd As Long, filenum As Integer, iLevel As Integer)
'Prints all window captions and handles to file
Dim hWndx As Long
Dim ts As String
Dim ts1 As String * 256
Dim rtn As Long
nhervagault
Messages postés6063Date d'inscriptiondimanche 13 avril 2003StatutMembreDernière intervention15 juillet 201137 25 oct. 2005 à 21:51
Salut
pour trouver et selectionner le handles de la fenetre
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal
lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function BringWindowToTop Lib "user32" (ByVal hwnd As Long) As Long
dans un bouton :
Private Sub Command1_Click()
Dim hNoteWnd As Long
Dim x As Long
hNoteWnd = FindWindow("Notepad", "Sans titre - Bloc-notes")
If hNoteWnd = 0 Then
'le notepad avec le titre "Sans titre - Bloc-notes" n'est pas en mémoire
x =Shell("notepad.EXE", vbNormalFocus)
Else
'il est en mémoire : on le force en avant plan
BringWindowToTop (hNoteWnd)
End If
End Sub
Sinon, tu peux utiliser GetWindow pour obtenir la liste de toutes les
fenêtres actives :
dans un module basique :
Public Const GW_HWNDFIRST = 0
Public Const GW_HWNDNEXT = 2
Declare Function GetWindow Lib "user32" Alias "GetWindow" (ByVal hwnd As
Long, ByVal wCmd As Long) As Long
Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal
hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
dans un bouton :
Private Sub Command1_Click()
Dim hWndNext As Long
Dim x As Long
Dim lpString As String * 255
Dim vLen As Long
hWndNext = GetWindow(hWnd, GW_HWNDFIRST)
If hWndNext <> 0 Then
vLen = GetWindowText (hWndNext , lpString , len(lpString ))
Debug.print Left(lpString ,vLen )
End If
do until hWndNext = 0
hWndNext = GetWindow(hWndNext, GW_HWNDNEXT)
vLen = GetWindowText (hWndNext , lpString , len(lpString ))
Debug.print Left(lpString ,vLen )
loop
End Sub