+ -
当前位置:首页 → 问答吧 → 在视图类的鼠标移动事件中如何获取鼠标移动事件创建的时间?

在视图类的鼠标移动事件中如何获取鼠标移动事件创建的时间?

时间:2011-12-23

来源:互联网

我知道MSG结构中有一个时间字段,但鼠标移动事件中如何获取鼠标移动事件创建的时间?下面函数原型中根本就没有事件创建时间的参数.
void CMyView::OnMouseMove(UINT nFlags, CPoint point) 
{
……
如何获取鼠标移动事件创建的时间?
……
}

作者: xqlu2007   发布时间: 2011-12-23

需要时间精确吗?可以在获得鼠标事件中GetCurrentTime()

作者: zqckzqck   发布时间: 2011-12-23

CTime ::GetCurrentTime() 用这个来获取时间

作者: shen_wei   发布时间: 2011-12-23

CTime::GetCurrentTime()就是时间啊

作者: yayafu   发布时间: 2011-12-23

MSG msg;
GetMessage(&msg, NULL, 0, 0)

===========================================================================
MSG Structure

--------------------------------------------------------------------------------

The MSG structure contains message information from a thread's message queue. 

Syntax

typedef struct {
  HWND hwnd;
  UINT message;
  WPARAM wParam;
  LPARAM lParam;
  DWORD time;
  POINT pt;
} MSG, *PMSG;
Members

hwnd
Handle to the window whose window procedure receives the message. 
message
Specifies the message identifier. Applications can only use the low word; the high word is reserved by the system. 
wParam
Specifies additional information about the message. The exact meaning depends on the value of the message member. 
lParam
Specifies additional information about the message. The exact meaning depends on the value of the message member. 
time
Specifies the time at which the message was posted. 
pt
Specifies the cursor position, in screen coordinates, when the message was posted.

作者: hping1016   发布时间: 2011-12-23

或者
GetMessageTime
The GetMessageTime function retrieves the message time for the last message retrieved by the GetMessage function. The time is a long integer that specifies the elapsed time, in milliseconds, from the time the system was started to the time the message was created (that is, placed in the thread's message queue). 

作者: hping1016   发布时间: 2011-12-23