键盘输入API

来源:互联网 发布:淘宝轮播图制作 编辑:程序博客网 时间:2024/06/05 01:19

在WindowsBase下MS.Win32下UnsafeNativeMethods里面

DllImport("imm32.dll", CharSet = CharSet.Auto)]
        public static extern bool ImmSetConversionStatus(HandleRef hIMC,int conversion,int sentence);
        [SecurityCritical, SuppressUnmanagedCodeSecurity]
        [DllImport("imm32.dll", CharSet = CharSet.Auto)]
        public static extern bool ImmGetConversionStatus(HandleRef hIMC,refint conversion, refint sentence);
        [SecurityCritical, SuppressUnmanagedCodeSecurity]
        [DllImport("imm32.dll", CharSet = CharSet.Auto)]
        public static extern IntPtr ImmGetContext(HandleRef hWnd);
        [SecurityCritical, SuppressUnmanagedCodeSecurity]
        [DllImport("imm32.dll", CharSet = CharSet.Auto)]
        public static extern bool ImmReleaseContext(HandleRef hWnd, HandleRef hIMC);
        [SecurityCritical, SuppressUnmanagedCodeSecurity]
        [DllImport("imm32.dll", CharSet = CharSet.Auto)]
        public static extern IntPtr ImmAssociateContext(HandleRef hWnd, HandleRef hIMC);
        [SecurityCritical, SuppressUnmanagedCodeSecurity]
        [DllImport("imm32.dll", CharSet = CharSet.Auto)]
        public static extern bool ImmSetOpenStatus(HandleRef hIMC,bool open);
        [SecurityCritical, SuppressUnmanagedCodeSecurity]
        [DllImport("imm32.dll", CharSet = CharSet.Auto)]
        public static extern bool ImmGetOpenStatus(HandleRef hIMC);
        [SecurityCritical, SuppressUnmanagedCodeSecurity]
        [DllImport("imm32.dll", CharSet = CharSet.Auto)]
        public static extern bool ImmNotifyIME(HandleRef hIMC,int dwAction,int dwIndex, int dwValue);
        [SecurityCritical, SuppressUnmanagedCodeSecurity]
        [DllImport("imm32.dll", CharSet = CharSet.Auto)]
        public static extern int ImmGetProperty(HandleRef hkl,int flags);
        [SecurityCritical, SuppressUnmanagedCodeSecurity]
        [DllImport("imm32.dll", CharSet = CharSet.Auto)]
        public static extern int ImmGetCompositionString(HandleRef hIMC,int dwIndex,char[] lpBuf, int dwBufLen);
        [SecurityCritical, SuppressUnmanagedCodeSecurity]
        [DllImport("imm32.dll", CharSet = CharSet.Auto)]
        public static extern int ImmGetCompositionString(HandleRef hIMC,int dwIndex,byte[] lpBuf, int dwBufLen);
        [SecurityCritical, SuppressUnmanagedCodeSecurity]
        [DllImport("imm32.dll", CharSet = CharSet.Auto)]
        public static extern int ImmGetCompositionString(HandleRef hIMC,int dwIndex,int[] lpBuf, int dwBufLen);
        [SecurityCritical, SuppressUnmanagedCodeSecurity]
        [DllImport("imm32.dll", CharSet = CharSet.Auto)]
        public static extern int ImmGetCompositionString(HandleRef hIMC,int dwIndex, IntPtr lpBuf,int dwBufLen);
        [DllImport("imm32.dll", CharSet = CharSet.Auto)]
        public static extern int ImmConfigureIME(HandleRef hkl, HandleRef hwnd,int dwData, IntPtr pvoid);
        [DllImport("imm32.dll", CharSet = CharSet.Auto)]
        public static extern int ImmConfigureIME(HandleRef hkl, HandleRef hwnd,int dwData, [In]ref NativeMethods.REGISTERWORD registerWord);
        [SecurityCritical, SuppressUnmanagedCodeSecurity]
        [DllImport("imm32.dll", CharSet = CharSet.Auto)]
        public static extern int ImmSetCompositionWindow(HandleRef hIMC, [In] [Out]ref NativeMethods.COMPOSITIONFORM compform);
        [SecurityCritical, SuppressUnmanagedCodeSecurity]
        [DllImport("imm32.dll", CharSet = CharSet.Auto)]
        public static extern int ImmSetCandidateWindow(HandleRef hIMC, [In] [Out]ref NativeMethods.CANDIDATEFORM candform);
        [DllImport("imm32.dll", CharSet = CharSet.Auto)]
        public static extern IntPtr ImmGetDefaultIMEWnd(HandleRef hwnd);

0 0