-
April 25th, 2020, 11:06 AM
#1
There is possible to safety kill a process by word?
Every one knows that when you work on Windows and you make a persistent process with C++ it will hurt your machine if you kill him on task manager. Creating temp trash and maybe it corrupts the memory or the disk in long term (tested and approved by me.)
Ok... a persistant process is part of the game, but i must close it in safe mode.
I could wait for a pressed key but that is not an option.
I would like to use a secret word, so here is is my question.
There is posible to read from the keyborad a fast concatenation or a complete message like "secretwordwichstopprocess"
I think, validate char by char could be a little unperforming.
I Usually use GetAsyncState but somebody told me something about PreTranslateMessage could be better.
... is this posible?
-
April 26th, 2020, 05:00 AM
#2
Re: There is possible to safety kill a process by word?
Please explain:
>> Every one knows that when you work on Windows and you make a persistent process with C++ it will hurt your machine if you kill him on task manager.
What is a 'persistent process?' How will killing a process 'hurt your machine?'
-
April 26th, 2020, 05:26 AM
#3
Re: There is possible to safety kill a process by word?
Re processes. There are basically/simply 2 types:
1) User process. These are either started automatically when a user logs on directly by the user
2) System service. These are started automatically by the OS when the system is started. Their state can be stopped/started etc.
For each of these types, they can be either user-produced from available source code (which can be amended and compiled) or part of the OS or part of an installed 'application'.
What type of 'process' are we talking about here?
Last edited by 2kaud; April 28th, 2020 at 03:34 AM.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
April 27th, 2020, 08:42 PM
#4
Re: There is possible to safety kill a process by word?
2kaud, Windows has only one type of process regardless of whether it's invoked by a user, user code, or the service control manager. Windows services expose additional functionality that the SCM hooks into but when they are started they are created and run like any other process.
-
April 28th, 2020, 03:39 AM
#5
Re: There is possible to safety kill a process by word?
Originally Posted by Arjay
2kaud, Windows has only one type of process regardless of whether it's invoked by a user, user code, or the service control manager. Windows services expose additional functionality that the SCM hooks into but when they are started they are created and run like any other process.
Yes - perhaps I was being too simplistic in my post #3 in the context of the question asked.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|