微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

您如何从C#中显示/隐藏听写工具栏

如何解决您如何从C#中显示/隐藏听写工具栏

我试图显示/隐藏听写工具栏,我不想简单地模拟WIN + H命令。我对UWP不太熟悉,但是听写工具栏似乎是ms-inputapp(InputHostApp.exe)的一部分。有没有办法找出WIN + H正在执行的命令以显示听写工具栏?

解决方法

这不是一个真正的答案,但这是我所能得到的。可能对某人有帮助。

这是Public Class Form2 'Class level variable declaration Dim dblAverage As Double Dim studentGrade As Char Private Sub btnCalculate_Click(sender As Object,e As EventArgs) Handles btnCalculate.Click lstOutput.Items.Clear() Const intMAX_ROW As Integer = 2 'Highest Row subscript Const intMAX_COL As Integer = 2 'Highest Column subscript Dim intRow,intCol As Integer 'Row and column loop counter Dim strName(intMAX_ROW) As String 'Name Array initilization Dim intMarks(intMAX_ROW,intMAX_COL) As String 'Marks Array initialization Dim intTotal As Integer 'Sum Name array through rows For intRow = 0 To intMAX_ROW strName(intRow) = InputBox("Enter Student name") lstOutput.Items.Add("Test Scores for: " & strName(intRow)) 'Error handling using try catch expression Try 'Initialize accumulator intTotal = 0 'Enter and sum Marks Column within the same row For intCol = 0 To intMAX_COL intMarks(intRow,intCol) = InputBox("Enter the score for test " & (intCol + 1)) If intMarks(intRow,intCol) >= 0 And intMarks(intRow,intCol) <= 100 Then intTotal += intMarks(intRow,intCol) Else MessageBox.Show("Enter Marks must be between 0-100") End If lstOutput.Items.Add(intMarks(intRow,intCol)) Next 'To calculate average dblAverage = intTotal / (intMAX_COL + 1) 'To Display lstOutput.Items.Add("The total test scores for " & strName(intRow) & " is " & intTotal.ToString()) lstOutput.Items.Add("Results: ") lstOutput.Items.Add(strName(intRow) & " Average: " & Math.Round(dblAverage) & " Grade: " & Grades()) lstOutput.Items.Add("") Catch MessageBox.Show("Score must be numeric between 0-100") End Try Next End Sub 'Grade Condition Function Function Grades() If dblAverage >= 90 And dblAverage <= 100 Then studentGrade = "A" ElseIf dblAverage >= 80 And dblAverage <= 89 Then studentGrade = "B" ElseIf dblAverage >= 70 And dblAverage <= 79 Then studentGrade = "C" ElseIf dblAverage >= 60 And dblAverage <= 69 Then studentGrade = "D" Else studentGrade = "F" End If Return studentGrade End Function Private Sub btnExit_Click(sender As Object,e As EventArgs) Handles btnExit.Click Me.Close() End Sub 中处理 Win + H 热键(Windows 10 v19041.508)的调用堆栈:

explorer.exe
用值coreuicomponents.Microsoft::CoreUI::Proxy::MessageProxy::Send+119 coreuicomponents.public: virtual void __cdecl Proxy_IRemoteCoreKeyboardClient$R::IRemoteCoreKeyboardClient_Impl::OnShellStateChanged(class System::Object * __ptr64,class System::Byte_1D * __ptr64,unsigned int,bool,unsigned int) __ptr64+7E coreuicomponents.public: void __cdecl IRemoteCoreKeyboardClient::OnShellStateChanged(class System::Byte_1D * __ptr64,unsigned int) __ptr64+66 coreuicomponents.public: virtual long __cdecl IRemoteCoreKeyboardClient$X__ExportAdapter::OnShellStateChanged(struct MsgBlob * __ptr64,unsigned int) __ptr64+BC windows.ui.core.textinput.public: virtual long __cdecl CCoreKeyboardManager::ShellStateChanged(struct Windows::Foundation::Collections::IVectorView<struct Windows::UI::Internal::Text::Core::CoreKeyboardPositionAndSizeOption> * __ptr64,enum Windows::UI::Internal::Text::Core::CoreKe twinui.pcshell.private: long __cdecl KeyboardHosting::TabTipAdapter::ProcessShowRequest(enum Windows::UI::Internal::Text::Core::CoreKeyboardViewType) __ptr64+11F twinui.pcshell.private: long __cdecl KeyboardHosting::TabTipAdapter::OnShellRequestedStateChange(enum Windows::UI::Internal::Text::Core::CoreKeyboardViewType,enum Windows::UI::Internal::Text::Core::CoreKeyboardModality,enum KeyboardHosting::ShellRequestedStateChangeReas twinui.pcshell.public: long __cdecl KeyboardHosting::TabTipAdapter::OnShellHotKey(enum _TouchKeyboardShellHotKeyType) __ptr64+1E2 twinui.pcshell.public: virtual long __cdecl TouchKeyboardExperienceManager::OnShellHotKey(enum _TouchKeyboardShellHotKeyType) __ptr64+17 explorer.protected: void __cdecl CTray::_HandleDictationHotKey(void) __ptr64+67 explorer.protected: void __cdecl CTray::_HandleGlobalHotkey(unsigned __int64,__int64) __ptr64+417 explorer.protected: virtual __int64 __cdecl CTray::v_WndProc(struct HWND__ * __ptr64,unsigned __int64,__int64) __ptr64+48F 调用

TouchKeyboardExperienceManager::OnShellHotKey(),这可能意味着 Win + H

2通过类似于COM的某种方式使用_HandleDictationHotKey = TouchKeyboardExperienceManager::OnShellHotKey来调用IID_ITouchKeyboardExperienceManager,但是我找不到对9516d866-ca0f-40ca-8997-efa618b50f99的任何调用或类似的调用。

似乎最终可以通过某种RPC(CoCreateInstance)将消息发送到触摸键盘

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。