点击透明表单 [英] Click through transparent form

查看:131
本文介绍了点击透明表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



实际上,我们需要在电脑上观看天空的红屏过滤器,但是我们不想使用红色有机玻璃。



我尝试过Windows API(监视器配置功能)
http://msdn.microsoft.com/en-us/library/windows/desktop/dd692964( v = vs85).aspx
但我不能这样做。
我做了透明的形式,像红色的过滤器(一切似乎都是红色和黑色的色调),但是我无法通过我的表单控制电脑。有人帮我吗

解决方案

创建一个新的VCL项目。在主窗体的属性中,将颜色设置为 clRed AlphaBlend true AlphaBlendValue 127 WindowState to wsMaximized FormStyle to fsStayOnTop ,并添加以下代码:

 键入
TForm1 = class(TForm)
private
protected
procedure CreateParams(var Params:TCreateParams);覆盖

...

程序TForm1.CreateParams(var Params:TCreateParams);
开始
继承;
Params.ExStyle:= Params.ExStyle或WS_EX_LAYERED或WS_EX_TRANSPARENT;
结束

示例视频示例编译EXE 来源


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 we don't want to use something like red plexiglass.

I tried Windows API's (Monitor Configuration Functions) http://msdn.microsoft.com/en-us/library/windows/desktop/dd692964(v=vs.85).aspx but I can't do it. I did transparent form like red filter (everything seems Red and Black tones), but I can't control computer over my form. Anybody help me about that ?

解决方案

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)

这篇关于点击透明表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆