我是在MDI下将对话框加入到一个view中,也就是说把好几个对话框镶入到一个view中,然后我用MDI的OUTLOOKBAR中的按钮来控制对话框的生成,但当我重复点击一个按时生成的对话框就会显示在其他对话框的前面我看很多人都用 FINDWINDOWEX来实现,然后在将他们置前,但是现在我不知道FINDWINDOWEX里面的参数怎么设置,他的父句柄是什么?子句柄是什么??
还有要将这个对话框置前怎么设置??弄了好久都没有做出来,请高手指教

解决方案 »

  1.   

    FindWindowEx:
    Parameters
    hwndParent 
    Handle to the parent window whose child windows are to be searched. 
    If hwndParent is NULL, the function uses the desktop window as the parent window. The function searches among windows that are child windows of the desktop. Windows NT 5.0 and later: If hwndParent is HWND_MESSAGE, the function searches all message-only windows. hwndChildAfter 
    Handle to a child window. The search begins with the next child window in the Z order. The child window must be a direct child window of hwndParent, not just a descendant window. 
    If hwndChildAfter is NULL, the search begins with the first child window of hwndParent. Note that if both hwndParent and hwndChildAfter are NULL, the function searches all top-level and message-only windows. lpszClass 
    Pointer to a null-terminated string that specifies the class name or is an atom that identifies the class-name string. If this parameter is an atom, it must be a global atom created by a previous call to theGlobalAddAtom function. The atom, a 16-bit value, must be placed in the low-order word of lpszClass; the high-order word must be zero. 
    lpszWindow 
    Pointer to a null-terminated string that specifies the window name (the window's title). If this parameter is NULL, all window names match.
      

  2.   

    可以尝试一下将hwndParent设置为AfxGetApp()->GetActiveChild();试一下
    把对话框置前BringWindowToTop应该可以
      

  3.   

    搞不清楚关系的话,先用spy++看看组织结构,一目了然
      

  4.   

    得不到子窗体的句柄!
    那用spy++获取ID看看能不能获取子窗体的ID号~~~