*** Make sure FoxTools is loaded SET LIBRARY TO home() + 'FoxTools' ADDITIVE *** Get the whandle for the current window lnHandle=_WonTop() *** Find out what kind of window it is *** If this is not a code editing window, *** there is nothing to do lnResult = _EdGetEnv( lnHandle, @laEnv ) *** In order for this to be a valid window, *** Check the following array items: *** [ 1 ] File Name is not empty *** [ 2 ] File Size is greater than 0 bytes *** [ 12 ] Is File ReadOnly ? *** 0 - No *** 1 - Yes *** 2 - RW but opened RO *** 3 - RO opened RO *** [ 17 ] SelStart *** [ 18 ] SelEnd *** [ 25 ] Editor Session *** 0 - Command Window *** 1 - Program File *** 2 - Text Editor *** 8 - Menu Code Edit Window *** 10 - Method Code Edit Window *** 12 - Stored Proc in DBC *** This returns 1 if successful in populating the array, 0 otherwise