I have a Visual Studio solution that contains multiple WPF projects. The main project launches a WPF application that acts as the parent/gateway to the other projects. After navigating the menus on the main application window, there is a button that launches another application that displays MS Access DB information. The code to launch the secondary application from the main application is as follows (with some names/paths changed for simplicity):
private void OpenDatabase(object sender, RoutedEventArgs e)
{
ShowInTaskbar = false; // prevents parent app from showing in taskbar
Process DBAPP = new Process();
DBAPP.StartInfo.FileName = "path\to\DBAPP.exe";
DBAPP.Start();
DBAPP.WaitForExit();
ShowInTaskbar = true; // parent app now shows in taskbar
}
The secondary, database application has ShutdownMode="OnExplicitShutdown", then within the mainWindow.cs ( not the App.xaml(.cs) ) I have a handler for the close button as follows:
private void CloseMainMenu(object sender, RoutedEventArgs e)
{
Close();
Application.Current.Shutdown();
}
When I hit close on the secondary application I return to the first chunk of code and I see an error on the line ShowInTaskbar = true;
that says "System.ComponentModel.Win32Exception: 'Not enough quota is available to process this command'"
I only see this error when I have the secondary application running for more than around 3-5 minutes - possibly the database connection or the windows themselves using up resources; if I quickly open the secondary application and close it immediately - returning to the main application - I do not see this error.