コード例 #1
0
        public wnd_Radar()
        {
            InitializeComponent();

            if (!Sig.Init())
            {
                MessageBox.Show("Failed to Load!\nMake Sure You Have CS:GO Started Before Launching.");
                Environment.Exit(Environment.ExitCode);
            }
        }
コード例 #2
0
        public wnd_overlay()
        {
            if (!Sig.Init())
            {
                MessageBox.Show("Failed to Load!\nMake Sure You Have CS:GO Started Before Launching.");
                Environment.Exit(Environment.ExitCode);
            }

            Paint += Wnd_overlay_Paint;

            var initialStyle = WinAPI.GetWindowLong(Handle, -20);

            WinAPI.SetWindowLong(Handle, -20, initialStyle | 0x80000 | 0x20 | 0x80);

            SetStyle(ControlStyles.OptimizedDoubleBuffer |
                     ControlStyles.AllPaintingInWmPaint |
                     ControlStyles.DoubleBuffer |
                     ControlStyles.UserPaint |
                     ControlStyles.Opaque |
                     ControlStyles.ResizeRedraw |
                     ControlStyles.SupportsTransparentBackColor, true);

            InitializeComponent();

            var factory    = new Factory();
            var renderProp = new HwndRenderTargetProperties
            {
                Hwnd           = Handle,
                PixelSize      = new Size2(Width, Height),
                PresentOptions = PresentOptions.Immediately
            };

            Device = new WindowRenderTarget(factory,
                                            new RenderTargetProperties(new PixelFormat(Format.B8G8R8A8_UNorm, AlphaMode.Premultiplied)),
                                            renderProp);


            factory.Dispose();

            updateWnd.RunWorkerAsync();
            OnResize(null);
            SharpDXThread.Start();
        }