Introduction
Verify if the windows or form is loaded.- Code:
Declaration Function FindWindow
Hide Copy Code
Private Declare Function FindWindow Lib "USER32" Alias "FindWindowA" _(ByVal lpszClassName As String, ByVal lpszWindow As String) As Long
Call the function:
Hide Copy Code
If FindWindow(vbNullString, Caption) Thenmsgbox "Yes"
Else
msgbox "No"
End If
You can verify if a window or form is open not only from visual basic, from windows itself For example you can verify if the application CALC.EXE is loaded.