EndTask don't work

09/12/2005 - 19:27 por Kevin | Informe spam
Hi
I'm using EnumWindows (User32.dll) function to get all currently open
windows and fill a ListView. Then I want to close the selected windows using
EndTask(IntPtr hwnd) or EndTask(IntPtr hwnd, bool fShutDown, bool fForce)
(User32.dll) but always return false and not close de window. Does anybody
know how to close a window having the HWND ?
I tryied first with CloseWindow but always return false too.

Thanks!!!
 

Leer las respuestas

#1 Marino Posadas
18/12/2005 - 22:56 | Informe spam
Hi Kevin

What about sending a SendMessage(hWnd, WM_CLOSE, ...) message? It'd be less
straight, allowing the system to deny the petition in case it's closing
would'nt be suitable...


Saludos cordiales
Marino Posadas
MVP Visual C#

www.ElAveFenix.net


"Kevin" <@> escribió en el mensaje
news:%23atfV4O$
Hi
I'm using EnumWindows (User32.dll) function to get all currently open
windows and fill a ListView. Then I want to close the selected windows
using
EndTask(IntPtr hwnd) or EndTask(IntPtr hwnd, bool fShutDown, bool fForce)
(User32.dll) but always return false and not close de window. Does anybody
know how to close a window having the HWND ?
I tryied first with CloseWindow but always return false too.

Thanks!!!


Preguntas similares