jaromir Posted February 25, 2019 Share Posted February 25, 2019 Hello, Is it possible to know actual (topmost) window name / class name / caption ? I'm hook my debug email system at DMServer.OnException and I want to know which app window has problem.. Thanks Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 25, 2019 Share Posted February 25, 2019 53 minutes ago, jaromir said: Is it possible to know actual (topmost) window name / class name / caption ? Hello, For what purpose? Please explain. Quote Link to comment Share on other sites More sharing options...
jaromir Posted February 25, 2019 Author Share Posted February 25, 2019 As described above. I send debug e-mail from OnException server module event handler. In this e-mail I want to put window name / class name where exception was raised. Is it clear ? Quote Link to comment Share on other sites More sharing options...
jaromir Posted February 28, 2019 Author Share Posted February 28, 2019 I made this this way. But this is workaround. I'm pretty sure that better way exists. TDMMain = class(TUniGUIMainModule) private { Private declarations } fLastFormInstanceClassName: String; public { Public declarations } function GetFormInstance(const InClass: TClass): TComponent; end; function TDMMain.GetFormInstance(const InClass: TClass): TComponent; begin fLastFormInstanceClassName := InClass.ClassName; Result := inherited GetFormInstance(InClass); end; TDMServer = class(TUniGUIServerModule) procedure UniGUIServerModuleException(Sender: TUniGUIMainModule; AException: Exception; var Handled: Boolean); end; procedure TDMServer.UniGUIServerModuleException(Sender: TUniGUIMainModule; AException: Exception; var Handled: Boolean); begin SendEmailMessage(DMMain.LastFormInstanceClassName, AException.ClassName, AException.Message); end; 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.