I have a rather large C# Forms application. There's an MdiParent which controls lots of MdiChilds. I also created a 'loading screen' which jumps always on top when the user opens forms which require some loading time.
The thing is, if there are exceptions, I usually use something like Messagebox.Show(ErrorNumber) in the catch, so the user knows what happened. When my loading screen is on, and a message box shows, it's impossible to click it.
I'd like to tweak this. Is there a way to put a function in my MdiParent (or somewhere else, as long as it's just once) so it runs code whenever a MessageBox is shown? This way, I can easily call a function to close my loading screen. There are probably other solutions, but I'd like to learn more about window handles, hooks, etc.