你得自己处理这些信息。但是,为您创建一个这样做的类非常容易。例如。:
public class HelpCards : IMessageFilter {
const int WM_TCARD = 0x52;
const int ID_NOTIFICATION = 4242;
public enum TCardAction: int {
IDOK = 1,
IDCANCEL = 2,
IDABORT = 3,
IDRETRY = 4,
IDIGNORE = 5,
IDYES = 6,
IDNO = 7,
IDCLOSE = 8,
IDHELP = 9,
HELP_TCARD = 0x8000,
HELP_TCARD_DATA = 0x0010,
HELP_TCARD_OTHER_CALLER = 0x0011,
HELP_TCARD_OTHER_NEXT = 0x0011,
}
public HelpCards() {
Application.AddMessageFilter(this);
}
public delegate void OKReceived();
public event OKReceived OnOKReceived;
public bool PreFilterMessage(ref Message m) {
if (m.Msg == WM_TCARD && (int)m.WParam == ID_NOTIFICATION) {
switch ((TCardAction)m.LParam) {
case TCardAction.IDOK:
if (OnOKReceived != null) {
OnOKReceived();
}
break;
// etc.
}
return true; // true means message was handled
}
return false;
}
}
然后,在你想订阅的地方(可能在你的表单中的某个地方)使用
hc = new HelpCards();
hc.OnOKReceived += new OKReceived(hc_OnOKReceived);
并拥有
hc
HelpCards hc;
在某个地方有处理功能:
void hc_OnOKReceived() {
throw new NotImplementedException();
}
显然,剩下的你得自己做。但这应该让你开始。