Attribute VB_Name = "MVisiWinStudio" Option Explicit Public Index As Byte Public curFrm As Form 'Version 4.01.000 'Gibt den Wert einer Prozessvariablen zurück Public Declare Function VWGet Lib "VW4Common.dll" _ (ByVal VarName As String _ ) As Variant 'Setzt einen neuen Wert für eine Prozessvariable Public Declare Function VWSet Lib "VW4Common.dll" _ (ByVal VarName As String, _ Value As Variant _ ) As Boolean 'Hilfsfunktionen für Logik-, Schiebe-, Bitoperationen auf Ganzzahlwerte Public Declare Function VWLeftShift Lib "VW4Common.dll" _ (ByVal Val As Long, _ ByVal Shift As Integer _ ) As Long Public Declare Function VWRightShift Lib "VW4Common.dll" _ (ByVal Val As Long, _ ByVal Shift As Integer _ ) As Long Public Declare Function VWGetBit Lib "VW4Common.dll" _ (ByVal Val As Long, _ ByVal Bit As Integer _ ) As Integer Public Declare Function VWSetBit Lib "VW4Common.dll" _ (ByVal Val As Long, _ ByVal Bit As Integer, _ ByVal BitVal As Integer _ ) As Long Public Declare Function VWHiWord Lib "VW4Common.dll" _ (ByVal Val As Long _ ) As Integer Public Declare Function VWLoWord Lib "VW4Common.dll" _ (ByVal Val As Long _ ) As Integer Public Declare Function VWHiByte Lib "VW4Common.dll" _ (ByVal Val As Integer _ ) As Byte Public Declare Function VWLoByte Lib "VW4Common.dll" _ (ByVal Val As Integer _ ) As Byte 'Spezielle Zeitkonvertierungsfunktionen Public Declare Function OleDate2Unix Lib "VW4Common.dll" _ (ByVal dt As Date _ ) As Long Public Declare Function Unix2OleDate Lib "VW4Common.dll" _ (ByVal lTime As Long _ ) As Date Public Sub EndProgram() Dim frm As Form FStart.Show DoEvents 'Alle geladen Formulare bis auf das Startformular entladen For Each frm In Forms If Not frm Is FStart Then Unload frm DoEvents End If Next frm 'Im FinalizeAppShutdown-Ereignis des VWStart-Objektes im Startformular 'ist dann wirklich Schluss. FStart.VWStart1.ShutdownApplication End Sub Public Sub ShutDownWindows() Dim frm As Form 'Alle geladen Formulare bis auf das Startformular entladen For Each frm In Forms If Not frm Is FStart Then Unload frm End If Next frm 'Windows beenden über das VWStart-Objekt: 'Dadurch wird zuerst die Prozessdatenbank inkl. Treiberprogramme beendet. FStart.VWStart1.ShutDownWindows False, True '1.Parameter: True=Windows neu starten. ' False=Windows beenden. '2.Parameter: True=Force Shutdown=Windows beenden, auch wenn sich andere ' Programm weigern, zu beenden. ' False=normales Shutdown, andere Programm können das Shutdown verhindern. End Sub