Q: ChildWindowFromPoint

Q: ChildWindowFromPoint

Post by David Jone » Thu, 18 Oct 2001 21:14:39


With reference to the following code:

void CProgramTester::OnParentNotify(UINT message, LPARAM lParam)
    CDialog::OnParentNotify(message, lParam);

    CPoint ptButtonDown(LOWORD(lParam), HIWORD(lParam));

     if ((message == WM_LBUTTONDOWN)
    && (ChildWindowFromPoint(ptButtonDown) == GetDlgItem(IDC_TEST_BUTTON)))
            //    Do stuff

Why doesn't the last test condition go to TRUE when the mouse is above the
button IDC_TEST_BUTTON. If I try the same thing with a OK or CANCEL button
it does go to TRUE???

Do I need some kind of cast?

I hope somebody can help. It is driving me crazy :)

Thanks in advance



1. Help: ChildWindowFromPoint() only returns CWnd from hidden or disabled windows.


I'm trying to identify my visible and non-disabled controls with
ChildWindowFromPoint() but it only returns a correct CWnd when the
controls is either invisible or disabled.

I've also tried the different flags:  CWP_ALL, CWP_SKIPINVISIBLE,
CWP_SKIPDISABLED and results are still similar.

Any hint?


2. "NTLDR missing" on XP system

3. WMP 7.1 - couple of Qs

4. Changing multi-boot

5. Silence Detection, Optimal Recording Level Qs

6. Slow dialog box response on network

7. Long delay in video stream & General Qs

8. Content Advisor

9. Newbie Qs: Creating QTVR content

10. two Qs - update & java

11. Qs re CD writing

12. 2 Qs - Macros & TSRs

13. IR'Qs