Paul, As with all VFP objects their visibility is not set until you set them to be visible. This has caught me out a number of times when I thought that the object had not been created correctly so you need to set the .Visible property on in the init. Control the actual on screen visibility via the ShowWindow property of the form and Windowstate property.
Dave
-----Original Message----- From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of Paul Newton Sent: 21 September 2017 14:35 To: profox@leafe.com Subject: RE: Focus not returning to command window after CreateObject
Good thinking Tracy
Excel does not bring up its UI until you explicitly make it visible.
Stopwatch does not have a UI until, after o = CreateObject("Stopwatch.Stopwatch") when you issue o.Start()
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Tracy Pearson Sent: 21 September 2017 14:31 To: profoxtech@leafe.com Subject: RE: Focus not returning to command window after CreateObject
Does Stopwatch bring up a UI and Excel does not?
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Paul Newton Sent: Thursday, September 21, 2017 9:27 AM To: profoxtech@leafe.com Subject: RE: Focus not returning to command window after CreateObject
No and no ...
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Alan Bourke Sent: 21 September 2017 14:15 To: profoxtech@leafe.com Subject: Re: Focus not returning to command window after CreateObject
Is the Init() in stopwatch.exe waiting for something?
Is CreateObjectEx() any different ?
-- Alan Bourke alanpbourke (at) fastmail (dot) fm
On Thu, 21 Sep 2017, at 01:58 PM, Paul Newton wrote:
Hi all
In the command window if I run the command o = CreateObject("Excel.Application"), an instance of Excel is created and focus returns to the command window.
If I run the command o = CreateObject("Stopwatch.Stopwatch"), an instance of my stopwatch (in Stopwatch.EXE) is created but focus does NOT return to the command window.
Any ideas? TIA
Paul Newton
[excessive quoting removed by server]