mierlp Posted June 21, 2013 Share Posted June 21, 2013 hi i have a login/logout procedure and when the user logs out all active forms must be closed EXCEPT the main form How can i do this ? Regards Peter Quote Link to comment Share on other sites More sharing options...
Semper Posted June 21, 2013 Share Posted June 21, 2013 Hi, You can do something like procedure that minimize all open windows in Simple Desktop Demo Regards Quote Link to comment Share on other sites More sharing options...
TNT23 Posted August 17, 2013 Share Posted August 17, 2013 You can to somenthing like this for I := 0 to UniApplication.UniSession.FormsList.Count-1 do Begin if TUniForm(UniApplication.UniSession.FormsList.Items).ClassType<>TMainForm then //TMainForm Is the class of the form that you dont want to close TUniForm(UniApplication.UniSession.FormsList.Items).Close;End; Quote Link to comment Share on other sites More sharing options...
tappatappa Posted August 28, 2013 Share Posted August 28, 2013 You can to somenthing like this for I := 0 to UniApplication.UniSession.FormsList.Count-1 do Begin if TUniForm(UniApplication.UniSession.FormsList.Items).ClassType<>TMainForm then //TMainForm Is the class of the form that you dont want to close TUniForm(UniApplication.UniSession.FormsList.Items).Close; End; Hi tnt23, once I tried something like that, but I found it a little dangerous: it may have a strange behaviour when exceptions are thrown. On the other hand, it surely is the simplest way to achieve what mierlp is asking for. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.