How to retrieve list of MdiChilds

Oct 29, 2010 at 5:31 AM

Hello, I am new to White and I am currently trying to retrieve a list of MDIChilds from my window.  I used the MdiChild method but got me only the first MDI Child it found.  How to retrieve the remaining childs.   I tried to do the following

 public IUIItemContainer [] NewPage { get { return mainWindow.MdiChild(SearchCriteria.ByControlType(ControlType.Window)); } }

 I need to evaluate the list in order to find a particular MDI that contains a particular string.  I know a subset of the string so I am not able to use .AndByText and add the string I can use a wildcard.  I don't know how to use the keyword Contains in this content either.   Any suggestions?   Thanks in advance.


Oct 29, 2010 at 7:19 AM


Get operation always return the first found.


please try:


application.GetWindows(); are your mdi windows part of the list?





Oct 29, 2010 at 4:38 PM

Thanks,  but GetWindows() returned only the MainWindow for me.  The window I need is  an embedded window in the MainWindow.
This is the Hierarchy in UISpy:

-- MainWindow
    -- Custom control
          -- group
              -- window Win1
              -- window Win2
              -- window Win3      ( This is the window I'm interested in)

so how do I retrieve Win1, Win2, and Win3.   Part of the Name property of  Win3 is dymanic so I want to be able to say Get MdiChild where  the name contains "New Page" string.    When I use the MdiChild () method, like you said it returns the first one.  I want to be able to specify exactly which one to catch.   I have used GetWindows().Where (p=> ...  That did not work.

Thanks again in advance.

Oct 29, 2010 at 5:54 PM

I resloved the problem.   I have used  .ModalWindows() instead and was able to get all sub-windows.  However, I am a bit confused.  What would be the difference then between MDIChild and ModalWindow?

Thank you very much.

Nov 1, 2010 at 8:52 AM
Edited Nov 1, 2010 at 2:43 PM

I'm not sure but modal windows, don't allow actions on the parent window, only on the modal dialog himself.

mdi childs are 'inner' windows, and its a windows forms construct (MDI)

Visual Studio 6 is an MDI Application




so in fact I'm not sure why you get them as model windows.