Click here to Skip to main content
16,004,828 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: A simple question on PreTranslateMessage and ON_WM_ Pin
Jay Zhu29-Jul-06 6:27
Jay Zhu29-Jul-06 6:27 
GeneralRe: A simple question on PreTranslateMessage and ON_WM_ [modified] Pin
Justin Tay29-Jul-06 7:37
Justin Tay29-Jul-06 7:37 
GeneralRe: A simple question on PreTranslateMessage and ON_WM_ Pin
Jay Zhu29-Jul-06 18:34
Jay Zhu29-Jul-06 18:34 
GeneralRe: A simple question on PreTranslateMessage and ON_WM_ Pin
Jay Zhu29-Jul-06 18:49
Jay Zhu29-Jul-06 18:49 
GeneralRe: A simple question on PreTranslateMessage and ON_WM_ Pin
Justin Tay29-Jul-06 19:59
Justin Tay29-Jul-06 19:59 
Questiona Simple Question about ON_MESSAGE and ON_NOTIFY Pin
JackNotAll29-Jul-06 3:03
JackNotAll29-Jul-06 3:03 
AnswerRe: a Simple Question about ON_MESSAGE and ON_NOTIFY Pin
Ryan Binns29-Jul-06 5:18
Ryan Binns29-Jul-06 5:18 
GeneralRe: a Simple Question about ON_MESSAGE and ON_NOTIFY Pin
JackNotAll30-Jul-06 3:25
JackNotAll30-Jul-06 3:25 
Ryan Binns:
Thank you so much. I learn from your comment that ON_NOTIFY is used for WM_NOTIFY message, and ON_MESSAGE macro is used for application-specific message, usually a user defined message.

But i still have some questions. I modify an existed Grid Ctrl source code. And i found some WM_NOTIFY message. Because there are some different types cell in grid control, such as edit type, datetime type, and so on. so the existed code use the ON_NOTFY marco to implement these function.

I give your the source code

.h
afx_msg void OnEditCell(NMHDR* pNMHDR , LRESULT* lResult);

.cpp
ON_NOTIFY( CLVN_EDITCHANGE , IDC_LISTVIEWEDIT , OnEditCell)
void CPFGridListCtrl::OnEditCell(NMHDR* pNMHDR , LRESULT* lResult )
{
.......
}

CLVN_EDITCHANGE and IDC_LISTVIEWEDIT is defined by author.

My question is in this situation, why do he use the ON_NOTIFY macro?
And can i implement it by using ON_MESSAGE marcro? perhaps we can, i think i can response the WM_LBUTTONDOWN message and sendmessage in it. Can i implement it by such action?

and i think the question will focus on who send the message. You know, if we define a user message, and we will use SendMessage function to send the message, but if we use ON_NOTIFY, actually, i don't know who send the WM_NOTIFY message to system?

Best Regards
JackNotAll







GeneralRe: a Simple Question about ON_MESSAGE and ON_NOTIFY Pin
Ryan Binns30-Jul-06 4:44
Ryan Binns30-Jul-06 4:44 
GeneralRe: a Simple Question about ON_MESSAGE and ON_NOTIFY Pin
JackNotAll30-Jul-06 19:26
JackNotAll30-Jul-06 19:26 
QuestionTransparent checkboxes Pin
Twister33629-Jul-06 1:22
Twister33629-Jul-06 1:22 
AnswerRe: Transparent checkboxes Pin
includeh1029-Jul-06 5:11
includeh1029-Jul-06 5:11 
GeneralRe: Transparent checkboxes Pin
Twister33629-Jul-06 5:46
Twister33629-Jul-06 5:46 
GeneralRe: Transparent checkboxes Pin
anthonym728-Aug-06 5:55
anthonym728-Aug-06 5:55 
QuestionSending a bit stream through the serial port (VC++ 6.0) Pin
Dhananjayak0229-Jul-06 1:00
Dhananjayak0229-Jul-06 1:00 
AnswerRe: Sending a bit stream through the serial port (VC++ 6.0) Pin
Gary R. Wheeler29-Jul-06 3:04
Gary R. Wheeler29-Jul-06 3:04 
GeneralRe: Sending a bit stream through the serial port (VC++ 6.0) Pin
Dhananjayak0229-Jul-06 20:27
Dhananjayak0229-Jul-06 20:27 
Questioni can't get my class to recognize message maps Pin
abednego0028-Jul-06 22:40
abednego0028-Jul-06 22:40 
Questionwhere does variables get stored? Pin
WCup28-Jul-06 22:33
WCup28-Jul-06 22:33 
AnswerRe: where does variables get stored? [modified] Pin
Rilhas28-Jul-06 23:41
Rilhas28-Jul-06 23:41 
Questionslider control help Pin
JesGDev28-Jul-06 22:19
JesGDev28-Jul-06 22:19 
AnswerRe: slider control help Pin
Naveen28-Jul-06 23:06
Naveen28-Jul-06 23:06 
GeneralRe: slider control help Pin
JesGDev29-Jul-06 7:26
JesGDev29-Jul-06 7:26 
GeneralRe: slider control help Pin
Justin Tay29-Jul-06 11:45
Justin Tay29-Jul-06 11:45 
GeneralRe: slider control help Pin
JesGDev29-Jul-06 12:01
JesGDev29-Jul-06 12:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.