if form1.visible then
  正在显示
else
  没有显示
end if

解决方案 »

  1.   

        Dim i As Long
        For i = 0 To Forms.Count - 1
            If Forms(i) Is <YourWindowName> Then
                <YourWindowName>.ZOrder 0  '将其显示出来
                Exit Sub
            End If
        Next
      

  2.   

    修正:  Exit For    (Not 'Exit Sub')
      

  3.   

    Public Declare Function IsWindowVisible Lib "user32" Alias "IsWindowVisible" (ByVal hwnd As Long) As Longhwnd 是窗口的句柄。如果是自己的窗口可以直接使用myform.hwnd,否则续通过findwindow或者遍历所有的窗口(gettopwindow,getnextwindow)得到窗体的caption(getwindowtext)来判断是否是自己所要查找的窗体。
      

  4.   

    IsWindowVisible函数有如下说明:
    If the specified window and its parent window do not have the WS_VISIBLE style, the return value is zero. Because the return value specifies whether the window has the WS_VISIBLE style, it may be nonzero even if the window is totally obscured by other windows. 所以我怀疑这个函数的实际作用是否可实现这位兄弟的要求。
      

  5.   

    用GetActiveWindow判断这个窗口是否激活窗口算了吧
      

  6.   

    为什么还要得标题???
    if GetActiveWindow()=Form?.Hwnd then
    不就行了吗?
      

  7.   

    findwindows()似乎可以,findwindow可返回最上层窗口的句柄。不过对于窗体的子窗体似乎是无效的,还有其它方法吗?
      

  8.   

    form.visible对于普通窗体似乎可以,但对于mdi的子窗体是无效的,不信大家试试先.
    无论如何谢谢大家给出这么多方法!!!thank!!!
      

  9.   

    if isiconic(hwnd) then 
    'hidden
    else
    dim rct as rect
    r=getwindowrect (rct)
    endif