reinaldocrespo wrote:Hi and thank you everyone. This is good brainstorming.
I think the following code incorporates from all of your ideas. It seems to do the trick. Please advise on your opinion:
Change Method Activate() on rPreview to:
   if ::oDevice:lPrvModal     StopUntil( { || ::lExit .or. WndMain() == Nil .or. !IsWindow( WndMain():hWnd ) } )    endif
This closes all the open rpreview windows when the main app is closed. Am I missing/forgetting/ommiting something?
Reinaldo.
This has the side effect of the preview window going behind the dialog where there is no wndMain() and the program is started with a dialog.
Test program:
#include "fivewin.ch"
procedure main()
  xbrowse( "\fwh\samples\customer.dbf" )
returnBefore finalizing a modification to a program like RPreview, we need to test the code in all these cases:
1. MDI application
1.1 From MDICHILD (a) Modal and (b) Nonmodal
1.2 From a Dialog inside the app (a) Modal and (b) Nonmodal
2. Normal window
2.1 From Window (a) Modal and (b) Nonmodal
2.2 From a Dialog inside the app (a) Modal and (b) Nonmodal
3. App starting with a Dialog
3.1 From main dialog (a) Modal and (b) Nonmodal
3.2 From a subdialog (a) Modal and (b) Nonmodal
We also need to test any processes initiated by any button of the preview window in all the above cases.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India