Click here to Skip to main content
15,898,371 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Custom message handling Pin
Mazdak28-Feb-02 18:47
Mazdak28-Feb-02 18:47 
GeneralRe: Custom message handling Pin
Nish Nishant28-Feb-02 19:25
sitebuilderNish Nishant28-Feb-02 19:25 
GeneralRe: Custom message handling Pin
alex.barylski28-Feb-02 19:55
alex.barylski28-Feb-02 19:55 
GeneralRe: Custom message handling Pin
Michael Dunn28-Feb-02 20:52
sitebuilderMichael Dunn28-Feb-02 20:52 
GeneralRe: Custom message handling Pin
alex.barylski1-Mar-02 6:02
alex.barylski1-Mar-02 6:02 
GeneralRe: Custom message handling Pin
alex.barylski1-Mar-02 6:15
alex.barylski1-Mar-02 6:15 
GeneralRe: Custom message handling Pin
Nish Nishant28-Feb-02 21:25
sitebuilderNish Nishant28-Feb-02 21:25 
GeneralRe: Custom message handling Pin
alex.barylski1-Mar-02 6:12
alex.barylski1-Mar-02 6:12 
One of books says this field is usually NULL...which would totally suck...

I would ideally like to get the hwnd from the control that "sent" the message, but it appears this is not possible with the incoming MSG, it (if anything) gives me the hwnd to the window(control) whose WndProc should handle the message. I'm really only interested in intercepting messages from two windows. The parent and child...with the parent processing all the messages. So long as I know the parent's window hwnd i could do something like this:

CParentWnd::PreTransLateMessage(MSG)
{
  if(this->m_hWnd == MSG.hwnd)
    AfxMessageBox("Message from parent");
  else
    AfxMessageBox("Message from child");
}


If this doesn't work I have more trick up my sleeve which hopefully does.

What do you think Nish...does the above sound solid for acheiving the task at hand..? Is there a better way of doing it...???

Thanx man!

Cheers Smile | :)

"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
GeneralRe: Custom message handling Pin
Nish Nishant1-Mar-02 6:20
sitebuilderNish Nishant1-Mar-02 6:20 
GeneralRe: Custom message handling Pin
Steen Krogsgaard1-Mar-02 3:49
Steen Krogsgaard1-Mar-02 3:49 
GeneralRe: Custom message handling Pin
Anna-Jayne Metcalfe1-Mar-02 4:36
Anna-Jayne Metcalfe1-Mar-02 4:36 
GeneralRe: Custom message handling Pin
Nish Nishant1-Mar-02 5:03
sitebuilderNish Nishant1-Mar-02 5:03 
GeneralRe: Custom message handling Pin
Anna-Jayne Metcalfe1-Mar-02 9:12
Anna-Jayne Metcalfe1-Mar-02 9:12 
GeneralRe: Custom message handling Pin
Nish Nishant1-Mar-02 4:43
sitebuilderNish Nishant1-Mar-02 4:43 
GeneralRe: Custom message handling Pin
alex.barylski1-Mar-02 6:24
alex.barylski1-Mar-02 6:24 
GeneralRe: Custom message handling Pin
Nish Nishant1-Mar-02 6:33
sitebuilderNish Nishant1-Mar-02 6:33 
GeneralRe: Custom message handling Pin
Steen Krogsgaard3-Mar-02 21:32
Steen Krogsgaard3-Mar-02 21:32 
GeneralNT Service problem Pin
28-Feb-02 15:34
suss28-Feb-02 15:34 
GeneralRe: NT Service problem Pin
Nish Nishant28-Feb-02 15:51
sitebuilderNish Nishant28-Feb-02 15:51 
GeneralRe: NT Service problem Pin
28-Feb-02 16:02
suss28-Feb-02 16:02 
GeneralRe: NT Service problem Pin
Nish Nishant28-Feb-02 16:04
sitebuilderNish Nishant28-Feb-02 16:04 
GeneralRe: NT Service problem Pin
28-Feb-02 16:21
suss28-Feb-02 16:21 
GeneralRe: NT Service problem Pin
Nish Nishant28-Feb-02 16:28
sitebuilderNish Nishant28-Feb-02 16:28 
GeneralRe: NT Service problem Pin
Jon Hulatt28-Feb-02 23:17
Jon Hulatt28-Feb-02 23:17 
GeneralXP, ImageLists and TreeViews Pin
Simon Steele28-Feb-02 12:03
Simon Steele28-Feb-02 12:03 

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.