VC++学习笔记(三)

UpdateData(TRUE)的调用将给变量赋予用户定义的值。UpdateData(FALSE)语句将清空输出编辑框变量的内容。

执行应用程序WinExec("notepad.exe",SW_SHOW);

获取控件对象 GetDlgItem(ID);

void OnMouseMove(UINT nFlags, CPoint point) 通过这个函数我们可以得到两个参数:
uFlags 和 point ,这两个参数.我们在MSDN种查到对这两个参数的描述:
nFlags
Indicates whether various virtual keys are down. This parameter can be any combination of the following values:
指示哪些键被按下。这个参数可以是以下值的任意组合:
·    MK_CONTROL   Set if the CTRL key is down.  //CTRL键
·    MK_LBUTTON   Set if the left mouse button is down.//鼠标左键
·    MK_MBUTTON   Set if the middle mouse button is down.//鼠标中键
·    MK_RBUTTON   Set if the right mouse button is down.//鼠标右键
·    MK_SHIFT   Set if the SHIFT key is down. //SHIFT键

if ((nFlags & MK_LBUTTON)==MK_LBUTTON) //判断左键是否按下
point
Specifies the x- and y-coordinate of the cursor. These coordinates are always relative to the upper-left corner of the window.
指示光标的坐标。这个光标是相对于窗体的左上角的。
这是我们要找的参数就是point,那么这个参数是CPoint 类型的,我们再查CPoint 类型,如何查呢?一种查MSDN,另一种在工程中,右键点击CPoint这个文字,出来的右键菜单中,点击goto the definition of CPoint 。我们看到了MFC的源码,CPoint本身是一个类,但是它是继承于一个结构的(tagPOINT)。我们看它的原始定义:
typedef struct tagPOINT
{
    LONG  x;
    LONG  y;
} POINT, *PPOINT, NEAR *NPPOINT, FAR *LPPOINT;

程序指针
IDC_CROSS
IDC_UPARROW
IDC_SIZEALL
IDC_SIZENWSE
IDC_SIZENESW
IDC_SIZEWE
IDC_SIZENS
IDC_NO
IDC_APPSTARTING
IDC_HELP

在使用SetCursor方法时,如果希望保留鼠标形状需要返回true

A callback function is a function you create that is called directly by the Windows operating system.Callback function have specific argument definitions,depending on which subsystem calls the function and why.After you get past the function definition,however,you can do whatever you want or need to do the function.
A callback function works by passing the address of the function as a argument to a Windows function that accepts callback functions are arguments.When you pass the function address to Windows,your function is called directly every time the circumstances occur that require Windows to call the callback function

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值