MFC 的 CWnd::IsWindowVisiable();用法:我在Tab中插入一对话框XDlg,再在此XDlg中放一button,xBtn。当我切换到另外的页面再回来的时候,我能看到此按钮,可在OnShowWindow(...)中使用XDlg.IsWindowVisiable();发现结果是FALSE。当然按钮也是FALSE。我都能看到这个对话枉与按钮,为什么报的值是FALSE????我想可能这个函数使用是不是有什么规则是我不知道的。有大X知道的请告诉我一下。多谢。

解决方案 »

  1.   

    IsWindowVisiable等于查看是否具有WS_VISIBLE属性,因为你是CTab,所以我怀疑有这方面的原因在。
      

  2.   

    If the specified window, its parent window, its parent's parent window, and so forth, have the WS_VISIBLE style, the return value is nonzero. Otherwise, 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. 只要的父窗口或父窗口的父窗口拥有WS_VISIBLE属性,那么他的返回值为真。
      

  3.   

    Nonzero if CWnd is visible (has the WS_VISIBLE style bit set, and parent window is visible). Because the return value reflects the state of the WS_VISIBLE style bit, the return value may be nonzero even though CWnd is totally obscured by other windows.MSDN上也是这么说的(同楼上)
      

  4.   

    The IsWindowVisible function retrieves the visibility state of the specified window. SyntaxBOOL IsWindowVisible(          HWND hWnd
    );
    ParametershWnd
    [in] Handle to the window to test. 
    Return ValueIf the specified window, its parent window, its parent's parent window, and so forth, have the WS_VISIBLE style, the return value is nonzero. Otherwise, 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.