How to close duplicate Primary Windows

Discussion created by vijaylfg on Mar 21, 2018
Latest reply on Mar 22, 2018 by Kersters

Hi All,


I need your help here for below new requirement. Can you please provide your suggestion. 


We are using CA GEN 8.0. There is a WINDOW GUI CLIENT Procedure "MAIN" that has only one Primary window. From this primary window, we can navigate to other client procedures/screens. User clicks the MAIN.EXE file and invoke the application.


Till date, they are using only one window/instance, that is one time .EXE click and use only one window,  no need for duplicate/separate window by repeatedly clicking MAIN.EXE.


But today there is a need for the user to open and use multiple windows open. That is multiple times, the user will click MAIN.EXE and use multiple duplicate/separate Primary Window. We need to add a new push button ("Close Older Sessions") to the Primary Window. When the user click the new push button ("Close Older Sessions") on the recently opened Primary window, previously opened Primary windows (not the current window where the user clicks the push button) has to be closed.


For Example, 


Three windows are opened the user one after another. When the user clicks the push button ("Close Older Sessions") on third recent window, the first and second windows should be closed. Third window should remain open. 


I am aware that we can get the handle for each window and manipulate the window and its controls thru External action block (C source code). When each window opens, we can write the handle value to a text file on user machine. When the user clicks the push button, that time we can read each handle value and send WM_CLOSE winapi command for closing the older sessions. 


I am not sure about my idea. So, I need your help in finding better solution for my requirement. Please suggest. 



With thanks