Using Win32 functions in Visual FoxPro Image Gallery
Window
..msdn
BringWindowToTop
CloseWindow
CreateWindow
CreateWindowEx
DestroyWindow
EndTask
FindWindow
FindWindowEx
GetAncestor
GetClientRect
GetDesktopWindow
GetForegroundWindow
GetGUIThreadInfo
GetParent
GetShellWindow
GetWindow
GetWindowInfo
GetWindowPlacement
GetWindowRect
GetWindowText
GetWindowTextLength
GetWindowThreadProcessId
InternalGetWindowText
IsChild
IsIconic
IsWindow
IsWindowVisible
IsZoomed
MoveWindow
RealGetWindowClass
SetForegroundWindow
SetLayeredWindowAttributes
SetParent
SetWindowPos
SetWindowText
ShowWindow
SwitchToThisWindow
Code examples:
Accessing Adobe Reader 7.0 main menu from VFP application
How to control Adobe Reader 9.0 (SDI mode) from VFP application
SwitchToThisWindow
    Add comment     W32 Constants      Translate this page
The function is called to switch focus to a specified window and bring it to the foreground.
Code examples:
How to control Adobe Reader 9.0 (SDI mode) from VFP application
Accessing Adobe Reader 7.0 main menu from VFP application
Declaration:
VOID SwitchToThisWindow(
    HWND hWnd,
    BOOL fAltTab
);
FoxPro declaration:
DECLARE SwitchToThisWindow IN user32;
    INTEGER hWindow,;
    INTEGER fAltTab
Parameters:
hWnd
[in] Handle to the window being switched to.

fAltTab
[in] A TRUE for this parameter indicates that the window is being switched to using the Alt/Ctl+Tab key sequence.
Return value:
None.
My comment:
Requires Windows XP/2K. You can access this function by using LoadLibrary and GetProcAddress combined in Microsoft Windows versions prior to Windows XP.

MSDN: This function is deprecated and not intended for general use. It is recommended that you do not use it in new programs because it might be altered or unavailable in subsequent versions of Windows.

* * *
To bring the FoxPro window to the front, in VFP version 7+:
DECLARE SwitchToThisWindow IN user32;
        INTEGER hWindow, INTEGER fAltTab
= SwitchToThisWindow(_Screen.HWND, 0)

In older VFP versions:
* save the value on app start
DECLARE INTEGER GetActiveWindow IN user32
hScreen = GetActiveWindow()
* ... later ...
DECLARE SwitchToThisWindow IN user32;
        INTEGER hWindow, INTEGER fAltTab
= SwitchToThisWindow(m.hScreen, 0)
Word Index links for the SwitchToThisWindow :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2005-02-14 16:58:55
Modified: 2005-02-14 17:10:34
Visited in last 7 days: 26
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.91.171.137)
7 sec.Function: 'GetObjectType'
14 sec.Function: 'InternetConnect'
22 sec.Function: 'RegSetValueEx'
30 sec.
Function group: 'Remote Procedure Call (RPC)'
40 sec.Function: 'DrawCaption'
47 sec.
Function group: 'GDI+ ImageAttributes'
56 sec.Function: 'GetRawInputDeviceList'
1.08 min.Function: 'NetWkstaGetInfo'
1.23 min.Function: 'NetJoinDomain'
1.38 min.Function: 'GetPrinter'
Google
Advertise here!