Skip to content

Latest commit

 

History

History
128 lines (107 loc) · 7.84 KB

GetActiveWindow.md

File metadata and controls

128 lines (107 loc) · 7.84 KB

Home

Function name : GetActiveWindow

Group: Keyboard Input - Library: user32


The GetActiveWindow function retrieves the window handle to the active window attached to the calling thread"s message queue.


Code examples:

Testing Clipboard functions: emptying the clipboard
Who owns the Windows Clipboard
Who is the first in viewing the Clipboard
Printing text on the client area of the main VFP window
Printing text on the main VFP window
Using GetNearestColor
Using the MessageBox Win32 function
Obtaining window class name for the main VFP window
Creating a window using CreateWindowEx function
Using InternetGoOnline function
Comparing dimensions of the VFP main window with _SCREEN properties
Placing an arbitrary rectangular area of main VFP window on the Clipboard
Locking mouse and keyboard input for the VFP application
GetFocus returns a HWND value
How to copy the image of a form to the Clipboard using Bitmap API functions
Retrieving information about the main VFP window
FindText -- the hopeless and useless Common Dialog
Storing content of the Clipboard to a bitmap file
Retrieving Window Class information for the VFP window
Drawing icons associated with the VFP main window
Drawing cursors for the classes defined by the system (preregistered): BUTTON, EDIT, LISTBOX etc.
Retrieving long values associated with the class of the VFP window
Using IsChild() for testing ThisForm.ShowWindow property
Using the LoadImage function to have a bitmap file loaded and displayed on VFP main window
How to print a bitmap file
How to make the caption of a VFP application flashing in the Windows task bar
Obtaining the bounding rectangle for the specified device context
Drawing a window caption using the DrawCaption routine
Terminating all running applications from a VFP program
Minimizing all running applications
Confining Windows calculator inside the VFP main window
Drawing Windows predefined bitmaps using the LoadBitmap functions
Drawing Windows frame controls using the DrawFrameControl function
Drawing a rectangle using Windows regular edges and borders
Scanning the hierarchy of child windows down from the main VFP window
Using the ChooseColor function
Creating the Save dialog box to specify the drive, directory, and name of a file to save
The window and its ancestors
Using FlashWindowEx to flash the taskbar button of the VFP application
Sending a standard message with one or more attached files using default email client
Getting a bit more than the _CLIPTEXT offers
Setting the mouse capture to the specified window
Establishing connection using the SQLDriverConnect
Displaying bitmap using the AlphaBlend function
Splash Screen for the VFP application
Bitmap Class for Visual FoxPro application
Using the DrawText function
Using Font and Text functions
Using the IsWindowEnabled function
Starting a dialog box for connecting to network resources (mapping network drive)
Initiating Inet connection using a modem
How to display the Properties dialog box for a file (ShellExecuteEx)
Deleting files into the Recycle Bin
Reading the structure of VFP main menu
Reading metrics for the currently selected font
How to put a horizontal text scrolling on the form (a news line, marquee)
Using the GradientFill function
How to put a vertical text scrolling on the form (a movie cast)
Using the RestartDialog function -- restarting Windows
How to display the port-configuration dialog box for a port on the specified server
Creating the Open dialog box to specify the drive, directory, and name of a file to open
Displaying system dialog that selects a folder
Creating an Open dialog box to specify the drive, directory, and name of a file to open (Shell32 version)
Displaying printer-properties Property Sheet for the specified printer
How to browse and connect to printers on a network (WinNT)
How to display a dialog box with which the user can add a data source (DSN)
Adding an ODBC data source with the SQLConfigDataSource; use automatic or interactive mode
Configuring DEVMODE structure for a printer
How to display picture stored in enhanced-format metafile (*.emf)
How to print picture stored in enhanced-format metafile (*.emf)
Simple MAPI: how to pick an email recipient from Outlook Express address book
Form Magnifier
Extended MessageBox Class
How to play AVI file on the _screen
How to change the name and the size of the font in the MessageBox dialog
How to position the GETPRINTER() dialog
How to remove a directory that is not empty

Declaration:

HWND GetActiveWindow(VOID)  

FoxPro declaration:

DECLARE INTEGER GetActiveWindow IN user32
  

Parameters:

This function has no parameters.


Return value:

The return value is the handle to the active window attached to the calling thread"s message queue. Otherwise, the return value is NULL.


Comments:

For a VFP application you always have this function pointing to the main VFP window.

To get the handle to the foreground window, you can use GetForegroundWindow.

Windows 98/Me and Windows NT 4.0 SP3 and later: To get the window handle to the active window in the message queue for another thread, use GetGUIThreadInfo.

Starting with version 7th the Visual FoxPro includes window handle in standard properties of the Form object.

See also: GetFocus, GetForegroundWindow, SwitchToThisWindow