Results 1 to 4 of 4

Thread: handle stil in use??

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2001
    Location
    Netherlands
    Posts
    115

    handle stil in use??

    how can I check whether a handle is still in use??
    I have to check whether a form is still loaded??


    please help,

    VIsualPenguin
    ICQ :137108715
    MSN Messenger : [email protected]

  2. #2
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    Code:
    Private Function IsFormLoaded(byval FormName As String) As Boolean
    
    Dim fThis As Form
    
    For Each fThis In Forms
      If fThis.Name = FormName Then
          IsFormLoaded = True
          Exit Function
      End If
    Next fThis
    
    End Function
    Another way is to store the given form's hWnd in a long variable and then later check it using the IsWindow() API call.

    HTH,
    Duncan
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  3. #3
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    But to store the .hWnd property you'd cause the form to be loaded first
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Oct 2001
    Location
    Netherlands
    Posts
    115
    thanks

    visualpenguin
    ICQ :137108715
    MSN Messenger : [email protected]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width