日历控件选择日期后怎么会发送两个 DTN_DATETIMECHANGE 通知消息呢

malingfeng 2006-01-08 12:57:34
RT
...全文
290 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
malingfeng 2006-01-10
  • 打赏
  • 举报
回复
没人回答吗,看来只有删除了
malingfeng 2006-01-09
  • 打赏
  • 举报
回复
to vcmute(横秋),我试过了,两个消息的参数值都是一样的,而且都是在关闭下拉窗口之前发送的,我现在想知道这两个消息有什么不同。
搜索了也没找到什么有用的东西
vcmute 2006-01-08
  • 打赏
  • 举报
回复
判断GetMonthCal是否存在,如果存在则等第二个,否则是第一个

详情请搜索以前的帖子
malingfeng 2006-01-08
  • 打赏
  • 举报
回复
是不是系统不一样了,我以前用的SP4原版只执行一次,现在更新了就成这样了
malingfeng 2006-01-08
  • 打赏
  • 举报
回复
我就是映射了这个消息,可是它这个事件里执行了两次
malingfeng 2006-01-08
  • 打赏
  • 举报
回复
code都是一样的啊,都是DTN_DATETIMECHANGE
handsomerun 2006-01-08
  • 打赏
  • 举报
回复
msdn上的一段

Processing the DTN_DATETIMECHANGE Notification
A date and time picker (DTP) control sends the DTN_DATETIMECHANGE message whenever a change occurs. This message will be generated if the user changes one of the fields in the control or changes the state of the control's check box (DTS_SHOWNONE only).

The following example is an application-defined function designed to update a static control within a dialog box. The text within the static control is changed to reflect the current state of the DTP control.

void WINAPI DoDateTimeChange(LPNMDATETIMECHANGE lpChange)
{
// If the user has unchecked the DTP's check box, change the
// text in a static control to show the appropriate message.
//
// g_hwndDlg - a program-global address of a dialog box.

if(lpChange->dwFlags == GDT_NONE)
SetDlgItemText(g_hwndDlg, IDC_STATUS, "Disabled");
else
SetDlgItemText(g_hwndDlg, IDC_STATUS, "Active");
}



这个LPNMDATETIMECHANGE lpChange
这个东西包含了很多有用的信息

我想你的消息响应函数里面也有这个东西的哦


malingfeng 2006-01-08
  • 打赏
  • 举报
回复
怎么区分呢,我怎么知道哪一个后面发的呢。我想在下拉窗口关闭后再进行响应,谢谢
DentistryDoctor 2006-01-08
  • 打赏
  • 举报
回复
DTN_DATETIMECHANGE

lpChange = (LPNMDATETIMECHANGE) lParam;

typedef struct tagNMDATETIMECHANGE {
NMHDR nmhdr;
DWORD dwFlags;
SYSTEMTIME st;
} NMDATETIMECHANGE, *LPNMDATETIMECHANGE;

typedef struct tagNMHDR {
HWND hwndFrom;
UINT idFrom;
UINT code;
} NMHDR;

两次Notify消息的code不一样。

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧