Test if window hanlde is valid

  • Thread starter Thread starter Steve
  • Start date Start date
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
 
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
 
Back
Top