R
R
Renat Iliev2014-09-10 09:56:45
C++ / C#
Renat Iliev, 2014-09-10 09:56:45

How to create an overlay from a C# program (like RaidCall)?

I need to create a small window inside the game (game on DirectX 9), in the window there is 1 button and 1 sheet-box and 1 text-box, all this should be called on a certain key combination (the listener has already been done, it remains to write the code for pressing these keys) .
Overlay like Owerflow or RaidCall.
But the question is, how? I shoveled the whole Google - nowhere is it normally explained.
I tried to create a window without borders on the whole screen and on top of all windows, but it turned out to be inconvenient (when you return to the game from the overlay in the game, everything is "rendered" again, i.e. behind the "overlay" the image stops moving, and after leaving the overlay by 2 -3 seconds black screen) and ugly (there are some games that reduce the size of the desktop during the game and in this case only some part of the "overlay" is visible).
Ps I saw several implementations in C ++, but I'm completely zero in it and could not understand anything.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
aush, 2014-09-10
@aush

Did something similar. The bottom line is that the form has styles that must be set via WinAPI. When you set these styles on the form, you can draw, it will be displayed on top of all windows, but it will be transparent to the mouse. I didn’t need controls on the form, so I also made it visually transparent and simply drew on it through Graphics (as a result, the overlay effect you described was obtained, when during the game some information was displayed on top of it in the corner and by pressing hotkey could switch different display options), you can experiment, but, in any case, you can replace your controls with hotkeys, and only draw / display text on the form.
Check out this article - www.codeproject.com/KB/vb/ClickThroughWindows.aspx
If after reading something is still not clear, at least you will know in which direction to google.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question