VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Is a certain form open?

Matthew Roberts  (26 Submissions)   Miscellaneous   Visual Basic 3.0   Beginner   Wed 3rd February 2021

Simple API call that tells whether or not a particular form is open. Useful for managing popup forms or a series of forms.
Sample usage:

If FormIsOpen("Color Picker") Then
' ....Do Something Here
Else
' ...Do Something Else Here...
End If

Inputs
FormName

Assumes
Goes by form title, so multiple instances of a form can be used as long as their titles are different. Also works with other applications...any window in fact, so it is not limited to your VB forms.

Returns
Boolean. True=Form is open.

API Declarations
Private Declare Function FindWindow Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName As String, ByVal _
lpWindowName As String) As Long

Rate Is a certain form open? (3(3 Vote))
Is a certain form open?.bas

Is a certain form open? Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters