Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4034002
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:55:03+00:00 2026-05-20T11:55:03+00:00

In my C++ MFC application I have an ActiveX control on a form. At

  • 0

In my C++ MFC application I have an ActiveX control on a form. At some point I create and show a new dialog. I don’t want the user to be able to click the ActiveX control while this second dialog is up so I tried creating it as a child dialog. However the ActiveX control always appears above the child dialog in Z order. I have tried sending message on the create to change the Z order but nothing worked.

I’ve tried using Windows Hooks to intercept the mouse click using the following code:

GetWindowsHookEx(WH_MOUSE_LL, (HOOKPROC)CDWFDLG::ClickProc, GetModuleHandle(NULL), 0)

 LRESULT CALLBACK CDWFDLG::ClickProc(int ncode, WPARAM wparam, LPARAM lparam)
{

if(wparam == WM_LBUTTONDOWN)
{
    Beep(110, 30);
    return TRUE;
}
return CallNextHookEx(0, ncode, wparam, lparam);
}

This blocks all left mouse clicks which is what I want. However it does this on everything, not just on my application. I’ve tried setting the thread Id using

GetCurrentThreadId()

and

GetWindowThreadProcessId(this->m_hWnd, &threadId )

However neither of these worked. What should I use to just get the hook to run on my application? Once this is working I was planning on using the coordinates of the click to check whether is was on the new dialog and handle it from there.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T11:55:04+00:00Added an answer on May 20, 2026 at 11:55 am

    Although I couldn’t fix the problem using Window Hooks, I think I’ve fixed it using the dialog properties. I’ve set the parent dialog’s Control Parent to True and left everything else in the child dialog’s properties to default (Control is false and and Style is Popup etc).

    Now when I call the dialog through DoModal() it has focus and doesn’t allow clicks on the ActiveX control.

    Thanks

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

we have a C++ MFC application and C# Web Service. They are communicating over
I have a COM DLL (say, xyz.dll) coded in VC++. I want to create
I am creating an MFC application which will be launched on click on Explorer
I am updating an old MFC application that used WinHelp so that it now
The software in question is a native C++/MFC application that receives a large amount
I need to add serial port (e.g. COM8) communications to my MFC application. Which
I'm developing an application under C# to read some data from a hardware which
I have a ATLCOM Shell Extension which adds Right Click Extension to Windows Explorer.
I have a situation where I'm starting a process in my code in order
I want to test a code which is designed for running on a Microcontroller

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.