Click to See Complete Forum and Search --> : Closing a program


amgturk
July 11th, 2005, 07:00 AM
hii

can anybody tell me how can ı close any program(for example:winamp) from my project? means from my c++.net project.

pranavsharma
July 11th, 2005, 07:12 AM
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

amgturk
July 11th, 2005, 07:17 AM
thank you for your response
can u give an example or say any kind of function ı can use in my project?

Jinto
July 14th, 2005, 08:08 PM
Find the process and kill it.

System::Diagnostics::Process* p[] = System::Diagnostics::Process::GetProcessesByName( S"Winamp" );
for( int i = 0; i < p->Count; i++ ) {
p[i]->Kill( );
}