我怎么能隐藏我的Windows程序 [英] how can i hide my windows program

查看:92
本文介绍了我怎么能隐藏我的Windows程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我把show放在任务栏= false但是当我运行我的程序时我可以在任务管理中看到它如何从任务管理器隐藏我的应用程序?

解决方案

< blockquote> ShowInTaskBar仅影响表单并确定该表单是否可以显示在任务栏中,该栏是在桌面底部交叉的。它对您在TaskManager中显示的应用程序完全没有影响。



您无法从TaskManager中隐藏您的应用程序。也没有任何合理的理由这样做。


任务管理器的主要功能是管理任务。如果它不知道正在运行的任务,则无法执行此操作。因此,您无法从任务管理器中隐藏任务。


我在MSDN上找到它:

试试这个

首先导入名称空间:



Imports System.Runtime.InteropServices

Imports System.Diagnostics



然后声明常量


Private Const SW_HIDE As Integer = 0
Private Const SW_RESTORE As Integer = 9
Private hWnd As Integer


然后声明win32函数





< dllimport( user32> _
私有共享函数ShowWindow(ByVal hwnd As Integer,ByVal nCmdShow As Integer)As Integer


然后你必须创建一个方法 get 你要隐藏的进程名称



私人p As Process()= Process.GetProcessesByName( 您的流程名称

hWnd = CType(p( 0 )。MainWindowHandle,Integer)



现在你打电话给函数



ShowWindow(hWnd,SW_HIDE)





关注 this 和u ' ll隐藏进程的应用程序。



注意:如果您将应用程序重命名为winlogon.exe,即使您的姐姐意识到该服务正在与她的用户一起运行,她也不会
能够关闭它,因为窗口赢了' t让因为winlogon.exe是一个关键进程,可以' t由任务经理关闭。


i put show in task bar = false but when i run my program i can see it in the task manage how can i hide my application from task manager ?

解决方案

ShowInTaskBar only affects the form and determines if that form can show in the Task Bar, which is the bar acrossed the bottom of the Desktop. It has no effect at all on your application showing up in TaskManager.

You cannot hide your application from TaskManager. There is also never any legitimate reason to do so.


The primary function of Task Manager is to manage tasks. It cannot do this if it does not know what tasks are running. Therefore you cannot hide tasks from Task Manager.


i found it on MSDN:
try this

first import the namespaces:

 

Imports System.Runtime.InteropServices

Imports System.Diagnostics

 

then declare the constants


Private Const SW_HIDE As Integer = 0
Private Const SW_RESTORE As Integer = 9
Private hWnd As Integer
 

then declare the win32 function

 

 

<dllimport("user32")> _
Private Shared Function ShowWindow(ByVal hwnd As Integer, ByVal nCmdShow As Integer) As Integer
 

then you have to create a method to get the process name that u want to hide

 

Private p As Process() = Process.GetProcessesByName("the name of your process")
 
hWnd = CType(p(0).MainWindowHandle, Integer)

 

now u call the function

 

ShowWindow(hWnd, SW_HIDE) 

 

 

Follow this and u'll hide your application of the processes .

 

note:If you rename your application to winlogon.exe even if your sister realized that the service is running with her user she won't be able to close it because the windows won't let cause winlogon.exe is a critical processes and can't be closed by the task manager.


这篇关于我怎么能隐藏我的Windows程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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