Hi Emad,
A easy way to find out which Windows are open is to have a Global queue or Global Variables to record their Open status. A way of refreshing a ListBox is by sending a POST() or NOTIFY() command to the corresponding thread. Please look in the help for more information.
A posting made by someone in the NG on the use of NOTIFY
--------------------------------------------------------
I use NOTIFY and NOTIFICATION for this.
Create a global LONG to hold the thread of the window
THREAD:MyBrowse
I usually also create my Notify commands as global equates
NC_CloseWindow EQUATE( 100 )
In the OpenWindow embed of the browse, put:
THREAD:MyBrowse = THREAD()
On the browse you need two local variables:
NCode UNSIGNED
NParam LONG
On the browse embed for EVENT:Notify put:
IF NOTIFICATION( NCode, NParam)
CASE NCode
OF NC_CloseWindow
POST( EVENT:CloseWindow )
END
END
Back on your button on the appframe, put this in the embed
NOTIFY( NC_CloseWindow, THREAD:MyBrowse )
You should note that you can do a similar task by using POST to post an event to the browse thread (identify it in a similar manner), but if your not using NOTIFY you should look at the docs and get used to it.
It is a better method and also allows you to pass a LONG as a parameter to the NOTIFICATION event.
This is a very powerful feature and quite useful IMHO.
-----------------------------------------------------------
Regards