Put this code block after the form call in the top level form :-
DO FORM MYFORM
declare integer FindWindow in USER32.dll integer, string
declare integer SetForegroundWindow in User32.dll Integer
WindowTitle=chr(34)+alltrim(thisform.caption)+chr(34)
winHandle = FindWindow(0,&WindowTitle)
if winHandle > 0
SetForegroundWindow(winHandle)
endif
I use this across all my applications and it worlks a treat !
On Fri, 22 Apr 2016, at 10:39 PM, Tracy Pearson wrote:
> Mike Copeland wrote on 2016-04-21:
> > All,
> >
> > I have that "seen it before" nagging feeling about this problem...that
> > I've seen the problem discussed here but I haven't located any answers.
> >
> > I have a form set as "As Top-Level Form"
> > I have a second, modal form, set as "In Top-Level Form"
> >
> > After closing the second, modal form with close button on the second
> > form, the close button on the Top-Level Form is not clickable (dimmed
> > out) so you can't click it and shut the program down.
> >
> > But if you click "somewhere else" on the desktop, anywhere other than
> > the Top-Level Form of the Foxpro VFP9 SP2 application, then you CAN
> > click back on the Top-Level form and the close button is bright red and
> > can now be clicked and the program closes.
> >
> > What in the heck is causing that and more important what is the
> workaround?
> >
> > Thanks for any advice!
> >
> > Mike Copeland
> >
>
> Mike,
>
> I'm unable to reproduce the behavior you speak of. I know I've heard it.
> I don't work with that many top-level projects that have modal dialogs.
> I have 1, and customers have not complained about it.
> VFP 9 SP 1 - multiple OS's
> Just tested a small project VFP 9 SP 2 patched to 7423 on Windows 8. I'm
> not
> seeing the behavior.
>
> Tracy Pearson
> PowerChurch Software
>
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.