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

  • Home
  • SEARCH
  • 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 7954987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:35:50+00:00 2026-06-04T03:35:50+00:00

I am using a MFC link control in my dialog based application,and I add

  • 0

I am using a MFC link control in my dialog based application,and I add an event handler of BN_CLICKED for it, hoping that it could do something for me, however, when i click on it, it just does nothing at all(when i don’t set the url of it, when i set the url, it will jump to that url), my event handler is not triggered. So, how to disable its default “jump” behaviour and trigger my handler?

  • 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-06-04T03:35:52+00:00Added an answer on June 4, 2026 at 3:35 am

    Subclassing CMFCLinkCtrl and adding an ON_WM_LBUTTONDOWN event handler seems to work.

    You can then choose whether or not to call CMFCLinkCtrl::OnLButtonDown.

    class CMyLinkCtrl : public CMFCLinkCtrl {
        DECLARE_DYNAMIC(CMyLinkCtrl)
    public:
        CMyLinkCtrl();
        virtual ~CMyLinkCtrl();
        afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
    protected:
        DECLARE_MESSAGE_MAP()
    };
    
    IMPLEMENT_DYNAMIC(CMyLinkCtrl, CMFCLinkCtrl)
    
    CMyLinkCtrl::CMyLinkCtrl() {
    }
    
    CMyLinkCtrl::~CMyLinkCtrl() {
    }
    
    BEGIN_MESSAGE_MAP(CMyLinkCtrl, CMFCLinkCtrl)
        ON_WM_LBUTTONDOWN()
    END_MESSAGE_MAP()
    
    void CMyLinkCtrl::OnLButtonDown(UINT nFlags, CPoint point) {
        static bool bDisabled = false;
        if(bDisabled) {
            MessageBox(_T("Link is disabled"));
        } else {
            CMFCLinkCtrl::OnLButtonDown(nFlags, point);
        }
        bDisabled = !bDisabled;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I print a document using MFC Dialog Based Application? I have made
I have an MFC dialog application that I am using as the front end
I'm doing an application using MFC. I just made a class that is derived
I'm trying to rebuild an old metronome application that was originally written using MFC
I'm trying to rebuild an old metronome application that was originally written using MFC
In the old days using MFC I could turn a property sheet into a
I'm creating a Windows Mobile 6 application using MFC Single Document Interface with CFormView
Im using VS2008 and My MFC application has started to crash when setting breakpoints
I have an application which is created using MFC and I have created a
I have C++ application which has UI developed using MFC, does some networking using

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.