BringWindowToTop Function

Declare Function BringWindowToTop Lib "user32.dll" (ByVal hwnd As Long) As Long

Platforms

Description & Usage

BringWindowToTop brings a specified window to the top of the Z-order, placing it above any windows previously on top of it. This function has the same effect as using SetWindowPos to place the window at the top of the Z-order.

Return Value

If an error occured, the function returns 0 (use GetLastError to get the error code). If successful, the function returns a non-zero value.

Visual Basic-Specific Issues

None

Parameters

hwnd
A handle to the window to bring to the top of the Z-order.

Example

' Bring the window Form1 to the top of the Z-order.
Dim retval As Long  ' return value

' Obviously, this will only do something if other windows are already on top of Form1.
retval = BringWindowToTop(Form1.hWnd)

Related Function

SetWindowPos

Category:

Windows

Back to the index.


Last Modified: July 28, 1999
This page is copyright © 1999 Paul Kuliniewicz. Copyright Information

Go to Paul Kuliniewicz's Home Page.
E-mail: rogue953@hotmail.com
This page is at http://skyscraper.fortunecity.com/transmission/45/api/b/bringwindowtotop.html