如何阻止应用程序从开幕 [英] How Do I Stop An Application From Opening

查看:143
本文介绍了如何阻止应用程序从开幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要写一个小的应用程序,它位于我的托盘,可以让我选择开口的可执行文件和prevent吧。

I want to write a small app that sits in my tray and that allows me to select an executable and prevent it from opening.

该应用程序的用户界面是很容易使用的WinForms做。

The UI of the app is easy to do using WinForms.

我想知道的是如何检测如果某exe文件已lauched再怎么停止运行它。我是pretty的肯定,我将不得不向下挖掘到一些Win32的东西,但我在这方面没有经验,因此这一职务。

What I want to know is how to detect if a certain exe has been lauched and then how to stop it from running. I'm pretty sure I'll have to dig down into some Win32 stuff but I have no experience in that area, hence this post.

有类似这样现有的应用程序,但我不能为我的生活还记得它叫什么。这是写在VB6,它是开源的了。

There is an existing app similar to this, but I can't for the life of me remember what it's called. It was written in VB6 and it's open source too.

任何帮助是非常AP preciated。

Any help is much appreciated.

感谢。

推荐答案

而不是试图杀死进程在运行时,如何从摆在首位运行阻止它?

Rather than trying to kill the process when it runs, how about stopping it from running in the first place?

更改当shell试图启动一个应用程序是简单的会发生什么 - 添加一个新的注册表项为 HKEY_LOCAL_MACHINE \ SOFTWARE \微软\的Windows NT \ CURRENTVERSION \图像文件执行选项

Changing what happens when the shell tries to launch an application is simple - add a new registry key to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options

要测试这一点,我添加了名为注册表项的 NOTEPAD.EXE 并在此字符串值调试的值的calc.exe 。现在,每当我试图运行记事本打开计算。以下是导出的注册表键。

To test this I added a registry key called notepad.exe and within this the string value Debugger with the value calc.exe. Now whenever I try and run notepad calc opens. The following is the exported registry key.

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe]
"Debugger"="calc.exe"

在作出这种改变,我没有能够打开记事本,不坏的无code解决方案。如果你需要100%肯定的是,应用程序永远不会运行,你可以随时添加一个太详见被别人杀死的解决方案。

Having made this change I've not yet managed to open notepad, not bad for a no code solution. If you need to be 100% certain that the application never runs you could always add a "kill" solution too as detailed by others.

这篇关于如何阻止应用程序从开幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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