probleme de recupération de handle
Bonjour,
Je travaille sur BCB6 sous XP.
Dans mon appli je voudrai lancer une page WEB. puis pouvoir la fermer.
le handle de process que je recupére aprés un shellexecuteex est NULL.
je ne comprend pas pourquoi.
Code ci joint :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| SHELLEXECUTEINFO exe;
void __fastcall TForm1::Button4Click(TObject *Sender)
{
exe.cbSize = sizeof(exe);
exe.fMask = SEE_MASK_NOCLOSEPROCESS;
exe.hwnd = NULL;
exe.lpVerb = "open";
exe.lpFile = "http://www.fipradio.fr/player";
exe.lpParameters = NULL;
exe.lpDirectory = NULL;
exe.nShow = SW_SHOW;
exe.hInstApp = NULL;
ShellExecuteEx(&exe);
}
//-------------------------------------------------------------------------
void __fastcall TForm1::Button5Click(TObject *Sender)
{
if(exe.hProcess)
{ TerminateProcess(exe.hProcess,NULL);
CloseHandle(exe.hProcess);
}
} |
Si quelqu'un peu m'expliquer pourquoi
Cordialement
EricNo