Managed DirectX中创建了一个键盘的DirectInput device,然后SetCooperativeLevel(),为什么CooperativeLevelFlags的值只能取
CooperativeLevelFlags.Background | CooperativeLevelFlags.NonExclusive,这样,无论窗口有没有焦点程序都能捕获到键盘行为。如果取了CooperativeLevelFlags.Foreground 则后边的Device.Acquire()时就会出现异常。麻烦路过的高手指点一下迷津。另外,如何控制程序窗口没有焦点的时候不捕获键盘行为呢?难不成非得用win32 api来判断窗口是否active然后处理键盘行为?请指教,谢谢!
posted on 2007-07-25 17:33  绿蚂蚁  阅读(441)  评论(2编辑  收藏  举报