473,387 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Notify access when the current access application looses focus to another program?

I've tried searching on Google and for other questions similar to mine, but all I get are results on how to use the LostFocus event or Deactivate, etc., but I'm under the impression each of these applies to controls on a form, or the actual form itself. What I need is a way to determine when my access database looses the focus entirely to another program in Windows, such as if I click on one of my access forms, MSAccess will have the focus. If I click on the start menu, it no longer has the focus, explorer has the focus. Or if I click on FireFox or Notepad, etc.

I realize I can put an onlostfocus code on every single one of my forms to check if access still has the focus and if not initiate some code, but that is very tedious, and I was hoping for a more general approach or maybe a built in function I was not aware of. I'm up for trying some API stuff too. I was reading here when I thought I could fiddle with WM_DectivateAPP, but the guy there ended up not using it so I didn't see any examples on how it would be used, nor can I find any elsewhere.

At the moment I have my database run by all popup forms, and the access application window and DB window are hidden, so that just the forms are visible, to help enforce the illusion that the database is a standalone app and not hosted by Access 2003. There is a large background form, a form across the top with custom titlebar and close button, beneath that a toolbar, and beneath that the nav form. My problem originally was that I would use the nav form or toolbar to open other database items, but at any given time if I clicked a different form or moved the form over a nav panel or toolbar etc. they would disappear or slip away. So I've instructed them not to be modal, but always to be "on top" of all other forms. The trouble is, when I click away from the database into another program, they are still there on top of that program too.

I want an Access.Application.LostFocus sort of event so that I can insert the "return to normal" procedure and apply it to all AlwaysOnTop forms, then continue with the switchover to the new programs.

Additionally, I would need an opposing Access.Application.GotFocus event to reinstate the alwaysontop procedure when the focus was returned to the accessdb.

Any ideas / suggestions?

Thanks in advance.

~Zach


P.S. -- I've already considered running an invisible form in the background to monitor the window with a timerevent for loss of activity, but that simply will not do, it takes up to much cpu to run a constant timer. Please avoid suggests similar to this. Thanks!
Jul 26 '10 #1
1 3159
patjones
931 Expert 512MB
I have never had to do something like this, and I honestly don't know if it is possible, but I can certainly look into it. I think it is reasonable to assume there might be some Windows API manipulation involved though.

I might add that I'm interested in learning how you get rid of the Access application window. It's something I had wanted to do in the past, but time prevented me from thoroughly researching the issue.

Pat
Jul 26 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: MarsVoyager | last post by:
Hi, I want to change the value of a submit button when the onChange event is fired by a Radio Input. Problem is, it seems the value is modified in the gui only when the Radio Input looses focus,...
3
by: Pete | last post by:
Is there any possiblity of writing an Access or Visual Basic application that provides a method of sharing the window focus between Access and the Shell application? i.e....
16
by: MLH | last post by:
In Access 97 and Access 2.0 applications, if a command button has the focus, the spacebar will 'PRESS" the key. How does one go about disabling this annoying BEATURE?
6
by: SteveS | last post by:
Hello All. I have an asp.net application with 3 different assemblies. They are like this: 1) Assembly: PublicSite (This contains the website UI) Root namespace: PublicSite 2) Assembly:...
3
by: Greg | last post by:
The LostFocus event of datagrids is fired when the focus is added to a cell. How do you go about detecting it when the control as a whole has lost focus to another control? Slightly confused by...
0
by: Asif | last post by:
Hi all, I am working on an MDI application using VB.NET. Applications launches normally either from Program Files or Desktop shortcut but some times when it launches from Windows Explorer by...
3
by: Kbalz | last post by:
Hello - I've tried to search this, but the word Focus in searching always returns lots of control focusing. I would like my C# Win App to minimize, and focus a program that is already running,...
4
by: salon | last post by:
i have created a web application in c# and ASP.NET1.1 that is having a button on click of which spawns a web page which is hosted on my localhost! i have given the URL to my friend.Now he/she...
2
Atran
by: Atran | last post by:
Hello: I have two programs (Windows Forms). I want to make the second program runs when I press a button in the first program. So when the user go to run the second program, I want the second...
4
by: =?ISO-8859-15?Q?Albe_V=B0?= | last post by:
In my Application, I need to make a certain graphical refresh, interrogating SqlServer, only if Application has focus (i.e. the title bar is blue). Interrogating .Focused property of various...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.