VC中如何获取鼠标点击处控件的ID

 最近在开发基于SDK的DEMO时遇到这样一个问题:我要在响应鼠标左键点击事件中获取到鼠标点击点的控件的ID,然后根据ID的不同处理不通的操作,但是我怎么也获取不到控件的ID。上MSDN查,上BAIDU搜,都没找到能解决问题的方法。但是我找到了几个可供参考的函数:

CWnd::GetFocus 

static CWnd* PASCAL GetFocus( );

Return Value

A pointer to the window that has the current focus, or NULL if there is no focus window.

The pointer may be temporary and should not be stored for later use.

CWnd::WindowFromPoint 

static CWnd* PASCAL WindowFromPoint( POINT point );

Return

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
1,01.zip<br>Toolbar - Custom status messages and tooltips<br>用户状态信息与工具提示(3KB)<END><br>2,02.zip<br>Remove system menu from floating toolbar<br>从浮动工具条去除系统菜单(2KB)<END><br>3,03.zip<br>Remove close button from floating toolbar <br>从浮动工具条去掉关闭按钮(2KB)<END><br>4,customizable1.zip<br>Customizable toolbar<br>可自定义的工具条(25KB)<END><br>5,detoolbar.zip<br>Adding a drop arrow to a toolbar button<br>带下拉框的工具条(28KB)<END><br>6,detoolbare.zip<br>Using Hot Toolbar Buttons<br>类似IE4的工具条(30KB)<END><br>7,BCGControlBar.zip<br>Customizable Toolbar and Menus <br>可自定义的工具条 (2)(318KB)<END><br>8,FixMiniFrame.zip<br>System menu fix for floating toolbar<br>更改浮动工具条的系统菜单(24KB)<END><br>9,09.zip<br>DevStudio like Flat Toolbar<br>平面工具条 (需 IE3+)(5KB)<END><br>10,enh_flatbar.zip<br>Another Flat ToolBar (does not require MSIE)<br>另外一种平面工具条 (不需 IE)(81KB)<END><br>11,VSOMenu.zip<br>Visual Studio/Office 97 style Flat Toolbar and Dockable Menu bar <br>类似Visual Studio/Office 97 的平面工具条与可停靠菜单条(2)(200KB)<END><br>12,RebarMenu.zip<br>IE4 Style Menu (Rebar Menu) <br>类似IE4 的菜单条(72KB)<END><br>13,ToolbarHi.zip<br>Toolbar with 16M colour images <br>使用16M色图象的工具条(66KB)<END><br>14,multi12.zip<br>Extended Multi Size Multi Color Toolbar! <br>扩展型多尺寸多色彩工具条(226KB)<END><br>15,15.zip<br>How to display tooltips for a toolbar in a dialog<br>在对话框如何为工具条显示工具提示(3KB)<END><br>16,16.zip<br>Displaying text on a Toolbar <br>在对话框如何为工具条显示工具提示(2KB)<END><br>17,toolbar_d.zip<br>Docking Toolbars Side-By-Side<br>工具条的停靠(29KB)<END><br>18,toolbars.zip<br>Toolbars with Tooltips in a CFormView derived class<br>在CFormView派生类使用带工具提示的工具条(29KB)<END><br>19,SwitchTB.zip<br>Switching Toolbars in MDI <br>MDI具有开关显示功能的工具条(47KB)<END><br>20,Place Controls on ToolBars<br>在工具条放置其他控件(10KB)<END><br>21,DialogBarEx1.zip<br>CDialogBarEx : A Dialog bar with initialization <br>CDialogBarEx :带初始化的对话条(42KB)<END><br><br>1,01.zip<br>Setting selected text to read-only<br>设置选择的文本为只读(2KB)<END><br>2,02.zip<br>Changing word wrap mode<br>改变换行模式(2KB)<END><br>3,03.zip<br>Changing tab stops<br>改变tab的行数(2KB)<END><br>4,04.zip<br>Inserting an RTF string using StreamIn<br>用RTF插入一个RTF字符串(3KB)<END><br>5,05.zip<br>Providing a Format toolbar<br>提供一个格式的工具框(8KB)<END><br>6,06.zip<br>convert RTF String RTF tags<br>变换字符串为RTF格式(7KB)<END><br>7,07.zip<br>CRichEditCtrlEx - Advanced Rich Edit Control<br>CRichEdit的继承类(21KB)<END><br>8,08.zip<br>The Richedit Ctrl used in chatting<br>在聊天程序用Richedit(37KB)<END><br>9,09.zip<br>CRichEditCtrlEx : Replacing "RICHEDIT" control with "RichEdit20A"<br>替代RichEdit的类CRichEditCtrlEx(16KB) <END><br>10,10.zip<br>Controlling the RichTextCtrl Insert State<br>控制RichTextCtrlInsert键状态(80KB)<END><br>11,11.zip<br>CAutoRichEditCtrl - automate rich edit formatting and RTF handling.<br>自动格式化RTF的继承类CAutoRichEditCtrl(62KB)<END><br><br>1,02.zip<br>Adding a Control to the Property Sheet <br>在属性页添加控件(2KB)<END><br>2,06.zip<br>Using Shortcut Keys for Property Pages<br>在属性页使用快捷键(2KB)<END><br>3,07.zip<br>Creating a Property Sheet Inside a Form View - Asaf Levy <br>在Form View创建属性页(4KB)<END><br>4,08.zip<br>Creating a Property Sheet Inside a Dialog <br>在对话框创建属性页(3KB)<END><br>12,18.zip<br>A resizable property sheet within a view <br>在视改变property sheet的大小(4KB)<END><br>13,19.zip<br>overriding the default buttons on CPropertySheets <br>在CPropertySheets覆盖默认按钮(2KB)<END><br>14,20.zip<br>Display only One Row of Tabs <br>只显示一行Tab选择(2KB)<END><br>15,21.zip<br>Add a Font Property Page <br>添加字体属性页(16KB)<END><br>16,22.zip<br>Resizing the Property Sheet<br>改变属性页的大小(2KB)<END><br>17,23.zip<br>Resizing the Tab Control<br>改变Tab控制的大小(2KB)<END><br>18,24.zip<br>Moving and Resizing the Property Pages <br>移动并改变属性页大小(3KB)<END><br>20,27.zip<br>Using ON_UPDATE_COMMAND_UI in Property Pages <br>在属性页使用ON_UPDATE_COMMAND_UI(2KB)<END><br>22,29.zip<br>Inserting a CFormView into a CPropertySheet <br>将CFormView插入到属性页(2KB)<END><br>23,30.zip<br>Using Upper- and Lowercase shortcut Keys for Property Pages <br>在属性页使用大写和小写快捷键(2KB)<END><br>25,32.zip<br>Automaticaly arange visible controls below the tab control<br>TAB控制使控件自动可见(2KB)<END><br>27,34.zip<br>Creating a wizard<br>创建一个向导(4KB)<END><br>21,propsheet1.zip<br>Propertysheets embedded in Dialogs <br>在对话框嵌入Propertysheets(20KB)<END><br>24,propinprop.zip<br>Using shortcut keys in property pages containg property pages <br>在属性页使用快捷键(74KB)<END><br>26,newprop.zip<br>Adding a Button to CPropertySheet <br>在属性页添加按钮(19KB)<END><br>28,PropSheet.zip<br>Property Sheet Wizard <br>属性页Wizard(96KB)<96KB><END><br>5,wizprop.zip<br>Wizard Property Sheets and Pages<br>Wizard方式的属性表与属性页(3KB)<END><br>6,creatingl.zip<br>Creating a full application using the CPropertySheet. <br>用CPropertySheet创建完整的应用程序(91KB)<END><br>7,updcreate.zip<br>Creating a full application using the CPropertySheet <br>更新: 用CPropertySheet创建完整的应用程序(12KB)<END><br>8,addbitmap.zip<br>Placing A Bitmap In The PropertySheet Button Area <br>将一个位图放到PropertySheet的按纽区域(2KB)<END><br>9,add3dtext.zip<br>Placing a 3D Logo Text In the PropertySheet Button Area <br>附加功能是控制PropertySheet区域特别是按纽部分的颜色(37KB)<END><br>10,proppage.zip<br>Modifying Property Sheet Templates on Win95 <br>在Win95修改属性页模板(2KB)<END><br>11,propview.zip<br>Using a modeless property sheet as a 'view' in a Frame <br>使用非模式的property sheet, 就像框架的视(53KB)<END><br><br>1,VCMenu.zip<br>Visual Studio/Office 97 style Flat Toolbar and Dockable Menu bar<br>类似Visual Studio/Office 97的平面工具条与可停靠菜单条(350KB)<END><br>2,contentmenu.zip<br>A Cool Looking Menu For Easier Navigation<br>一个很COOL的菜单条(39KB)<END><br>3,freemenu.zip<br>Owner Drawn Menu With Free Color & Font<br>可使用任意字体与颜色的自画式菜单(35KB)<END><br>4,04.zip<br>Owner Drawn Menu with Icons<br>带图标的自画式菜单(5KB)<END><br>5,05.zip<br>Owner Drawn Menu with Icons (2)<br>带图标的自画式菜单(2)(8KB)<END><br>6,owner_menu4.zip<br>Owner Drawn Menu with Icons (4) (automatically uses toolbar res)<br>带图标的自画式菜单(4) (自动使用工具条对应资源)(109KB)<END><br>7,bitmapmenu.zip<br>Yet another owner draw menu<br>更新"带图标的自画式菜单"(2)(6KB)<END><br>8,bcmenu24.zip<br>Owner Drawn Menu with Icons (3)<br>带图标的自画式菜单(3) (使用工具条资源)(62KB)<END><br>9,09.zip<br>Inserting submenus in an existing SDI menu<br>在SDI菜单插入子菜单(2KB)<END><br>10,10.zip<br>TrackPopupMenu as an Immediate Function <br>使用 CMenu::TrackPopupMenu 跟踪弹出菜单的菜单项(2KB)<END><br>11,Creating Popup Menus with Titles<br>Creating Popup Menus with Titles<br>带提示的弹出式菜单(5KB)<END><br>12,12.zip<br>Finding a menu item position from command id<br>从Command ID寻找菜单项(3KB)<END><br>13,13.zip<br>The simplest way to put the MRU list in a submenu <br>将MRU列表加入子菜单的简单途径(2KB)<END><br>14,14.zip<br>Using MRU on a submenu <br>在子菜单使用MRU(3KB)<END><br>15,15.zip<br>MRU list in a submenu: the MFC bug and how to correct it. <br>子菜单的MRU列表: 更正MFC bug(3KB)<END><br>16,16.zip<br>Merging Two Menus <br>合并两个菜单(3KB)<END><br><br>1,03.zip<br>Serializable CListCtrl with check sum verify(4KB)<br>连续的列表项的校验和<END><br>2,11.zip<br>Getting the number of columns in report view<br>获得列表视图的列数(2KB)<END><br>3,12.zip<br>添加一列<br>Adding a column(2KB)<END><br>4,13.zip<br>Detecting column index of the item clicked<br>监测单击项的索引(13KB)<END><br>5,14.zip<br>Prevent CListCtrl column resizing<br>禁止调整列表控制的大小(2KB)<END><br>6,16.zip<br>How to force a minimum column width<br>限定一个最小列宽(16KB)<END><br>7,17.zip<br>Autosize a column to fit its content<br>自动调整列的大小(3KB)<END><br>8,18.zip<br>Stationary Columns<br>固定的列数(4KB)<END><br>9,19.zip<br>Disable clicking on selected report view columns<br>禁止鼠标在列表视图单击(2KB)<END><br>10,21.zip<br>Dragging columns to rearrange column sequence<br>重新排列次序(6KB)<END><br>11,22.zip<br>Dragging Items to Rearrange Rows<br>重新排列行数(5KB)<END><br>12,24.zip<br>Allowing items to be edited<br>允许列表项编辑(2KB)<END><br>13,27.zip<br>Using a drop down list to change a subitem<br>用托放改变子项(10KB)<END><br>14,GridList.zip<br>Multiline Editable Subitems<br>多列可编辑的子项(95KB)<END><br>15,subitems2.zip<br>Editing listview subitems using LVM_GETEDITCONTROL<br>用LVM_GETEDITCONTROL事件来编辑列表视图(46KB)<END><br>16,32.zip<br>Drawing horizontal and vertical gridlines<br>画水平和竖直的网格线(9KB)<END><br>17,33.zip<br>List control with single / double separator lines<br>带有一个/两个分割线的列表控制(10KB)<END><br>18,34.zip<br>Subclassing the List View Control using MFC<br>用MFC写的列表视图子类(3KB)<END><br>19,35.zip<br>Catching header messages in a CListView<br>捕捉CListView的头消息(2KB)<END><br>20,36.zip<br>How do I use a derived CListCtrl with a CListView?<br>怎样使用来源于CListCtrl的列表视图(2KB)<END><br>21,40.zip<br>Using sub-strings in non report view<br>获得报表视图的子串(2KB)<END><br>22,Treelist.zip<br>TreeList : Multi column tree control<br>多列的树性列表控制(79KB)<END><br>23,43.zip<br>Connect a list container to a tree/list control<br>连接一个列表容器到列表控制(4KB)<END><br>24,listclass1.zip<br>Class with full row highlighting<br>高亮文本的列表框(8KB)<END><br>25,46.zip<br>IE4 Extended Styles in a list control<br>和IE4类似的列表控制(4KB)<END><br>26,sorted_Class.zip<br>CSortedListCtrl reusable base class<br>可以再度使用的排序列表基类(61KB)<END><br>27,48.zip<br>Measure Item for dynamic font changing in a list control<br>动态的改变列表控制的字体(2KB)<END><br>28,supergrid.zip<br>SuperGrid - Yet Another listview control(84KB)<br>用Listview写的网格控制<END><br>29,clistie4.zip<br>Class for using new features in listview control<br>列表视图的子类(5KB)<END><br>30,51.zip<br>Plug-in class to support printing from a listview<br>列表视图的插件类 (6KB)<END><br>31,52.zip<br>Print the contents of the list control<br>打印列表视图的内容(7KB)<END><br>32,property12.zip<br>Creating an Object Property List using the CListCtrl<br>用ClistCtrl类创建一个属性列表(57KB)<END><br>33,56.zip<br>Retrieving selected items<br>找回选择的项的内容(2KB)<END><br>34,57.zip<br>Selecting and deselecting a range of rows<br>选择和反选择一定范围的行(2KB)<END><br>35,58.zip<br>Selection Highlighting of Entire Row<br>选择高亮整行(12KB)<END><br>36,59.zip<br>Set focus on a cell<br>设置一个单元获得焦点(2KB)<END><br>37,60.zip<br>Sorting the list based on text in any column<br>按列表的文本排序(3KB)<END><br>38,61.zip<br>Sorting list on Numeric Column<br>按列表的数值排序(2KB)<END><br>39,62.zip<br>Sort list based on text/numeric/date-time in any column<br>按列表的文本\数值\时间排序(3KB)<END><br>40,63.zip<br>Sort list (numeric/text) using callback<br>用回调函数按数值/文本排序 (3KB)<END><br>41,64.zip<br>Sort columns by the image index of the column<br>通过图像索引排序(3KB)<END><br>42,66.zip<br>Sorting the list when user clicks on column header<br>当用户单击列标题时排序(3KB)<END><br>43,67.zip<br>Indicating sort order in header control<br>指示列标题的排序(5KB)<END><br>44,68.zip<br>Simple list Sorting on Integer Colum<br>按列表的数值排序(2KB)<END><br>45,69.zip<br>A Multi Column Sort listview<br>一个多列排序的列表视图(37KB)<END><br>46,70.zip<br>Determining row indices in SortItems() Comparison function<br>用SortItems函数监测行复数(3KB)<END><br>47,75.zip<br>Handling Title Tips With Drag/Drop Headers Using The Visual C++ 6.0 CListCtrl<br>理标题的提示(3KB)<END><br>48,76.zip<br>Attaching System ImageList to ListControl<br>附带系统图像的列表控制(3KB)<END><br>49,77.zip<br>Initializing the image list<br>初始化图像列表(2KB)<END><br>50,78.zip<br>Setting or removing an image for an item<br>设置和删除项的图像(78KB)<END><br>51,79.zip<br>Setting a non-standard size image<br>设置一个非标准的图像(4KB)<END><br>52,83.zip<br>List Control displaying image thumbnails<br>在列表控制显示小图像(23KB)<END>

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值