A | B | C |  D | E | F |  G | H | I |  J | K | L |  M | N | O |  P | Q | R |  S | T | U |  V | W | X |  Y | Z



GetForegroundWindow

The GetForegroundWindow function returns the handle of the foreground window (the window with which the user is currently working). The system assigns a slightly higher priority to the thread that creates the foreground window than it does to other threads.

VB4-32,5,6
Declare Function GetForegroundWindow Lib "user32" Alias "GetForegroundWindow" () As Long

VB.NET
System.Windows.Forms.Form.ActiveForm

Operating Systems Supported
Requires Windows NT 3.1 or later; Requires Windows 95 or later

Library
User32

Return Values
The return value is the handle of the foreground window.

Last update: 07 April 2006