public static MessagePumpWindow GetWindow()
 {
     if (instance == null)
     {
         instance = new MessagePumpWindow();
     }
     return(instance);
 }
Example #2
0
        public static void Main(string[] args)
        {
            var coreRunner = new Thread((_) =>
            {
                CreateHostBuilder(args).Build().Run();
            });

            coreRunner.Start();
            MessagePumpWindow.MessageLoop();
        }
        public SimConnectApi()
        {
            var w = MessagePumpWindow.GetWindow();

            WindowHandle     = w.Hwnd;
            w.WndProcHandle += W_WndProcHandle;

            var runner = new Thread((obj) =>
            {
                while (!MessagePumpWindow.GetWindow().Disposed)
                {
                    Timer_Tick(null, null);
                    Thread.Sleep(1000);
                }
            });

            runner.IsBackground = true;
            runner.Start();
        }
Example #4
0
 private void Stopping()
 {
     simConnectApi.Disconnect();
     MessagePumpWindow.GetWindow().Dispose();
 }