Hello - I copied the following code from a Microsoft article, put in activate on a page in one of my forms and when I click on that page my CPU usage jumps to 100% and stays there. Is there something wrong with this code - or my app!?
oOutlookObj = CREATEOBJECT("Outlook.Application")
oNamespace = oOutlookObj.GetNamespace("MAPI")
oFolder = oNamespace.GetDefaultfolder(6) && See below for other values
oFolder.Display
* Code to pause FoxPro while Outlook window is on top
IF NOT 'FOXTOOLS' $ SET('LIBRARY')
SET LIBRARY TO SYS(2004)+"FoxTools"
ENDIF
FoxWind = MAINHWND()
GetActive=RegFn('GetActiveWindow','','I') && Determine if FoxPro is
&& on top
DO WHILE .T. && Keep looping until the ActiveWindow = FoxWind
IF FoxWind = CallFn(GetActive)
EXIT
ENDIF
ENDDO
SET LIBRARY TO
oOutlookObj.Quit
oOutlookObj = CREATEOBJECT("Outlook.Application")
oNamespace = oOutlookObj.GetNamespace("MAPI")
oFolder = oNamespace.GetDefaultfolder(6) && See below for other values
oFolder.Display
* Code to pause FoxPro while Outlook window is on top
IF NOT 'FOXTOOLS' $ SET('LIBRARY')
SET LIBRARY TO SYS(2004)+"FoxTools"
ENDIF
FoxWind = MAINHWND()
GetActive=RegFn('GetActiveWindow','','I') && Determine if FoxPro is
&& on top
DO WHILE .T. && Keep looping until the ActiveWindow = FoxWind
IF FoxWind = CallFn(GetActive)
EXIT
ENDIF
ENDDO
SET LIBRARY TO
oOutlookObj.Quit