protected override void Execute(CodeActivityContext context)
        {
            var h = WindowHandle.Get(context);

            if (h == null)
            {
                throw new ArgumentException(Resource.WindowHandleArgumentValidationError);
            }
            var value = Bridge.SetState(Bridge.ToWin32Handle(h), 0, 0);

            KeyboardLayout.Set(context, (value >> 16) & 0xffff);
            KeyboardOpenClose.Set(context, ((value >> 15) & 1) == 1);
            ConversionMode.Set(context, (value >> 0) & 0x7fff);
        }