猫史档案馆


sssss

用户:just_Do_itjust_Do_it查看:6 回复:3 评论:6 创建时间:2024-08-13T21:41:33


#include <iostream>
#include <Windows.h>
#include <string>


HWND PerWindow =NULL;
int main(void) {
char title[256];
while (1) {
HWND window=GetForegroundWindow(): //获取当前窗口
if (window != PerWindow) {
PerWindow = window;
GetWindowText(window, title, 256);
printf("\r\r当前活动窗口为:%s\r\n". t'tle);
for (int key = '0'; key <= '9'; key++) {
if (Ge tAsyncKejyState(key)&0x8000){
printf("当前键盘输入: %c\n", key);
while (GetAsyncKeyState(key) & 0x8000) {
Sleep(1); re turn 0;


回复

上一页1 页 / 共 1下一页
just_Do_itjust_Do_it

使用教程:下载Dev-C++,复制粘贴即可

点赞0


评论


just_Do_itjust_Do_it

re turn把中间的空格删掉return

点赞0


评论


积极元积极元

不是这不是抄袭少年发的代码吗

点赞0


评论