GetFocus Reference in C#, VB.NET and VB6
Visual Basic 6 definition
Visual Basic 6 example source code
Declare Function GetFocus Lib "user32.dll" () As Long
Visual Basic .NET definition
Declare Function GetFocus Lib "user32" () As Integer
public static extern int GetFocus(int hwnd)
GetFocus obtains a handle to the window in the calling thread that has the input focus. If another program has the input focus, however, this function will not work and will report an error.
Retrieves the handle to the window that has the keyboard focus.
If successful, the function returns a handle to the window that has the input focus. If an error occured, or if another program has the input focus, the function returns zero (use GetLastError to get the error code).
For further information on Windows API functions such as these, and how to use these API's in your
C# and VB.NET applications, please refer to the book 'Network programming in .NET' (Buy at Amazon UK)
(Buy at Amazon US)
C# example source code
Provide a code example
Copyright 2015 Open Merchant Account Ltd.