
- How to run microsoft project on windows 10 how to#
- How to run microsoft project on windows 10 code#
- How to run microsoft project on windows 10 windows#
_form1->Closed += gcnew EventHandler( this, &MyApplicationContext::OnFormClosed ) Create both application forms and handle the Closed event Exit the current thread instead of showing the windows. MessageBox::Show( "An error occurred while attempting to show the application. Inform the user that an error occurred. _userData = gcnew FileStream( String::Concat( Application::UserAppDataPath, "\\appdata.txt" ),FileMode::OpenOrCreate ) Create a file that the application will store user specific data in. Handle the ApplicationExit event to know when the application is exiting.Īpplication::ApplicationExit += gcnew EventHandler( this, &MyApplicationContext::OnApplicationExit ) System::Drawing::Rectangle _form2Position System::Drawing::Rectangle _form1Position Ref class MyApplicationContext: public ApplicationContext
How to run microsoft project on windows 10 windows#
The class that handles the creation of the application windows
How to run microsoft project on windows 10 code#
See the ApplicationContext class overview for the whole code listing. The code for the AppForm1 and AppForm2 forms is not shown for the purpose of brevity. The Main method calls Application.Run(context) to start the application given the ApplicationContext. The form position data is stored in a file titled Appdata.txt that is created in the location determined by UserAppDataPath. The class stores the positions of each form for the user. The class MyApplicationContext inherits from ApplicationContext and keeps track when each form is closed, and exits the current thread when they both are.
How to run microsoft project on windows 10 how to#
This example demonstrates how to use an ApplicationContext, along with the Application.Run(context) method, to display multiple forms when the application starts. When the application starts and exits, the position of each form is remembered. The example displays two forms and exits the application when both forms are closed.

See alsoĪ main message loop is already running on this thread. For all other situations, use the Run(ApplicationContext) overload, which supports supplying an ApplicationContext object for better control over the lifetime of the application.

You should use the Run(Form) overload to start an application with a main form, so that the application terminates when the main form is closed. Most Windows Forms developers will not need to use this version of the method. In Windows Forms, this loop is closed when the Exit method is called, or when the ExitThread method is called on the thread that is running the main message loop. When the main message loop is closed, the application exits. Every running Windows-based application requires an active message loop, called the main message loop. In a Win32-based or Windows Forms application, a message loop is a routine in code that processes user events, such as mouse clicks and keyboard strokes. A main message loop is already running on this thread.
