CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
可用分押宝游戏火热进行中... 专题改版:Java Web 专题
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  VC/MFC >  基础类

一个关于CWnd的问题,急!!!高手快来帮忙啊!!在线等待

楼主eEric(Paranoia)2003-02-04 15:31:43 在 VC/MFC / 基础类 提问

定义两个CWnd的对象A,B。将其Create()出来,将A与B部分重叠,A在B上面,当点击A与B的重叠部分时,为何是B而不是A响应鼠标点击???  
  如何让A响应鼠标点击???  
  问题点数:100、回复次数:8Top

1 楼liuhongyong(荒原困兽)回复于 2003-02-04 16:48:38 得分 25

你点击鼠标的时候,产生的消息只能是当前线程的窗口处理。  
   
  在系统中,每次只能有一个线程和虚拟输入线程“连接”,这个线程的窗口这时就处于激活状态。  
   
  要想让A窗口响应鼠标消息,你就应该使A窗口激活。可以用SetFocus()啊。Top

2 楼eEric(Paranoia)回复于 2003-02-04 16:53:08 得分 0

用过SetActiveWindow()了,不行啊!Top

3 楼gull1234(俗不可耐)回复于 2003-02-04 19:01:16 得分 25

不是用SetActiveWindow()。而是用SetFocus()  
  (from   MSDN)  
  The   SetFocus   member   function   sends   aWM_KILLFOCUS   message   to   the   window   that   loses   the   input   focus   and   aWM_SETFOCUS   message   to   the   window   that   receives   the   input   focus.Top

4 楼showmetheway(雪儿甜心)回复于 2003-02-04 19:12:07 得分 0

可是……可是为什么SetActiveWindow()不管用呢?Top

5 楼AthlonxpX86(一坨屎)回复于 2003-02-04 19:28:23 得分 0

gzTop

6 楼Richuen22(Vista)回复于 2003-02-04 20:19:00 得分 25

http://expert.csdn.net/Expert/topic/1365/1365909.xml?temp=.6204645Top

7 楼showmetheway(雪儿甜心)回复于 2003-02-04 22:07:11 得分 0

可是……可是为什么SetActiveWindow()不管用呢?Top

8 楼AthlonxpX86(一坨屎)回复于 2003-02-04 22:15:29 得分 25

The   SetActiveWindow   function   activates   a   window,   but   not   if   the   application   is   in   the   background.   The   window   will   be   brought   into   the   foreground   (top   of   Z   order)   if   its   application   is   in   the   foreground   when   the   system   activates   the   window.Top

相关问题

  • 急!在线等待
  • 急!!!!!!!!!在线等待
  • 急!!!!!!!!!!!!!!!(在线等待)
  • 在线等待,急!!!
  • 急!!!!!!!(在线等待)
  • 急!在线等待!
  • 急!!(在线等待)
  • 急:在线等待!
  • 在线等待——急
  • 急!!!在线等待!!!

关键词

  • 线程
  • 鼠标
  • setactivewindow
  • setfocus
  • 点击

得分解答快速导航

  • 帖主:eEric
  • liuhongyong
  • gull1234
  • Richuen22
  • AthlonxpX86

相关链接

  • Visual C++类图书
  • Visual C++类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
世纪乐知(北京)网络技术有限公司 版权所有, 京 ICP 证 020026 号
北京创新乐知广告有限公司 提供技术支持
Copyright © 2000-2007, CSDN.NET, All Rights Reserved
GongshangLogo