private void OnString(Ddeml.MONHSZSTRUCT mon) { // Get the string from the hsz string handle. // TODO: For some reason this does not work correctly. StringBuilder psz = new StringBuilder(Ddeml.MAX_STRING_SIZE); int length = Ddeml.DdeQueryString(_Context.InstanceId, mon.hsz, psz, psz.Capacity, Ddeml.CP_WINANSI); string str = psz.ToString(); DdemlStringActivityType action = DdemlStringActivityType.CleanUp; switch (mon.fsAction) { case Ddeml.MH_CLEANUP: action = DdemlStringActivityType.CleanUp; break; case Ddeml.MH_CREATE: action = DdemlStringActivityType.Create; break; case Ddeml.MH_DELETE: action = DdemlStringActivityType.Delete; break; case Ddeml.MH_KEEP: action = DdemlStringActivityType.Keep; break; } DdemlStringActivityEventArgs args = new DdemlStringActivityEventArgs(str, action, mon.hTask); if (StringActivity != null) { StringActivity(this, args); } }
internal DdeStringActivityEventArgs(DdemlStringActivityEventArgs args) : base(args) { _DdemlObject = args; }