Click the transparent form.

I have a translucent full-screen form, and I need to control my computer over this form.

In fact, we need a red screen filter on the computer to observe the sky, but we do not want to use something like a red plexiglass.

I tried the Windows API (monitor settings) http://msdn.microsoft.com/en-us/library/windows/desktop/dd692964 (v = vs .85) .aspx but I can not do this. I made a transparent shape, like a red filter (everything seems to be in red and black), but I can not control the computer in my form. Anyone help me with this?

+6
source share
1 answer

Create a new VCL project. In the properties of the main form, set Color to clRed , AlphaBlend to true , AlphaBlendValue to 127 , WindowState to wsMaximized , FormStyle to fsStayOnTop and add the following code:

 type TForm1 = class(TForm) private protected procedure CreateParams(var Params: TCreateParams); override; ... procedure TForm1.CreateParams(var Params: TCreateParams); begin inherited; Params.ExStyle := Params.ExStyle or WS_EX_LAYERED or WS_EX_TRANSPARENT; end; 

( Video example, Compiled EXE example , Source )

+13
source

Source: https://habr.com/ru/post/922117/


All Articles