How to hide standalone exe from task list?

£可爱£侵袭症+ 提交于 2019-12-11 19:13:50

问题


I expect to hear from you that this is a bad practice and agree ;)

The only reason to like to do so is to not end with locked files, what would happen if the user kill my process from the Task Manager. Or if you have a better idea, Please do not rush to downvote! As new to programming at all I have not better idea. If you suggest me to re-ask my question in different form, probably will do, but for now I'll gald to get a reply on my question as is.

What am try is to use App.TaskVisible property and set it to False, and did this inside my Sub Main procedure, but that not work.

Bear in mind that am a bit new to VB6 (Thank you in advance for your understanding!) and I try that property for a first time, so I admit that I do something wrong. It's looks so simple and natural to use App.TaskVisible, and I'll glad to tell me how to use it properly.

What I have is a Standard EXE application that has no forms or any interfaces, just perform file i/o operations on the background, nor yet popup any dialogs (if that important), it log errors (if any) to file, so no any user interaction. The app will run standalone form the command prompt or via batch file.

I search a lot about this property, but the only one example I found used this property inside Form_Load event and that make no nonsense and no way to work at all.

I seek as well for any info that say whether this property is depreciated or not, and found nothing. Also seek for any undocumented restrictions, and found nothing too.

Of course, the final goal is the most important, but I'll glad and will appreciate your suggestions in that order:

  1. At best, using App.TaskVisible property.
  2. Any alternative way to do so.
  3. At worst, tell me that this's not possible at all.

If (like or not) the answer is #3, I'll ask about how to prevent locked files, but this will be an separate topic.

Thanks


回答1:


You used to be able to hide an application from the Ctrl+Alt+Del task list in Windows 9x (95 to ME), however that wasn't possible in NT-based Windows versions (which includes all Windows versions since Windows 2000).

If you're worried that files on disk may end up being corrupted if your program is killed in the middle of an I/O operation, you'll probably want to use some form of transactional database. SQLite is great at transactions (it is ACID-compliant).



来源:https://stackoverflow.com/questions/14299760/how-to-hide-standalone-exe-from-task-list

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!