Plex 2E

 View Only
  • 1.  close all top application window

    Posted Nov 05, 2019 06:50 AM
    Hello,
    i have trasform all MDIChild windows of my applcation in Top Application Windows.
    i use the api winapi\CloseAllChildWindows to close all my mdi child panel but it doesn't works with top application panel.
    any suggest?

    thanks
    Michela


  • 2.  RE: close all top application window

    Posted Nov 06, 2019 12:06 PM
    Without resorting to a lot of source code, I would have one program that knows all of the possible top application windows, and then uses the "winapi/TriggerEvent" to send them all a "Close" event.   You may need to add the "Close" event to your patterns.  If you wanted to get fancy, you could have all programs list themselves in an array in shareddata, and then iterate through the array to close all active programs.  You would have to have code to remove the programs from the array as they closed.

    If you want to close all of the program at once, you could just close the main program.

    If you do not mind source code, you can use something like EnumThreadWindows .  This would require a callback function that would process all windows passed to it.  It could call CloseWindow on each handle.  You would want to maintain a (global) field or two, or use the LPARAM to refer to a window not to close.


  • 3.  RE: close all top application window
    Best Answer

    Posted Nov 07, 2019 06:35 AM
    I tried using the TriggerEvent method
    it works fine. In this way I can also check the open windows before closing them.

    Thanks