Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Pete Sass
  Where is Pete Sass?
 Marathon, Ontario
 Canada
 Pete Sass
 To: Koen Piller
  Where is Koen Piller?
 Santpoort-Zuid
 Netherlands
 Koen Piller
 Tags
Subject: RE: VFP Window To Front of Any Application
Thread ID: 394021 Message ID: 394026 # Views: 73 # Ratings: 1
Version: Visual FoxPro 9 SP2 Category: Forms
Date: Saturday, December 28, 2013 9:50:17 PM         
   


> > Hi Foxitains,
> >
> > This has probably been asked before, but I wanted to pass this off to you all.
> >
> > Here is what I have.
> >
> > A top-level-form that by default can only be non-model. This form loads up and is the starting off main
> > form for my application that does some QuickBooks integration routines.
> >
> > So if QuickBooks is running and especially running full screen my application comes up under the
> > QuickBooks application and cannot be seem.
> >
> > If I set my main VFP form to AlwaysOnTop = .T. my issue is resolved, however read on.
> > From my main form I am calling a couple of other forms also as top-level-forms. Now these
> > come up under my main form and I want them on top of my main form and setting them AlwaysOnTop = .T.
> > does not always seem to work.
> >
> > So to get my secondary top-level-forms to appear above my main top-level-form my main form had
> > to be set as AlwaysOnBottom = .T.
> >
> > I added the below code into the Activate event of my main top-level form:
> >
DECLARE BringWindowToTop IN WIN32API as TopWindow long 
> > TopWindow(Thisform.HWnd)

> > and yes this pushes my main form to the front and bumps it up on top of the already running
> > QuickBooks main application screen.
> >
> > Not sure if anyone else ever ran into my unique combination of forms, but the API does
> > it's work for me.
> >
> > Pete "the IceMan", from the Great White North of Canada.
> > www.marathongriffincomputers.com
>
>
> Hi,
> I am puzzled, you have a mainform which you run as top-level form so assume you have set ShowWindow = 2
> Now you have activated an API call to ensure your window will be remain visible.
> But why do you instantiate other forms also with ShowWindow = 2 ?? For me this is not done, I always have only one form with ShowWindow = 2, other forms I would like users to be ensured to see I set ShowWindow = 1, is that not what you are supposed to do?
>
> Regards,
>
> Koen


Hi Koen,

QUESTION: But why do you instantiate other forms also with ShowWindow = 2 ??
ANSWER : I did not in this specific example, but windows of other applications running
such as QuickBooks Accounting are on top and they are set to run on top so my VFP window
although launched second does not appear on top. I want my VFP main top-level form to pop up on
top of another totally different application that is running.

This is a highly complex integration system so very hard to explain as to why things are done
certain ways to meet the demands of the client who wants things to appear in exactly the way the
customer deems it to appear.

What the users monitor looks like if I load the VFP EXE and the client already has QuickBooks running
full screen and I do not add in the API call.


If I add in the API then see what is displayed below:


As to your question of multiple top level forms, there are cases where you want to do this
Koen to meet the requirements of what a client is asking for in highly customized application.
As a good example in this same application we have Visual Earth maps being launched from my
main top-level-form. These forms with maps embedded in them are also Top-Level-Forms being
called from my main top level form.
The reason for this is the client is operating a many multi-display system and want to be
able to launch forms with maps and drag these to additional monitors. See pic below:


So how do you detach and drag and drop multiple instances of mapping and security tracking
to 8 different monitors with the forms configured as In-Top-Level forms??
These map forms are also cases where you may wish the pop to top API to be used.

Pete "the IceMan", from the Great White North of Canada.
www.marathongriffincomputers.com

ENTIRE THREAD

VFP Window To Front of Any Application Posted by Pete Sass @ 12/28/2013 5:56:59 PM
RE: VFP Window To Front of Any Application Posted by Koen Piller @ 12/28/2013 6:59:57 PM
RE: VFP Window To Front of Any Application Posted by Pete Sass @ 12/28/2013 9:50:17 PM
RE: VFP Window To Front of Any Application Posted by Koen Piller @ 12/29/2013 12:48:31 PM
RE: VFP Window To Front of Any Application Posted by Pete Sass @ 12/29/2013 3:04:11 PM
RE: VFP Window To Front of Any Application Posted by Tore Bleken @ 12/29/2013 11:56:51 PM
RE: VFP Window To Front of Any Application Posted by Jun Tangunan @ 12/30/2013 12:47:49 AM
RE: VFP Window To Front of Any Application Posted by Pete Sass @ 12/30/2013 1:02:00 AM
RE: VFP Window To Front of Any Application Posted by Koen Piller @ 12/30/2013 8:00:20 AM
RE: VFP Window To Front of Any Application Posted by Tore Bleken @ 12/30/2013 9:11:19 AM