Thanks for your reply...
I am getting handle also..
And i have tried to get control(my aim is to minimise ) over the windows which is currently running(Eg IE,OUtlook,VC editor.. like ).. The code i have done
HANDLE hproc=(HANDLE)CreateToolhelp32Snapshot (TH32CS_SNAPPROCESS,0);
PROCESSENTRY32 pentry;
Process32First(hproc,&pentry);
HANDLE htemp;
HWND m_hactive;
while (Process32Next(hproc,&pentry))
{
HANDLE ps = OpenProcess( SYNCHRONIZE|PROCESS_TERMINATE,
FALSE,pentry.th32ProcessID);
m_hactive=(HWND)htemp;//This i have done for converting handle to hwnd.. I dont no whether it is correct
:: ShowWindow(m_hactive,SW_FORCEMINIMIZE)/*i did this first to minimising all Windows.. But does not work.*/
::TerminateProcess(htemp,GetExitCodeProcess(htemp, &tmpstr));
CloseHandle(ps)
}