Exemple #1
0
        private static void ActureCloseScreen()
        {
            if (_SplashScreen != null)
            {
                try
                {
                    _SplashScreen.tmr.Stop();
                    _SplashScreen.tmr.Dispose();
                }
                catch
                { }
                finally
                {
                    try
                    {
                        _SplashScreen.Close();
                        _SplashScreen.Dispose();
                    }
                    catch
                    { }
                    finally
                    {
                        _SplashScreen = null;

                        //激活主窗口
                        var href = new HandleRef(null, ApplicationService.Current.MainFormHandle);
                        SetForegroundWindow(href);
                    }
                }
            }
        }
Exemple #2
0
 private static void CreateInstance()
 {
     if (_SplashScreen == null)
     {
         lock (lockobj)
         {
             if (_SplashScreen == null)
             {
                 _SplashScreen = new SplashScreen();
                 _SplashScreen.FormBorderStyle = FormBorderStyle.None;
                 _SplashScreen.ShowInTaskbar = false;
                 _SplashScreen.TopMost = false;
             }
         }
     }
 }