Click through transparent form

后端 未结 1 607
你的背包
你的背包 2020-12-15 12:51

I have a semi transparent fullscreen form and I need can control my computer over this form.

Actualy we need red screen filter on computer for observing the sky, but

相关标签:
1条回答
  • 2020-12-15 13:36

    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;
    

    (Sample video, Sample compiled EXE, Source)

    0 讨论(0)
提交回复
热议问题