Comment detecter la fermeture d'une fenetre crystal report?
vblover
Messages postés57Date d'inscriptionmardi 25 février 2003StatutMembreDernière intervention27 janvier 2011
-
9 juin 2006 à 17:54
vblover
Messages postés57Date d'inscriptionmardi 25 février 2003StatutMembreDernière intervention27 janvier 2011
-
17 juin 2006 à 21:36
Quelqu'un peut il m'indiquer comment detecter la fermeture d'une fenetre de crystal report?
En effet j'imprime un document rpt dans une loop, mais je ne voudrais pas que la boucle s'execute avant que l'utilisateur n'ait fermé la fenetre.
Merci
vblover
Messages postés57Date d'inscriptionmardi 25 février 2003StatutMembreDernière intervention27 janvier 2011 17 juin 2006 à 21:36
Declaration à ajouter à l’entete de votre programme principal
Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long<?xml:namespace prefix o ns "urn:schemas-microsoft-com:office:office" /?>
Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount 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
Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long,
lpdwProcessId As Long) As Long
Declare Function SendMessageArray Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Const LB_SETTABSTOPS = &H192
Public Const MAX_PATH = 260
Public ProcessName(500) As String
Public ProcessItemNumber As Integer
Ajouter ces functions dans un module de functions définies par l’utlisateur
Public Function IsCrystalReportActive() As Boolean
Dim index As Integer
Dim TexteRecherche As String
Dim Trouve As Boolean
TexteRecherche = "BrahmaPrintWindow"
Call fEnumWindows
Trouve = False
For index = 1 To ProcessItemNumber
If LTrim(RTrim(ProcessName(index))) = TexteRecherche Then
Trouve = True
Exit For
End If
Next
IsCrystalReportActive = Trouve
End Function
Public Function fEnumWindowsCallBack(ByVal hwnd As Long, _
ByVal lpData As Long) As Long
Dim lResult As Long
Dim lThreadId As Long
Dim lProcessId As Long
Dim sWndName As String
Dim sClassName As String
'
' This callback function is called by Windows (from the EnumWindows
' API call) for EVERY window that exists. It populates the aWindowList
' array with a list of windows that we are interested in.
vblover
Messages postés57Date d'inscriptionmardi 25 février 2003StatutMembreDernière intervention27 janvier 2011 17 juin 2006 à 21:36
Declaration à ajouter à l’entete de votre programme principal
Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long<?xml:namespace prefix o ns "urn:schemas-microsoft-com:office:office" /?>
Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount 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
Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long,
lpdwProcessId As Long) As Long
Declare Function SendMessageArray Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Const LB_SETTABSTOPS = &H192
Public Const MAX_PATH = 260
Public ProcessName(500) As String
Public ProcessItemNumber As Integer
Ajouter ces functions dans un module de functions définies par l’utlisateur
Public Function IsCrystalReportActive() As Boolean
Dim index As Integer
Dim TexteRecherche As String
Dim Trouve As Boolean
TexteRecherche = "BrahmaPrintWindow"
Call fEnumWindows
Trouve = False
For index = 1 To ProcessItemNumber
If LTrim(RTrim(ProcessName(index))) = TexteRecherche Then
Trouve = True
Exit For
End If
Next
IsCrystalReportActive = Trouve
End Function
Public Function fEnumWindowsCallBack(ByVal hwnd As Long, _
ByVal lpData As Long) As Long
Dim lResult As Long
Dim lThreadId As Long
Dim lProcessId As Long
Dim sWndName As String
Dim sClassName As String
'
' This callback function is called by Windows (from the EnumWindows
' API call) for EVERY window that exists. It populates the aWindowList
' array with a list of windows that we are interested in.