Home > Software engineering >  I want to practice with code to terminate a process, but...
I want to practice with code to terminate a process, but...

Time:10-08

The following is part of the code:
 BOOL TerminateProcessFromld (DWORD DWLD)//here need to enter a; ? 
{
BOOL bRet=FALSE;
HANDLE hProcess=: : OpenProcess (POCESS_ALL_ACCESS, FALSE, DWLD);//it is replace DWLD with an ID number is ok?
If (hProcess!=NULL)
{
//termination process
BRet=: : the TerminateProcess (hProcess, 0);

}
The CloseHandle (hProcess);
Return bRet.
}

When the small white in the compiler to knock:

# include
# include

Int main (int arg c, char * argv [])
{
//BOOL TerminateProcessFromld (DWORD DWLD);
BOOL TerminateProcessFromld (DWORD DWLD)
{//why there is an error here, tip error: should input; ? Don't understand the
BOOL bRet=FALSE;
HANDLE hProcess=: : OpenProcess (PROCESS_ALL_ACCESS, FALSE, DWLD);
If (hProcess!=NULL)
{
BRet=: : the TerminateProcess (hProcess, 0);
}
The CloseHandle (hProcess);
Return bRet.
}
}

CodePudding user response:

If (hProcess!=NULL)

The inside!=as a whole, you can't! And=plus a space in the middle

CodePudding user response:

Here again, POCESS_ALL_ACCESS spelt wrong, should be PROCESS_ALL_ACCESS

CodePudding user response:

BOOL TerminateProcessFromld (DWORD DWLD) this function how to implement in the main function?

CodePudding user response:

Try to use simple PostMessage WM_CLOSE way he can close. Generally I preferred, close the other processes to itself in its own way to close if not only
The TerminateProcess

CodePudding user response:

Int main (int arg c, char * argv [])
In defining a BOOL TerminateProcessFromld (DWORD DWLD)?
Put the main outer

CodePudding user response:

The main function in a nested function? BOOL TerminateProcessFromld (DWORD DWLD) on the outside, the main function call TerminateProcessFromld function,

CodePudding user response:

This is all you grammar mistakes ~

CodePudding user response:

Code cannot be nested,

CodePudding user response:

About whether he is suitable for programming is very simple test:
On a newspaper or magazine articles, for a period of about 1000 words in Word input again, after losing to refer to the following answer:

A. there are more than 10 words or punctuation
B there is no words or punctuation mistakes and dare to bet for this
No words or punctuation errors and C fonts and layout fully consistent with the original
D print on the translucent paper and check the same original overlap, and feel very with a sense of accomplishment

A is not suitable for programming (reason: typing accuracy is low, careless)
B junior programmer (reason: typing accuracy high, careful and meticulous, confident, understand the whole Angle of half Angle concept)
C senior programmer (reason: in the B on the basis of understanding the font and layout is also an important factor of computer to print, but compared to D paranoid enough, strives for perfection, the results can verify)
D software project manager (reason: to be able to give convincing for project detailed requirements to the pole and typical test cases, users almost pick is not at fault, major!)

If want to from A to B, to my resources http://download.csdn.net/detail/zhao4zhong1/4084259 download "for programmers keyboard practice"

CodePudding user response:

references 9 f zhao4zhong1 response:
about whether he is suitable for programming is very simple test:
On a newspaper or magazine articles, for a period of about 1000 words in Word input again, after losing to refer to the following answer:

A. there are more than 10 words or punctuation
B there is no words or punctuation mistakes and dare to bet for this
No words or punctuation errors and C fonts and layout fully consistent with the original
D print on the translucent paper and check the same original overlap, and feel very with a sense of accomplishment

A is not suitable for programming (reason: typing accuracy is low, careless)
B junior programmer (reason: typing accuracy high, careful and meticulous, confident, understand the whole Angle of half Angle concept)
C senior programmer (reason: in the B on the basis of understanding the font and layout is also an important factor of computer to print, but compared to D paranoid enough, strives for perfection, the results can verify)
D software project manager (reason: to be able to give convincing for project detailed requirements to the pole and typical test cases, users almost pick is not at fault, major!)

If want to from A to B, to my resources http://download.csdn.net/detail/zhao4zhong1/4084259 download "for programmers keyboard practice"

A: you are not suitable for programming, but very suitable for hiring A group of programmers for you to move bricks.
B: you are programming, but is very suitable for a product manager. Because no matter how your product, you have to learn to blow force and others say no problem.
C: what do you do for a programmer, the most helpless pain, gas by dogs and all kinds of products test meow, earned a little by serving as moving bricks for the family, come on, welcome, SAO years!
D: I'm sorry, you may be entered into, would you come to apply for a typist?

CodePudding user response:

references to the tenth floor imagebreaker response:
Quote: references 9 f zhao4zhong1 response:

About whether he is suitable for programming is very simple test:
On a newspaper or magazine articles, for a period of about 1000 words in Word input again, after losing to refer to the following answer:

A. there are more than 10 words or punctuation
B there is no words or punctuation mistakes and dare to bet for this
No words or punctuation errors and C fonts and layout fully consistent with the original
D print on the translucent paper and check the same original overlap, and feel very with a sense of accomplishment

A is not suitable for programming (reason: typing accuracy is low, careless)
B junior programmer (reason: typing accuracy high, careful and meticulous, confident, understand the whole Angle of half Angle concept)
C senior programmer (reason: in the B on the basis of understanding the font and layout is also an important factor of computer to print, but compared to D paranoid enough, strives for perfection, the results can verify)
D software project manager (reason: to be able to give convincing for project detailed requirements to the pole and typical test cases, users almost pick is not at fault, major!)

If want to from A to B, to my resources http://download.csdn.net/detail/zhao4zhong1/4084259 download "for programmers keyboard practice"

A: you are not suitable for programming, but very suitable for hiring A group of programmers for you to move bricks.
B: you are programming, but is very suitable for a product manager. Because no matter how your product, you have to learn to blow force and others say no problem.
C: what do you do for a programmer, the most helpless pain, gas by dogs and all kinds of products test meow, earned a little by serving as moving bricks for the family, come on, welcome, SAO years!
D: I'm sorry, you may be entered into, would you come to apply for a typist?

ideal is very plentiful, reality is very skinny,