Esempio n. 1
0
        public static void Main(string[] args)
        {
            Offsets offs;
            int pid = FindPoeProcess(out offs);

            if (pid == 0)
            {
                MessageBox.Show("Path of Exile is not running!");
                return;
            }

            Sounds.LoadSounds();
            if (!Settings.LoadSettings())
            {
                return;
            }
            using (Memory memory = new Memory(offs, pid))
            {
                offs.DoPatternScans(memory);
                PathOfExile pathOfExile = new PathOfExile(memory);
                pathOfExile.Update();
                OverlayRenderer overlay = null;
                AppDomain.CurrentDomain.UnhandledException += delegate(object sender, UnhandledExceptionEventArgs exceptionArgs)
                {
                    if (overlay != null)
                    {
                        overlay.Detach();
                    }
                    MessageBox.Show("Program exited with message:\n " + exceptionArgs.ExceptionObject.ToString());
                    Environment.Exit(1);
                };
                try
                {
                    Console.WriteLine("Starting overlay");
                    TransparentDXOverlay transparentDXOverlay = new TransparentDXOverlay(pathOfExile.Window, () => memory.IsInvalid());
                    transparentDXOverlay.InitD3D();
                    overlay = new OverlayRenderer(pathOfExile, transparentDXOverlay.RC);
                    Application.Run(transparentDXOverlay);
                }
                finally
                {
                    if (overlay != null)
                    {
                        overlay.Detach();
                    }
                }
            }
        }
Esempio n. 2
0
        public static void Main(string[] args)
        {
            Offsets offs;
            int     pid = FindPoeProcess(out offs);

            if (pid == 0)
            {
                MessageBox.Show("Path of Exile is not running!");
                return;
            }

            Sounds.LoadSounds();
            if (!Settings.LoadSettings())
            {
                return;
            }
            using (Memory memory = new Memory(offs, pid))
            {
                offs.DoPatternScans(memory);
                PathOfExile pathOfExile = new PathOfExile(memory);
                pathOfExile.Update();
                OverlayRenderer overlay = null;
                AppDomain.CurrentDomain.UnhandledException += delegate(object sender, UnhandledExceptionEventArgs exceptionArgs)
                {
                    if (overlay != null)
                    {
                        overlay.Detach();
                    }
                    MessageBox.Show("Program exited with message:\n " + exceptionArgs.ExceptionObject.ToString());
                    Environment.Exit(1);
                };
                try
                {
                    Console.WriteLine("Starting overlay");
                    TransparentDXOverlay transparentDXOverlay = new TransparentDXOverlay(pathOfExile.Window, () => memory.IsInvalid());
                    transparentDXOverlay.InitD3D();
                    overlay = new OverlayRenderer(pathOfExile, transparentDXOverlay.RC);
                    Application.Run(transparentDXOverlay);
                }
                finally
                {
                    if (overlay != null)
                    {
                        overlay.Detach();
                    }
                }
            }
        }
Esempio n. 3
0
        private void TransparentDXOverlay_Load(object sender, EventArgs e)
        {
            Console.WriteLine("SetWindowLong: " + TransparentDXOverlay.SetWindowLong(base.Handle, -20, (IntPtr)((long)((ulong)(TransparentDXOverlay.GetWindowLong(base.Handle, -20) | 524288u | 32u)))));
            Console.WriteLine("SetWindowLong error: " + Marshal.GetLastWin32Error());
            TransparentDXOverlay.SetLayeredWindowAttributes(base.Handle, 0u, 255, 2u);
            Rect rect = this.window.ClientRect();

            this.marg.Left   = rect.X;
            this.marg.Top    = rect.Y;
            this.marg.Right  = rect.X + rect.W;
            this.marg.Bottom = rect.Y + rect.H;
            IntPtr intPtr = TransparentDXOverlay.DwmExtendFrameIntoClientArea(base.Handle, ref this.marg);

            Console.WriteLine("DwmExtendFrameIntoClientArea: " + intPtr);
            base.Bounds = new Rectangle(rect.X, rect.Y, rect.W, rect.H);
            TransparentDXOverlay.CurrentHandle = base.Handle;
            this.dxThread = new Thread(this.DxLoop);
            this.dxThread.IsBackground = true;
            this.dxThread.Start();
        }
Esempio n. 4
0
 private static extern IntPtr DwmExtendFrameIntoClientArea(IntPtr hWnd, ref TransparentDXOverlay.Margins pMargins);