This excellent code is borrowed from Mike Lewis for cycling through MS windows in VFP (which Ramani kindly discovered for me).
I'm trying to make a VFP function suspend running (i.e., in the DOWHILE LOOP) until the user closes the Outlook Appointment (Inspector) Window.
Any help is appreciated in advance.
*********************************************************
DECLARE INTEGER GetActiveWindow IN Win32API
DECLARE INTEGER GetWindow IN Win32API INTEGER hWnd, INTEGER nType
DECLARE INTEGER GetWindowText IN Win32API INTEGER hWnd, STRING @cText, INTEGER nType
DECLARE INTEGER BringWindowToTop IN Win32API INTEGER hWnd
lnHand = IsRunning("- Appointment"
&&Outlook Appointment Window
DO WHILE lnHand <> 0
BringWindowToTop(lnHand)
ENDDO
*********************************************************
FUNCTION IsRunning &&Denotes if a WINDOW (title) is running &&eg. "- Visit" for outlook inspector
LPARAMETER tcTitle &&Parameter is all or part of the window's title.
hNext = GetActiveWindow() && current app's window
DO WHILE hNext<>0 && iterate through the open windows
cText = REPLICATE(CHR(0),80)
GetWindowText(hNext,@cText,80) && get window title
IF UPPER(ALLTRIM(tcTitle)) $ UPPER(cText) && parameter text is present in window title
RETURN hNext
ENDIF
hNext = GetWindow(hNext,2) && next window
ENDDO
RETURN 0 && required window not found
ENDFUNC
This excellent code is borrowed from Mike Lewis for cycling through MS windows in VFP (which Ramani kindly discovered for me).
I'm trying to make a VFP function suspend running (i.e., in the DOWHILE LOOP) until the user closes the Outlook Appointment (Inspector) Window.
Any help is appreciated in advance.
*********************************************************
DECLARE INTEGER GetActiveWindow IN Win32API
DECLARE INTEGER GetWindow IN Win32API INTEGER hWnd, INTEGER nType
DECLARE INTEGER GetWindowText IN Win32API INTEGER hWnd, STRING @cText, INTEGER nType
DECLARE INTEGER BringWindowToTop IN Win32API INTEGER hWnd
lnHand = IsRunning("- Appointment"
&&Outlook Appointment Window
DO WHILE lnHand <> 0
BringWindowToTop(lnHand)
ENDDO
*********************************************************
FUNCTION IsRunning &&Denotes if a WINDOW (title) is running &&eg. "- Visit" for outlook inspector
LPARAMETER tcTitle &&Parameter is all or part of the window's title.
hNext = GetActiveWindow() && current app's window
DO WHILE hNext<>0 && iterate through the open windows
cText = REPLICATE(CHR(0),80)
GetWindowText(hNext,@cText,80) && get window title
IF UPPER(ALLTRIM(tcTitle)) $ UPPER(cText) && parameter text is present in window title
RETURN hNext
ENDIF
hNext = GetWindow(hNext,2) && next window
ENDDO
RETURN 0 && required window not found
ENDFUNC
Philip M. Traynor, DPM
I'm trying to make a VFP function suspend running (i.e., in the DOWHILE LOOP) until the user closes the Outlook Appointment (Inspector) Window.
Any help is appreciated in advance.
*********************************************************
DECLARE INTEGER GetActiveWindow IN Win32API
DECLARE INTEGER GetWindow IN Win32API INTEGER hWnd, INTEGER nType
DECLARE INTEGER GetWindowText IN Win32API INTEGER hWnd, STRING @cText, INTEGER nType
DECLARE INTEGER BringWindowToTop IN Win32API INTEGER hWnd
lnHand = IsRunning("- Appointment"

DO WHILE lnHand <> 0
BringWindowToTop(lnHand)
ENDDO
*********************************************************
FUNCTION IsRunning &&Denotes if a WINDOW (title) is running &&eg. "- Visit" for outlook inspector
LPARAMETER tcTitle &&Parameter is all or part of the window's title.
hNext = GetActiveWindow() && current app's window
DO WHILE hNext<>0 && iterate through the open windows
cText = REPLICATE(CHR(0),80)
GetWindowText(hNext,@cText,80) && get window title
IF UPPER(ALLTRIM(tcTitle)) $ UPPER(cText) && parameter text is present in window title
RETURN hNext
ENDIF
hNext = GetWindow(hNext,2) && next window
ENDDO
RETURN 0 && required window not found
ENDFUNC
This excellent code is borrowed from Mike Lewis for cycling through MS windows in VFP (which Ramani kindly discovered for me).
I'm trying to make a VFP function suspend running (i.e., in the DOWHILE LOOP) until the user closes the Outlook Appointment (Inspector) Window.
Any help is appreciated in advance.
*********************************************************
DECLARE INTEGER GetActiveWindow IN Win32API
DECLARE INTEGER GetWindow IN Win32API INTEGER hWnd, INTEGER nType
DECLARE INTEGER GetWindowText IN Win32API INTEGER hWnd, STRING @cText, INTEGER nType
DECLARE INTEGER BringWindowToTop IN Win32API INTEGER hWnd
lnHand = IsRunning("- Appointment"

DO WHILE lnHand <> 0
BringWindowToTop(lnHand)
ENDDO
*********************************************************
FUNCTION IsRunning &&Denotes if a WINDOW (title) is running &&eg. "- Visit" for outlook inspector
LPARAMETER tcTitle &&Parameter is all or part of the window's title.
hNext = GetActiveWindow() && current app's window
DO WHILE hNext<>0 && iterate through the open windows
cText = REPLICATE(CHR(0),80)
GetWindowText(hNext,@cText,80) && get window title
IF UPPER(ALLTRIM(tcTitle)) $ UPPER(cText) && parameter text is present in window title
RETURN hNext
ENDIF
hNext = GetWindow(hNext,2) && next window
ENDDO
RETURN 0 && required window not found
ENDFUNC
Philip M. Traynor, DPM