Example #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            using (Ols = new OpenLibSys.Ols())
            {
                try
                {
                    if (Ols.GetStatus() != (uint)OpenLibSys.Ols.Status.NO_ERROR)
                    {
                        throw new Exception("WinRing0 could not be initialized.\nMake sure to use the right release for your system: " +
                                            (IntPtr.Size == 8 ? "x64" : "x86"));
                    }

                    var form = new Form1();
                    form.CreateControl();

                    var args = Environment.GetCommandLineArgs();
                    if (args.Length == 2 && args[1].ToLower() == "-minimize")
                    {
                        const int WM_SIZE        = 5;
                        const int SIZE_MINIMIZED = 1;

                        PostMessage(form.Handle, WM_SIZE, new IntPtr(SIZE_MINIMIZED), IntPtr.Zero);
                    }
                    else
                    {
                        form.Show();
                    }

                    Application.Run();
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message + "\n\n" + e.StackTrace, "BrazosTweaker exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Application.Exit();
                }
            }
        }
Example #2
0
		static void Main()
		{
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);

			using (Ols = new OpenLibSys.Ols())
			{
                try
				{
					if (Ols.GetStatus() != (uint)OpenLibSys.Ols.Status.NO_ERROR)
					{
						throw new Exception("WinRing0 could not be initialized.\nMake sure to use the right release for your system: " +
							(IntPtr.Size == 8 ? "x64" : "x86"));
					}

                    var form = new Form1();
					form.CreateControl();

					var args = Environment.GetCommandLineArgs();
					if (args.Length == 2 && args[1].ToLower() == "-minimize")
					{
						const int WM_SIZE = 5;
						const int SIZE_MINIMIZED = 1;

						PostMessage(form.Handle, WM_SIZE, new IntPtr(SIZE_MINIMIZED), IntPtr.Zero);
					}
					else
						form.Show();

					Application.Run();
				}
				catch (Exception e)
				{
					MessageBox.Show(e.Message + "\n\n" + e.StackTrace, "BrazosTweaker exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
					Application.Exit();
				}
			}
		}
 public bool Initialize()
 {
     MyOls = new OpenLibSys.Ols();
     return(MyOls.GetStatus() == (uint)OpenLibSys.Ols.Status.NO_ERROR);
 }