471,310 Members | 1,253 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,310 software developers and data experts.

EndTask don't work

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!!!
Dec 9 '05 #1
1 1740
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. ..."
--
HTH
Stoitcho Goutsev (100) [C# MVP]

"Kevin" <@> wrote in message news:uE**************@TK2MSFTNGP15.phx.gbl...
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!!!

Dec 9 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

303 posts views Thread by mike420 | last post: by
3 posts views Thread by Ken | last post: by
28 posts views Thread by DFS | last post: by
reply views Thread by faktujaa | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.