作为 Windows 服务的键盘钩子 [英] keyboard hook as a windows service

查看:34
本文介绍了作为 Windows 服务的键盘钩子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 c# 中创建一个应用程序,它挂钩所有按钮点击,但我希望在用户登录之前运行该应用程序.(所以它应该挂钩所有用户操作,我可以获得我父母设置的帐户密码).我发现如果我想在登录前运行一些东西,它应该是服务,所以我已经装了一个.然后我读了这篇文章http://www.codeproject.com/Articles/7294/Processing-Global-Mouse-and-Keyboard-Hooks-in-C

Hi What i am trying is to create a application in c# which hooks all button clicks but i want this application to be run before user logon. (so it should hook all user actions and i can get account password my parents set). what i found out is that if i want to run something before logon it should be service so i have crated one. then i read this article http://www.codeproject.com/Articles/7294/Processing-Global-Mouse-and-Keyboard-Hooks-in-C

示例程序在手动午餐时工作正常(即使应用程序被最小化也捕获所有钩子)但没有窗口形式它不起作用.所以当我在没有 Windows 窗体的情况下实现它时,我失败了.将其作为服务午餐时,它无法显示 Windows 窗体(我不想创建交互式服务),因此我的应用程序无法正常工作.是否可以创建一个不需要 Windows 窗体的应用程序或运行此窗体隐藏或类似的东西并在登录前运行它?

sample program works fine (captures all hooks even if app is minimized ) when it is lunched manually but without windows form it is not working. so when i trued make it without windows form i failed. When lunching it as service it is not able to display windows form (I dont want t to create interactive service ) so my app is not working. is it available to create an app which does not need windows form or run this form hidden or something like that and run it before logon?

P.s 我使用的是 Windows 7.

P.s i am using windows 7 .

推荐答案

在 windows 7 中服务无法与用户桌面交互.所以这是不可能的.

In windows 7 service cannot interact with user desktop. So it is impossible.

出于安全原因,这正是您所描述的.

It is for security reasons, exactly this what you are describing.

这篇关于作为 Windows 服务的键盘钩子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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