Microsoft KB Archive/162445

= DOC: DECLARE DLL Example Has Incorrect Information =

Article ID: 162445

Article Last Modified on 10/15/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition

-



This article was previously published under Q162445



SUMMARY
The DECLARE - DLL example in Visual FoxPro Help gives the following information about the GetActiveWindow API call:

This example for Windows displays the window handle for the currently active Windows application. When the WAIT window is displayed, you have 5 seconds to press ALT+TAB to switch to a different Windows application, or you can leave Visual FoxPro as the active application.

This gives the impression that the GetActiveWindow API will return a handle for the currently active window. This is wrong. The GetActiveWindow returns only a handle to the Active Window of the calling thread.



MORE INFORMATION
The Win32 API Reference and the Win32API Help file for the GetActiveWindow has the following:

The GetActiveWindow function retrieves the window handle of the active window associated with the thread that calls the function.

HWND GetActiveWindow(VOID)

Parameters

This function has no parameters.

Return Values

If the function succeeds, the return value is the handle of the active window associated with the thread that calls the function. If the calling thread does not have an active window, the return value is NULL.

