16,004,227 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Stefan Erler (Top 3 by date)
Stefan Erler
1-May-15 13:40pm
View
Yes for all othe process it works -.-
here you see i tried with pskill, and taskkill and you see the process with PID in the TaskManager... But thanks again for your help.
image
Stefan Erler
1-May-15 13:01pm
View
Ah ok Thanks now i know what you mean... OK i try this only with System.Diagnostics.Process class. But i think that’s not the problem, but i will try it!
I can kill it with the Task Manager, that’s why i'm not sure why not with Process.Kill.
Thank you for the links
i will try every think and let you know tomorrow
[Edit]
When i use psKill in Admin cmd i also get Access denied
Stefan Erler
1-May-15 11:58am
View
First thank you for you Answer!
I don’t know that you mean with P/Invoke, I didn’t use it.
At first I just tried get the Process and then call the Process.Kill(), the other stuff is just from trying to find a way…
I find the process by find the window like this:
[DllImport("USER32.DLL", CharSet = CharSet.Unicode)]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
public IntPtr KalGestartet ()
{
return FindWindow("#32770", "KalOnline");
}
and pass the IntPtr to the KillKal Method if it’s not IntPtr.Zero.
And as I say the PID I get is the same as I see in the Task Manager, if I kill this with Task Manager the game is closing. So it should be the same, right?
I Run VisualStudio "as administrator", so the Program also do.
I know you should not do it, but it’s necessary because the game is kind of buggy and you can only close it with Task Manager. That’s why I need this program…
Thank you again.