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. ..."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top