'C# create crosshair overlay for video game

(I know this is very bootleg) I've currently made a FORM that acts as an overlay and I'm using panels as the crosshair however whenever I try to put the panels in front of the game the panels take control and my mouse hovers over the panel and rather the game... im thinking maybe painting over it instead?



Solution 1:[1]

The Solution:

   protected override System.Windows.Forms.CreateParams CreateParams
    {
        get
        {
            CreateParams cp = base.CreateParams;
            cp.ExStyle = cp.ExStyle | WS_EX_TRANSPARENT;
            return cp;
        }
    }

I took two panels lined them up perfectly and placed them. Adding this param makes the code "visible" but "unclickable" which worked wonders.

Quick Mention

     this.Opacity = 1;
        this.TopMost = true;
        this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
        this.WindowState = FormWindowState.Maximized;

This Will help with making the Program always stay in front.

And always remember folks! Overlays can be DETECTED but that does not mean you will get banned :)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1