English 中文(简体)
如何在ATL活性X控制中发出事件通知,如果某一登记处对作为流动X控制窗口使用的用途进行价值变动
原标题:How to get event notification in an ATL ActiveX control when a specified registry value changes for use as a windows mobile ActiveX control

我在网上浏览器控制上用C#表格显示的窗口移动装置,有积极的控制。

积极的控制正在发挥作用。 在登记处价值发生变化时,在积极的X控制中增加一项活动时,我想补充积极的X控制的特点。

我在表格方面采用了同样的(但逆转)功能,使用登记国的以下代码。 有了这一代码,我的净值在登记价值变化时即通知用户。 表格代码如下。

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();
    }
}

如果在登记处价值发生变化时发生控制事件,那么在主动X控制中,我也会产生同样的功能。

证据是......我可以告诉......书记官处。 ATL C++ :

我如何能够对登记价值的变化做出积极的预算外控制。 (我不想投票)

这是否可行?

至少读了这段话...... 长期我知道......

最佳回答

为避免投票,您可使用http://msdn.microsoft.com/library/2hc40xc.aspx” rel=“nofollow”>。 CRegKey:NotifyChangeKeyValue ,这反过来又建立在之上。 RegNotifyChangeKeyValue。 你们可以有一个在钥匙下变化的信号。 因此,您的劳动者可能正在等待这项活动,[可能包括],一旦您的等待得到满足,你将尽你所能,在以上<条码>中做任何事情。

http://msdn.microsoft.com/en-us/library/ms724892%VS.85%29.aspx”rel=“nofollow” http://msdn.microsoft.com/en-us/library/ms724892%28VS.85%29.aspx

UPD。 我已实现的移动平台受到质疑,那里的情况有些不同,但你仍然有基于活动的选择:

问题回答

暂无回答




相关问题
Undefined reference

I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...

C++ Equivalent of Tidy

Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...

Template Classes in C++ ... a required skill set?

I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?

Print possible strings created from a Number

Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...

typedef ing STL wstring

Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

Window iconification status via Xlib

Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?

热门标签