📄 win32pinvoke.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace SmartAnswerCall
{
class Win32Pinvoke
{
private const uint EM_SETINPUTMODE = 0xde;
private const int GW_CHILD = 5;
// Methods
[DllImport("coredll.dll")]
private static extern IntPtr GetCapture();
[DllImport("coredll.dll")]
private static extern IntPtr GetWindow(IntPtr hWnd, int uCmd);
[DllImport("coredll.dll")]
private static extern uint SendMessage(IntPtr hWnd, uint msg, uint wParam, uint lParam);
// Nested Types
public enum InputMode
{
Spell,
T9,
Numbers,
Text
}
public static void SetInputMode(Control ctrl, InputMode mode)
{
ctrl.Capture = true;
IntPtr capture = GetCapture();
ctrl.Capture = false;
SendMessage(GetWindow(capture, 5), 0xde, 0, (uint)mode);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -