原文:wpf 屏蔽热键 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/a771948524/article/details/9428923 using System; using System.Windows; using System.Runtime.InteropServices; namespace WpfApplication1 { /// <summary> /// Interaction logic for App.xaml
1.在窗启动时创建ATOM;(aatom:ATOM;定义在private中) then begin aatom:=GlobalAddAtom('ZWXhotKey'); end; ) then begin MessageBox(Handle,'按alt+a','提示',MB_OK); end; 2.定义处理热键的消息过程(定义在private中,下面二个处理消息的过程是一样的) procedure hotkey(var msg:TMessage);message WM_HOTKEY;//定义全局
using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Forms; using System.Windows.Interop; namespace WpfHot