Windows API Guide: HELPWININFO Structure


Declare Function IsWindow Lib "user32.dll" (ByVal hWnd As Long) As Long

Platforms

  • Windows 95: Supported.
  • Windows 98: Supported.
  • Windows NT: Requires Windows NT 3.1 or later.
  • Windows 2000: Supported.
  • Windows CE: Requires Windows CE 1.0 or later.

Desctiption & Usage

IsWindow determines if a given handle refers to a window or not. The function verifies that the handle in fact refers to a window, instead of one of the many other objects which handles can represent.

Return Value

If the handle does not refer to a window, the function returns 0. If the handle does refer to a window, the function returns a non-zero value.

Visual Basic-Specific Issues

None.

Parameters

hWnd
The handle to check if it refers to a window or not.

Example

' This code is licensed according to the terms and conditions listed here. ' Demonstrate handles refering to a window and not refering to a window. Dim hWindow As Long  ' handle to a window (Form1, to be exact) Dim hPen As Long  ' handle to a pen (the solid black stock pen) Dim result As Long  ' result of the test ' Initialize the two handles. hWindow = Form1.hWnd  ' hWindow now equals window Form1's handle hPen = GetStockObject(BLACK_PEN)  ' hPen refers to a pen ' Verify that hWindow refers to a window. result = IsWindow(hWindow) If result = 0 Then   Debug.Print "hWindow does not refer to a window."  ' won't happen Else   Debug.Print "hWindow refers to a window."  ' will happen End If ' Verify that hPen does not refer to a window. result = IsWindow(hPen) If result = 0 Then   Debug.Print "hPen does not refer to a window."  ' will happen Else   Debug.Print "hPen refers to a window."  ' won't happen End If

See Also

IsChild

Category

Windows

Go back to the alphabetical Function listing.
Go back to the Reference section index.


Last Modified: August 1, 1999
This page is copyright © 1999 Paul Kuliniewicz. Copyright Information Revised October 29, 2000 Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/i/iswindow.html



Windows API Guide
Windows API Guide - Reference - Volume 1: Version 3.0 For the MS-DOS and PC-DOS Operating Systems
ISBN: B001V0KQIY
EAN: N/A
Year: 1998
Pages: 610

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net