Beispiel #1
0
        static void Main(string[] args)
        {
#if WINDOWS
            // Sciter needs this for drag'n'drop support; STAThread is required for OleInitialize succeess
            int oleres = PInvokeWindows.OleInitialize(IntPtr.Zero);
            Debug.Assert(oleres == 0);
#endif
#if GTKMONO
            PInvokeGTK.gtk_init(IntPtr.Zero, IntPtr.Zero);
            Mono.Setup();
#endif

#if false
//#if !DEBUG && WINDOWS
            if (SingleInstance.IsRunningAndAcquire())
            {
                return;
            }
#endif

            App.Run();

#if false
//#if !DEBUG && WINDOWS
            SingleInstance.Release();
#endif
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            #region Args handling
            bool arg_in_test = false;

            if (args.Length > 0)
            {
                if (args[0].StartsWith("-jumplist:"))
                {
                    MainWindow.SendJumplistCmd(args[0].Substring(10));
                    return;
                }
            }
            #endregion

            //UpdateControl.Setup();

            // Sciter needs this for drag'n'drop support; STAThread is required for OleInitialize succeess
            int oleres = PInvokeWindows.OleInitialize(IntPtr.Zero);
            Debug.Assert(oleres == 0);
            Debug.WriteLine("Sciter " + SciterX.Version);

            // Create the window
            var wnd = WndMain = new MainWindow();
            wnd.CreateMainWindow(1, 1);
            wnd.CreateTaskbarIcon();
            wnd.CreateJumplists();
            wnd.Title = MainWindow.WND_TITLE;

            // Prepares SciterHost and then load the page
            var host = new BaseHost();
            host.Setup(wnd);
            host.AttachEvh(new HostEvh());
            host.SetupPage("index.html");

            //HookerInstance.SetMessageHook();

            if (!arg_in_test && SingleInstance.IsRunningAndAcquire())
            {
                Debug.WriteLine("ALREADY RUNNING!");
                return;
            }

            //MainWindow.SendJumplistCmd("BringToFront");
            //wnd.CreateNote();

            // Run message loop
            PInvokeUtils.RunMsgLoop();

            Exit();
        }