HResult INiIsolationClient.PreProcessMessage(ref NiMessage message, out PreProcessMessageResult preProcessMessageResult) { preProcessMessageResult = 0; try { var result = HResult.False; var target = FindTarget(message.HWnd); if (target != null) { Message msg = message; result = target.PreProcessMessage(ref msg) ? HResult.OK : HResult.False; message = msg; if (ControlStubs.ControlGetState2(target, ControlStubs.STATE2_INPUTKEY)) { preProcessMessageResult |= PreProcessMessageResult.IsInputKey; } if (ControlStubs.ControlGetState2(target, ControlStubs.STATE2_INPUTCHAR)) { preProcessMessageResult |= PreProcessMessageResult.IsInputChar; } } return(result); } catch (Exception ex) { return(ErrorUtil.GetHResult(ex)); } }
public HResult PreFilterMessage(ref NiMessage message) { try { if (_preMessageFilterRecursion > 0) { return(HResult.False); } _preMessageFilterRecursion++; try { return(MessageFilterUtil.InvokeMessageFilter(ref message) ? HResult.OK : HResult.False); } finally { _preMessageFilterRecursion--; } } catch (Exception ex) { return(ErrorUtil.GetHResult(ex)); } }
protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { if (base.ProcessCmdKey(ref msg, keyData)) { return(true); } NiMessage message = msg; bool result = ErrorUtil.ThrowOnFailure(_host.ProcessCmdKey(ref message, keyData)); msg = message; return(result); }
HResult INiIsolationHost.ProcessCmdKey(ref NiMessage message, Keys keyData) { try { Message msg = message; bool result = ProcessCmdKey(ref msg, keyData); message = msg; return(result ? HResult.OK : HResult.False); } catch (Exception ex) { return(ErrorUtil.GetHResult(ex)); } }
public static bool InvokeMessageFilter(ref NiMessage message) { // This methods invokes System.Windows.Forms.Application+ThreadContext.ProcessFilters. // The purpose of this is to broadcast pre-filter messages over // AppDomains. The idea is that every AppDomain has a mesage filter. // When this message filter receives a message, it is passed // to INiShell.BroadcastPreFilterMessage. That method invokes // this method on AppDomain 1 and passes it on to all INiPackages // that implement INiPreMessageFilter. That implementation in turn // also invokes this method so that the message is broadcasted to // the rest of the AppDomains. Care must be taken to make sure that // this does not recurse, so all calls to INiShell.BroadcastPreMessageFilter // and MessageFilterUtil.InvokeMessageFilter must be protected with // recursion prevention. return(_invokeMessageFilterDelegate(ref message)); }
public HResult PreProcessMessage(ref NiMessage message, out PreProcessMessageResult preProcessMessageResult) { preProcessMessageResult = 0; try { if (_page != null) { return(_page.PreProcessMessage(ref message, out preProcessMessageResult)); } return(HResult.False); } catch (Exception ex) { return(ErrorUtil.GetHResult(ex)); } }
public override bool PreProcessMessage(ref Message msg) { NiMessage message = msg; PreProcessMessageResult preProcessMessageResult; bool processed = ErrorUtil.ThrowOnFailure(_window.PreProcessMessage(ref message, out preProcessMessageResult)); msg = message; ControlStubs.ControlSetState2( this, ControlStubs.STATE2_INPUTKEY, (preProcessMessageResult & PreProcessMessageResult.IsInputKey) != 0 ); ControlStubs.ControlSetState2( this, ControlStubs.STATE2_INPUTCHAR, (preProcessMessageResult & PreProcessMessageResult.IsInputChar) != 0 ); return(processed); }
public bool PreFilterMessage(ref Message m) { if (_package._preMessageFilterRecursion > 0) { return(false); } _package._preMessageFilterRecursion++; try { InstallListViewListener(ref m); NiMessage message = m; bool processed = ErrorUtil.ThrowOnFailure(_shell.BroadcastPreMessageFilter(ref message)); m = message; return(processed); } finally { _package._preMessageFilterRecursion--; } }