| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| Managed C++ and C++/CLI Discuss Managed C++ and .NET-specific questions related to C++. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Closing a program
hii
can anybody tell me how can ı close any program(for example:winamp) from my project? means from my c++.net project. |
|
#2
|
|||
|
|||
|
Using API in Visual Basic i have retrived all the runnig windows then after getting handle of that window i have passed virtual key events i.e. sendkey. These keyevents could be used to close the window too. Otherwise its difiicult to get hold of any third party tool or application if they dont provide its API or library to work on.
Regards PS |
|
#3
|
|||
|
|||
|
Re: Closing a program
thank you for your response
can u give an example or say any kind of function ı can use in my project? |
|
#4
|
||||
|
||||
|
Re: Closing a program
Find the process and kill it.
Code:
System::Diagnostics::Process* p[] = System::Diagnostics::Process::GetProcessesByName( S"Winamp" );
for( int i = 0; i < p->Count; i++ ) {
p[i]->Kill( );
}
__________________
"Lose it? It means go crazy...nuts...insane...bonzo...no longer in possession of one's faculties...3 fries short of a happy meal...WACKO!!!" |
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|