win8让触摸键盘透明
2015-07-18 13:02
381 查看
C#的实现方法
[DllImport("user32.dll", CharSet = CharSet.Ansi, EntryPoint = "SetWindowLongA", ExactSpelling = true, SetLastError = true)] private static extern long SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); [DllImport("User32.Dll", CharSet = CharSet.Auto, SetLastError = true)] private static extern int GetWindowLong(IntPtr hWnd, int nIndex); [DllImport("User32.Dll", CharSet = CharSet.Auto, SetLastError = true)] private static extern int SetLayeredWindowAttributes(IntPtr Handle, int crKey, byte bAlpha, int dwFlags); [DllImport("User32.Dll", CharSet = CharSet.Auto, SetLastError = true)] private static extern IntPtr FindWindow(String sClassName, String sAppName); const int WS_EX_LAYERED = 0x80000; const int LWA_ALPHA = 0x2; const int GWL_EXSTYLE = -20; void SetScreenKeyboardOpacity(int opacity) { if(opacity<0||opacity>100)return; IntPtr Handle=FindWindow("IPTip_Main_Window", null); if (Handle != IntPtr.Zero) { SetWindowLong(Handle, GWL_EXSTYLE, (GetWindowLong(Handle, GWL_EXSTYLE) | WS_EX_LAYERED)); SetLayeredWindowAttributes(Handle, 0, (byte)(255*(opacity)/100), LWA_ALPHA); } }
相关文章推荐
- 类的加载、执行顺序
- stm32操作时钟芯片ds1390
- Java Web开发之:ModelDriven
- Cordys JAVA Object理解
- [译]用R语言做挖掘数据《七》
- 整数实现翻转---java实现
- js实现用户离开页面前提示是否离开此页面的方法(包括浏览器按钮事件)
- rsync+inotify实现数据的实时同步
- Tkinter 控件详细介绍
- HDU 4870 Rating (2014 多校联合第一场 J)(概率)
- 开源完整版:《开源框架实战宝典电子书V1.0.0》内测版下载地址!
- js输入一个日期判断该日期是该年的第几天
- 对android volley框架的理解(一)
- 4Sum
- 小游戏(锅打灰太狼)
- 20150718,about c.
- JAVA事件处理机制3
- HDU-1865-1sting
- atitit.jndi的架构与原理以及资源配置and单元测试实践
- atitit.jndi的架构与原理以及资源配置and单元测试实践