M
M
Mana_Banana2021-07-08 17:42:34
C++ / C#
Mana_Banana, 2021-07-08 17:42:34

Is it possible to create a desktop mask when the application is running in a window?

Hello!
Sorry for the possibly idiotic question. I have just started learning C++. I work exclusively in the console environment. I get enough exhaustive information for beginners, but some things that interest me are still beyond my understanding. And I would really like to get more direction or examples than specific answers (although I will not refuse the latter either).
Interested in the possibility of creating a non-interactive (up to a certain point) mask for the desktop. In the future, I want to first write a regular text-based game of small size and duration in the console, while using the rest of the screen area at the right time. Display localized images, 2D animation in this area and generally complete the application with this action, with the ability to output sound as well.
Is this possible when using the console, or do you need to create a desktop application for Windows, simulate the console in it, and only then enter all the necessary functions? And are there examples that do not imitate a window, while being in full deployment, namely, they use the desktop or in general everything that is displayed outside the active window?
In the future, I will refrain from such questions, trying to specify more, but for now, on the rise of desire, I decided to clarify this possibility.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wataru, 2021-07-08
@Mana_Banana

You will have to work with winapi.
You need to create a transparent window and draw what goes on top of the desktop into it (google "winapi draw in transparent window").
In order not to draw on top of some windows, you need to draw the silhouettes of all these windows in black in some bitmap (you need to sort through all the windows in the system - all sorts of GetWindowRect, EnumWindows, IsWindowVisible will help you here.). And when drawing, you need to take this bitmap as a mask (google "winapi clip region").
Messages about mouse clicks must be accurately transmitted to the window that is open at the given coordinates. It will be difficult to do everything completely imperceptibly - because not some left window will be active, but yours, since you draw on top of it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question