Declare Function ExitWindows% Lib "User" (ByVal dwReturnCode&, ByVal Reserved%)
' constants used by Windows API functions
Const EW_RESTARTWINDOWS = &H42
Const WF_ENHANCED = &H20
Dim Loaded%
Sub Form_Load ()
If GetWinFlags&() And WF_ENHANCED = 0 Then
MsgBox "Because Windows is not in 386 Enhanced mode, VBLog will not be able to log file events occurring in DOS boxes", MB_OK + MB_ICONINFORMATION, "VBLog Message"
If MsgBox("Windows is not set up to receive notification of file activity in DOS boxes. Enable this feature and restart Windows?", MB_YESNO + MB_ICONQUESTION, "VBLog Message") = IDYES Then
If FileCdrInstallVB(Form1.hWnd, Invisible_Text.hWnd) = 0 Then
MsgBox "Unable to install VB Log. FileCDR is in use by another program - probably File Manager", MB_OK + MB_ICONINFORMATION, "VB Log Message"
Loaded% = False
Unload Form1
Else
Loaded% = True
End If
End Sub
Sub Form_Resize ()
Grid1.Move 0, 0, ScaleWidth, ScaleHeight
Grid1.ColWidth(4) = ScaleWidth
End Sub
Sub Form_Unload (Cancel As Integer)
If Loaded% Then
If FileCdrUnInstall(Form1.hWnd) = 0 Then
MsgBox "The FileCdr function could not be uninstalled. You may have to restart Windows to regain access to FileCdr.", MB_OK + MB_ICONINFORMATION, "VB Log Message"