ChrisRChamberlain
Programmer
The following code is from a menu procedure and is designed to either create an instance of Word if it is not running, or bring Word to the front if an instance of Word exists.
It works only if Word is not minimised.
Assuming that oWord does not exist, as Word was already running prior to the user running the FoxPro application, what WinAPI call is needed to give Word a normal WindowState?
DECLARE INTEGER BringWindowToTop IN Win32API INTEGER hWnd
lnHand =IsRunning("Word" && Function returns 0 if not running
IF lnHand = 0 && Word not running
[tab]oWord = CREATEOBJECT("Word.Application"
[tab]oDocument = oWord.Documents.Add
[tab]WITH oWord
[tab][tab].Top = 10
[tab][tab].Left = 10
[tab][tab].Height = 200
[tab][tab].Width = 400
[tab][tab].Visible = .T.
[tab]ENDWITH
ELSE
[tab]&& Word running so oWord not used
[tab]&& WinAPI call here?
[tab]BringWindowToTop(lnHand)
ENDIF
TIA
Chris
It works only if Word is not minimised.
Assuming that oWord does not exist, as Word was already running prior to the user running the FoxPro application, what WinAPI call is needed to give Word a normal WindowState?
DECLARE INTEGER BringWindowToTop IN Win32API INTEGER hWnd
lnHand =IsRunning("Word" && Function returns 0 if not running
IF lnHand = 0 && Word not running
[tab]oWord = CREATEOBJECT("Word.Application"
[tab]oDocument = oWord.Documents.Add
[tab]WITH oWord
[tab][tab].Top = 10
[tab][tab].Left = 10
[tab][tab].Height = 200
[tab][tab].Width = 400
[tab][tab].Visible = .T.
[tab]ENDWITH
ELSE
[tab]&& Word running so oWord not used
[tab]&& WinAPI call here?
[tab]BringWindowToTop(lnHand)
ENDIF
TIA
Chris