========请教高手(NMHDR* pNMHDR, LRESULT* pResult)怎么用?????????========

free_worf 2002-01-10 11:19:02
我在工具条上加了个日期控件 ,然后截获起ON_NOTIFY消息但不知怎样从控件中得到我单击选择的日期???????????????
...全文
317 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Soft21 2002-01-12
  • 打赏
  • 举报
回复
大家好啊,看来,不错!
kingtsui 2002-01-10
  • 打赏
  • 举报
回复
看DTN_DATETIMECHANGE这一节


DTN_DATETIMECHANGE


Sent by a date and time picker (DTP) control whenever a change occurs. This notification message is sent in the form of a WM_NOTIFY message.

DTN_DATETIMECHANGE
lpChange = (LPNMDATETIMECHANGE) lParam;

Parameters
lpChange
Address of an NMDATETIMECHANGE structure containing information about the change that took place in the control.
Return Values
The owner of the control must return zero.

Requirements
Version 4.70 and later of Comctl32.dll

Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with Internet Explorer 3.0 and later).
Windows 95/98/Me: Requires Windows 98 (or Windows 95 with Internet Explorer 3.0 or later).
Header: Declared in commctrl.h.
alpasino 2002-01-10
  • 打赏
  • 举报
回复
???
bskay 2002-01-10
  • 打赏
  • 举报
回复
我在工具条上加了个日期控件 要保存它哦 m_pXXX



CDateTimeCtrl* pCtrl = m_pXXX...//你怎么建的就怎么得

然后~~调函数
Follow these 10 easy steps to build the OutLookRichEdit control: Insert a rich edit control into the dialog. Call AfxInitRichEdit() in the InitInstance of the App class or in InitDialog. If it does not exist, copy OutLookRichEdit.cpp and OutLookRichEdit.h to the project directory. Click the menu choice Project-Add to Project-Files and select the above-copied files to add the wrapper class to your project. Import the hand cursor into the resource and rename it "IDC_LINK". Use Classwizard to add a member variable of the rich edit control (CRichEditCtrl). Include the OutLookRichEdit.h file in the dialog's header file and change the declaration of rich edit member variable, as in CRichEditCtrl m_ctrlText1; to COutLookRichEdit m_ctrlText1; In InitDialog(), add the following code. Post a comment Email Article Print Article Share Articles Digg del.icio.us Newsvine Facebook Google LinkedIn MySpace Reddit Slashdot StumbleUpon Technorati Twitter Windows Live YahooBuzz FriendFeed m_ctrlText1.SetRawHyperText(_T("Click <%$here$#100#%> to see the about box.")); At this level, if you build the project and run it, you can see the rich edit control with linked text, but nothing would happen if you clicked on the link. To Show a dialog while the link is clicked, you have to add some more code in the dialog class. Before that, have a closer look at the preceding code and hypertext syntax. The link text is enclosed between the "$" symbols and the corresponding dialog's resource value 100 (About Box), enclosed in "#" symbols. You can find the #define values of dialogs in the resource.h file. Use ClassWizard to map OnNotify of the dialog and write the corresponding implementation code in .cpp file, like: BOOL CDEMODlg::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) { NMHDR* pNmHdr = (NMHDR*) lParam; if(IDC_RICHEDIT1 == pNmHdr->idFrom){ switch(pNmHdr->code) { case IDD_ABOUTBOX: CAboutDlg oDlg; oDlg.DoModal (); break; } } return CDialog::OnNotify(wParam, lParam, pResult); } Now, build and run the project. It is recommended that you set the read-only attribute to the rich edit control.

1,649

社区成员

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

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