EndTask don't work

  • Thread starter Thread starter Kevin
  • Start date Start date
K

Kevin

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!!!
 
Kevin,

Use DestroyWindows API instead. As you can read in MSDN EndTask is not meant
to be used.

MSDN:
"...However, this function is not intended for general use. It is
recommended that you do not use it in new programs because it might be
altered or unavailable in subsequent versions of Windows. ..."
 
Back
Top