Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

c++/CLI program - attempt to abort a form used as a splash screen

23 views
Skip to first unread message

bof...@gmail.com

unread,
Apr 29, 2018, 11:55:20 PM4/29/18
to
Hi

I am writing a visual studio C++ / CLI program - I tried to make my own splash screen.

the core code is laid out below.

I think that this should:
1) expose a splash form
2) abort the form
3) wait for the form to abort
4) load MyForm



What happens is that:
a) the splash is loaded
b) the splash stays on the screen until the mouse hovers over the splash window
c) the splash disappears & MyForm loads.


Can you please help - I want to expose the splash screen for a short time and then have it disappear WITHOUT the need for a mouse hovering over the window?




void newSplashFunction()
{
Application::Run(gcnew ProjectSplash::Splash());
}



[STAThreadAttribute] int main(array<String^>^ args)
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);


ProjectSplash::Splash formSplash;
Thread ^ splash_thread = gcnew Thread(gcnew ThreadStart(&newSplashFunction));
splash_thread->IsBackground = TRUE;
splash_thread->Start();
Sleep(1000);
splash_thread->Abort();
do
{
Sleep(2);
} while (splash_thread->IsAlive); // wait for thread to die


availability::MyForm form;
Application::Run(%form);
return 0;

}


thanks for your time
Boffin2
0 new messages