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
 Tags
Subject: VFP Window To Front of Any Application
Thread ID: 394021 Message ID: 394021 # Views: 105 # Ratings: 1
Version: Visual FoxPro 9 SP2 Category: Forms
Date: Saturday, December 28, 2013 5:56:59 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.


UPDATED: 2013.12.29 06:10 AM (EST)
Here is another way without API calls.

Put the code below in a forms Activate event.
lcFormName = Thisform.Name 
ACTIVATE WINDOW &lcFormName 


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