GetAsyncKeyState()导致防病毒程序标记为键盘记录程序 [英] GetAsyncKeyState() causes anti-virus program to flag as keylogger

查看:50
本文介绍了GetAsyncKeyState()导致防病毒程序标记为键盘记录程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Windows API中构建了一个非常小的游戏,并且在主消息循环中,我使用GetAsyncKeyState()测试用户是否按下了箭头按钮.我使用它而不是WM_KEYDOWN,因为使用WM_KEYDOWN时,第一次按下后会有一个初始暂停,并且我不想修改用户的设置.我的防病毒程序将游戏标记为键盘记录程序,是否有其他替代方法?

I have been building a very small game in the Windows API, and in the main message loop I use GetAsyncKeyState() to test if a user is pressing the arrow buttons. I use this instead of WM_KEYDOWN because with WM_KEYDOWN there is an initial pause after the first press, and I don't want to modify a user's settings. My antivirus program flags the game as a keylogger program, is there an alternative way about this?

推荐答案

防病毒程序应如何使用GetAsyncKeyState()来窥探键盘和登录键来猜测您不是 ?您告诉您,当然要排除在外.如果您担心不能轻易说服未来的客户,请返回使用WM_KEYDOWN/UP.使用256个布尔数组来跟踪键状态.不管您获得多少,将其设置为DOWN(真),UP(否)设置为false.另外,在应用失去焦点时停止调用API函数时,还要检查扫描仪是否满意.请注意WM_ACTIVATEAPP.

How is the anti-virus program supposed to guess that you are not using GetAsyncKeyState() to spy on the keyboard and log keys? You tell it of course, make an exclusion. If you're worried that your future customers are not so easily convinced then go back to using WM_KEYDOWN/UP. Use an array of 256 bools to keep track of the key state. Set it to true on DOWN, regardless of how many you get, false on UP. Also check if the scanner is happy when you stop calling the API function when your app loses focus. Pay attention to WM_ACTIVATEAPP.

这篇关于GetAsyncKeyState()导致防病毒程序标记为键盘记录程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆