将Windows Locale更改为非英语时

发布于 2025-01-31 09:21:35 字数 1152 浏览 1 评论 0原文

我在wpf应用程序代码中有以下C#.NET代码:

        public static void ClearList(IHTMLDocument document)
        {
            if (CanSetBlockFormat(document))
            {
                OleCommandTargetHelper.Execute(document, MsHtmcid.IDM_BLOCKFMT, new object[] { "Normal" });
            }
        }

其中:

        internal static object Execute(IHTMLDocument document, MsHtmcid command, object[] arguments)
        {
            var commandTarget = (DocObj.IOleCommandTarget)document;

            var retVal = new object[] { null };
            var hr = commandTarget.Exec(
                ref NativeMethods.Guid_MSHTML,
                (int)command,
                (int)DocObj.OLECMDEXECOPT.DONTPROMPTUSER,
                arguments,
                retVal);
            return retVal[0];
        }

它用于编辑和格式化WebView/WPF中的HTML文本,其中使用的Web浏览器使用的Web浏览器是Internet Explorer,并用作一种富文本编辑器生成所需的html 。

在这种特殊情况下,它用于从项目符号或编号列表中删除格式。

谁能告诉我,为什么我将Windows langauge设置更改为非英语(例如奥地利人?)

Windows 10语言设置

I have the following c# .Net code in WPF app code:

        public static void ClearList(IHTMLDocument document)
        {
            if (CanSetBlockFormat(document))
            {
                OleCommandTargetHelper.Execute(document, MsHtmcid.IDM_BLOCKFMT, new object[] { "Normal" });
            }
        }

where:

        internal static object Execute(IHTMLDocument document, MsHtmcid command, object[] arguments)
        {
            var commandTarget = (DocObj.IOleCommandTarget)document;

            var retVal = new object[] { null };
            var hr = commandTarget.Exec(
                ref NativeMethods.Guid_MSHTML,
                (int)command,
                (int)DocObj.OLECMDEXECOPT.DONTPROMPTUSER,
                arguments,
                retVal);
            return retVal[0];
        }

This is used for editing and formatting html text in WebView/WPF, where the web browser used is internet explorer and is used as a kind of rich text editor generating required HTML.

In this particular case it is used to remove formatting from bulleted or numbered list.

Can anyone tell me why this code doesn't work the moment I change windows langauge settings to non-english (Austrian for example?)

windows 10 language settings

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文