示例#1
0
        int IIsolationClient.PreProcessMessage(ref NiMessage message, out PreProcessMessageResult preProcessMessageResult)
        {
            preProcessMessageResult = 0;

            try
            {
                int result = 1;

                var target = FindTarget(message.HWnd);
                if (target != null)
                {
                    Message msg = message;
                    result  = target.PreProcessMessage(ref msg) ? 0 : 1;
                    message = msg;

                    if (Stubs.ControlGetState2(target, Stubs.STATE2_INPUTKEY))
                    {
                        preProcessMessageResult |= PreProcessMessageResult.IsInputKey;
                    }
                    if (Stubs.ControlGetState2(target, Stubs.STATE2_INPUTCHAR))
                    {
                        preProcessMessageResult |= PreProcessMessageResult.IsInputChar;
                    }
                }

                return(result);
            }
            catch (Exception ex)
            {
                return(ErrorUtil.GetHResult(ex));
            }
        }
示例#2
0
        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);
        }
示例#3
0
        int IIsolationHost.ProcessCmdKey(ref NiMessage message, Keys keyData)
        {
            try
            {
                Message msg    = message;
                bool    result = ProcessCmdKey(ref msg, keyData);
                message = msg;

                return(result ? 0 : 1);
            }
            catch (Exception ex)
            {
                return(ErrorUtil.GetHResult(ex));
            }
        }
示例#4
0
        public override bool PreProcessMessage(ref Message msg)
        {
            NiMessage message = msg;
            PreProcessMessageResult preProcessMessageResult;
            bool processed = ErrorUtil.ThrowOnFailure(_client.PreProcessMessage(ref message, out preProcessMessageResult));

            msg = message;

            Stubs.ControlSetState2(
                this,
                Stubs.STATE2_INPUTKEY,
                (preProcessMessageResult & PreProcessMessageResult.IsInputKey) != 0
                );

            Stubs.ControlSetState2(
                this,
                Stubs.STATE2_INPUTCHAR,
                (preProcessMessageResult & PreProcessMessageResult.IsInputChar) != 0
                );

            return(processed);
        }