(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?
Asked
Active
Viewed 618 times
0
-
Should your overlay form NEVER take focus? How is it being used? – Idle_Mind Apr 08 '22 at 17:28
-
it sits on topmost true in front of the game and I'm using the panels as crosshairs... ive just implemented a paint function but it was easier using panels lol... – James L Apr 08 '22 at 17:57
-
yes i want it to sit in front but never take focus!! – James L Apr 08 '22 at 17:58
-
So you're moving it programmatically?...don't need the user to be able to click and drag to move it? – Idle_Mind Apr 08 '22 at 18:08
-
No im not doing anything to it it just sits there im not making a game im making an overlay that sits in front of the game my only problem is when i try to use the overlay over the game it tabs/focuses onto the overlay which i dont want it to do – James L Apr 08 '22 at 18:23
-
Two solutions i think would work perfectly but dont know: replace panels entirely and draw https://www.unknowncheats.me/forum/arma-3-a/148183-simple-external-crosshair.html - tried this but it still has the same error... The Form seems to take focus everytime i shoot :) let me know if you have a work around – James L Apr 08 '22 at 18:26
-
Two options that might be useful: Set [WS_EX_TRANSPARENT](https://stackoverflow.com/a/69991925/2330053) on your window so that all mouse clicks simply pass through it, and/or Set [WS_EX_NOACTIVATE](https://stackoverflow.com/a/17491709/2330053) so that it cannot get focus. – Idle_Mind Apr 08 '22 at 19:16
-
1Yessir! the "WS EX TRANSPARENT" worked wonders :) Idle_mind is mega genius!! – James L Apr 09 '22 at 10:34
1 Answers
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 :)

James L
- 19
- 5