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 6656679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:40:22+00:00 2026-05-26T01:40:22+00:00

I have an activex control that I display in a webbrowser control on a

  • 0

I have an activex control that I display in a webbrowser control on a windows mobile device using a C# forms app.

The activex control is working. I want to add a feature to the activex control where an event is raised in the activex control when a registry value changes state.

I have implemented the same (but reversed) functionality on the forms side using RegistryState with the following code. With this code my .net forms app gets notified when a registry value changes. The forms code is below.

private void TestContainer_Load(object sender, EventArgs e)
{
    RegistryKey rk = Registry.LocalMachine.OpenSubKey("MyKey");
    state = new RegistryState("HKEY_LOCAL_MACHINE\\MyKey", "MessageToHostForm");
    state.Changed += new ChangeEventHandler(state_Changed);
}

void state_Changed(object sender, ChangeEventArgs args)
{
    RegistryKey rk = Registry.LocalMachine.OpenSubKey("MyKey");

    if (rk == null)
    {
        // No value available in the created/opened subkey
    }
    else
    {
        string strOut = (string)rk.GetValue("MessageToHostForm");
        button3.Text = strOut;
        rk.Close();
    }
}

I would like to create the same functionality in the ActiveX control where an event in the control gets fired when a registry value changes.

The problen is … from what I can tell … Registry.State is not available in an ATL C++ app 🙁

How can I make my ATL ActiveX control respond to changes in registry values. (I don’t want to use polling)

Is this posible?

Thanks for at least reading this… Long I know…

  • 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-26T01:40:23+00:00Added an answer on May 26, 2026 at 1:40 am

    To avoid polling, you can use CRegKey::NotifyChangeKeyValue, which is in turn built on top of RegNotifyChangeKeyValue. You can have an event signaled with a change under the key. So your worker thread might be waiting for this event [possibly among others] and once your wait is satisfied you would do whatever you do in your state_Changed above.

    You also have sample code there: http://msdn.microsoft.com/en-us/library/ms724892%28VS.85%29.aspx

    UPD. I realized mobile platform is in question – things are somewhat different there, but still you have an event based option:

    • MSDN: CeFindFirstRegChange http://msdn.microsoft.com/en-us/library/aa914423.aspx
    • Code Snippet: Windows CE: Monitor for Registry Changes
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a windows application that contains an ActiveX WebBrowser control. As part of
We have a Windows Forms application that uses a (third party) ActiveX control, and
I have got an ActiveX Control that gets an image from a fingerprint device
I have written an ActiveX control in C# and have made it working using
We have created a C# windows form application that uses an ActiveX control to
Hi I have a webpage that's using classic ASP that I want to display
I have an ActiveX control that runs on a website, where the old version
I have an ActiveX control that I'm loading with JavaScript in Internet Explorer. It
I have the unenviable task of maintaining an ActiveX control that expects OLE_Colors as
I have an ActiveX control written in C++ that runs in Internet Explorer 8.

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.