Test if window hanlde is valid

S

Steve

Is there a way, using the Framework, to determine if a given hWnd is
valid.

In the good ole days (or bad ole days depending on your perspective) I
would have used the Win32 API 'IsWindow(hWnd)'. I know that I can
still do this now with p/invoke but I am wondering if the Framework
provides a similar function.

Thanks,
Steve
 
P

Peter Duniho

Steve said:
Is there a way, using the Framework, to determine if a given hWnd is
valid.

In the good ole days (or bad ole days depending on your perspective) I
would have used the Win32 API 'IsWindow(hWnd)'. I know that I can
still do this now with p/invoke but I am wondering if the Framework
provides a similar function.

No, it doesn't. As window handles are an unmanaged concept, basically
foreign to managed code, you have to use unmanaged code to test for
validity.

Pete
 

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

Top