Windows API Guide: Rectangle Function


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

Platforms: Win 32s, Win 95/98, Win NT

SetActiveWindow makes a given window the active window for the program, giving it the focus. This window only becomes the foreground window if the application which owns it is the currently active program. This function can only be used on windows which the program owns. This function should be used carefully, since the user normally does not expect the active window to change unexpectedly. The function returns 1 if successful, or 0 if an error occured.

hwnd
A handle to the window to set as the active window.

Example:

' Make the window Form1 the active window for the program.  Note that ' this function will not make the window the foreground window if the user is currently ' working with a separate program. Dim retval As Long  ' return value retval = SetActiveWindow(Form1.hWnd)  ' set Form1 as the application's active window

See Also: GetActiveWindow, SetForegroundWindow
Category: Windows

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


This page is copyright © 2000 Paul Kuliniewicz. Copyright Information.
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/s/setactivewindow.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