PDA

Click to See Complete Forum and Search --> : Maximizing a minimized application


Vicki Pugh
Nov 17th, 1999, 08:12 PM
I wonder if anybody can help me (please!).

Maybe I shoulg give you some background to my problem...

I am using MS Access to develop a DB for a local company. When the user gets to the address field on the form, I want an Addressing package to get the focus and then, after sending the required address to Access, to give the focus back to Access.

I have 2 ideas for solutions to this problem, but am unsure about some aspects of each.

1) The addressing package has an option to minimize after send. This is great, but then I can't maximize it again. I know that the Shell function allows you to select the style of window that you want - is there a similar option available with the AppActivate statememt?

2) I can use the AppActivate statement to give the focus to the addressing package. The only problem is, the package is designed to 'come out on top' so to speak. I have tried to use VB to give the focus back to the addressing package (ie by using AppActivate to give the focus to the addressing package, and then using AppActivate again to give the focus back to Access). This does work briefly (the focus does go to Access, but because the addressing package always has the last word after sending the address, it goes back again).

I was thinking that if I could put a delay into the AppActivate statement to enable the addressing program to finish executing its commands, then the focus should (by my way of thinking) go back to Access. Is there any way of doing this?


In brief, what I want to do is either:
-add a delay in a VB module to be performed between 2 AppActivate statements.
-maximize a minimised application window.

Please help!

Thank you for taking your time to read this.

Kind Regards,

-Vicki Pugh

Clunietp
Nov 18th, 1999, 12:16 AM
Is this Addressing package a separate EXE or is it part of your Access program?

MartinLiss
Nov 18th, 1999, 12:22 AM
Have you investigated AppActivate's wait parameter?

------------------
Marty

Vicki Pugh
Nov 18th, 1999, 03:37 AM
Yes the addressing package is a separate EXE file but is deisgned to send keystrokes to selected fields on a DB form.

I haven't managed to get the wait facility to work - maybe you could give me some hints please? I know how to get it do wait after an AppActivate statement, but not before one. This is one of the problems I've been having by attempting to do it this way.

I'd be really greatful of any help!!!

MartinLiss
Nov 18th, 1999, 05:37 AM
Insert this where you want and it will wait 5 seconds
MsgBox "start"

dblEndTime = Timer + 5#
Do While dblEndTime > Timer
' Do nothing but allow other
' applications to process
' their events.
DoEvents
Loop

MsgBox "end"


------------------
Marty

Vicki Pugh
Nov 18th, 1999, 03:25 PM
Thank you Marty for that - I'll give it a go so keep your fingers crossed please!!!

I really appreciate your help.

Regards,

-Vicki