Beispiel #1
0
        static void Main()
        {
            CallForm frm;

            if (!EnsureSingleInstance())
            {
                return;
            }

            Application.ThreadException += new ThreadExceptionEventHandler(UIThreadException);
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandledException);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            frm               = new CallForm();
            frm.Root          = new Root();
            frm.Root.callForm = frm;
            if (frm.Root.FormOpacity > 0)
            {
                frm.Show();
            }
            frm.Top     = frm.Root.FormTop;
            frm.Left    = frm.Root.FormLeft;
            frm.Width   = frm.Root.FormWidth;
            frm.Height  = frm.Root.FormWidth;
            frm.Opacity = frm.Root.FormOpacity / 100.0;
            if (Environment.CommandLine.IndexOf("--StartInking", StringComparison.OrdinalIgnoreCase) >= 0)
            {
                PostMessage((IntPtr)HWND_BROADCAST, StartInkingMsg, (IntPtr)null, (IntPtr)null); // to Myself
            }
            Application.Run();
        }
Beispiel #2
0
        static void Main()
        {
            CallForm frm;

            Application.ThreadException += new ThreadExceptionEventHandler(UIThreadException);
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandledException);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            frm      = new CallForm();
            frm.Root = new Root();
            if (frm.Root.FormTop >= 0)
            {
                frm.Root.callForm = frm;
                //frm.Show();
                frm.Top     = frm.Root.FormTop;
                frm.Left    = frm.Root.FormLeft;
                frm.Width   = frm.Root.FormWidth;
                frm.Height  = frm.Root.FormWidth;
                frm.Opacity = frm.Root.FormOpacity / 100.0;
            }
            Application.Run();
        }
Beispiel #3
0
        static void Main()
        {
            CallForm frm;

            if (!EnsureSingleInstance())
            {
                return;
            }

            Application.ThreadException += new ThreadExceptionEventHandler(UIThreadException);
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandledException);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            DateTime n = DateTime.Now;

            Environment.SetEnvironmentVariable("YYYY", n.Year.ToString("0000"));
            Environment.SetEnvironmentVariable("YY", (n.Year % 100).ToString("00"));
            Environment.SetEnvironmentVariable("MM", n.Month.ToString("00"));
            Environment.SetEnvironmentVariable("DD", n.Day.ToString("00"));
            Environment.SetEnvironmentVariable("H", n.Hour.ToString("00"));
            Environment.SetEnvironmentVariable("M", n.Month.ToString("00"));
            Environment.SetEnvironmentVariable("S", n.Second.ToString("00"));

            frm = new CallForm(new Root());
            //frm.Root = new Root();
            frm.Root.callForm = frm;
            if (frm.Root.FormOpacity > 0)
            {
                frm.Show();
            }
            // if not applied after shown there seems to be issues with the dimensions
            frm.Top     = frm.Root.FormTop;
            frm.Left    = frm.Root.FormLeft;
            frm.Width   = frm.Root.FormWidth;
            frm.Height  = frm.Root.FormWidth;
            frm.Opacity = frm.Root.FormOpacity / 100.0;
            if (Environment.CommandLine.IndexOf("--StartInking", StringComparison.OrdinalIgnoreCase) >= 0)
            {
                PostMessage((IntPtr)HWND_BROADCAST, StartInkingMsg, (IntPtr)null, (IntPtr)null); // to Myself
            }
            Application.Run();
        }
Beispiel #4
0
        static void Main()
        {
            if (!EnsureSingleInstance())
            {
                return;
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            AllocConsole();
            ShowWindow(GetConsoleWindow(), 0);
            Application.ThreadException += new ThreadExceptionEventHandler(UIThreadException);
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandledException);

            // add some debug the help analysis for some testcase reports
            Console.WriteLine();
            foreach (Screen sc in Screen.AllScreens)
            {
                Console.WriteLine("Screen #" + sc.DeviceName);
                Console.WriteLine(sc.Bounds.ToString() + " == " + sc.WorkingArea.ToString());
            }
            Console.WriteLine();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            DateTime n = DateTime.Now;

            Environment.SetEnvironmentVariable("YYYY", n.Year.ToString("0000"));
            Environment.SetEnvironmentVariable("YY", (n.Year % 100).ToString("00"));
            Environment.SetEnvironmentVariable("MM", n.Month.ToString("00"));
            Environment.SetEnvironmentVariable("DD", n.Day.ToString("00"));
            Environment.SetEnvironmentVariable("H", n.Hour.ToString("00"));
            Environment.SetEnvironmentVariable("M", n.Month.ToString("00"));
            Environment.SetEnvironmentVariable("S", n.Second.ToString("00"));

            frm = new CallForm(new Root());
            //frm.Root = new Root();
            frm.Root.callForm = frm;
            if (frm.Root.FormOpacity > 0)
            {
                frm.Show();
            }
            // if not applied after shown there seems to be issues with the dimensions
            frm.Top     = frm.Root.FormTop;
            frm.Left    = frm.Root.FormLeft;
            frm.Width   = frm.Root.FormWidth;
            frm.Height  = frm.Root.FormWidth;
            frm.Opacity = frm.Root.FormOpacity / 100.0;
            if (Environment.CommandLine.IndexOf("--StartInking", StringComparison.OrdinalIgnoreCase) >= 0)
            {
                PostMessage((IntPtr)HWND_BROADCAST, StartInkingMsg, (IntPtr)null, (IntPtr)null); // to Myself
            }
            foreach (ProcessModule module in Process.GetCurrentProcess().Modules)
            {
                Console.WriteLine(string.Format("Loaded: {0}", module.FileName));
            }
            Console.WriteLine("-----------");
            foreach (Assembly a in AppDomain.CurrentDomain.GetAssemblies())
            {
                Console.WriteLine(string.Format("Found: {0} - {1}", a.FullName, a.Location));
            }

            Application.Run();
            FreeConsole();
        }