透明对话框无法接收鼠标移动? [英] Transparent dialog can't recieve mouse move?

查看:113
本文介绍了透明对话框无法接收鼠标移动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想在图片框上建立一个透明对话框,在其中显示CCD视频.
我使用:

Hi all,

I want to built a transparent dialog over the pixture box,where display CCD video.
I use:

SetLayeredWindowAttributes(this->GetSafeHwnd(),RGB(255,255,255),128,1) //function,
//and on 
paint()
{
CPaintDC dc(this);
CRect rect;
GetClientRect(&rect); 
dc.fillsolidrect(rect,RGB(255,255,255))  }


因此,我可以在透明对话框上绘制红色/绿色线条或矩形,但是我想通过鼠标的leftbuttondown/up/move来绘制线条.
我发现只有狭窄的区域不能响应整个客户区域.
我该怎么办?
我想在动态视频上绘制线条/矩形.


So I can draw red/Green line or rectangle on transparent dialog, but I want to draw line by mouse''s leftbuttondown/up/move.
I find only narrow region can response not whole client region.
How can i do ?
I want to draw lines/rectangle on dynamic video.

推荐答案

一种解决此问题的方法.

用alpha透明度方法创建透明窗口,具有非常小的alpha值.
SetLayeredWindowAttributes(0,1,LWA_ALPHA);
现在,您将获得透明的外观和鼠标移动消息.
One workaround to solve this issue.

Create transparent window in alpha transparency method, with very small alpha value.
SetLayeredWindowAttributes(0,1,LWA_ALPHA);
Now you will get transparent look and Mouse move messages.


这篇关于透明对话框无法接收鼠标移动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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