[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

App stops till it has focus

Posted on 1998-06-16
6
Medium Priority
?
136 Views
Last Modified: 2010-05-03
i have a vb app runing on win95.
In my app the is a moving picture. However, my app always stops at the place where I move the picture, if another program (say Access)app has focus.  I have to give backthe focus to my app before it continue.
Any suggestions for this?
0
Comment
Question by:GeorgeVT
  • 4
  • 2
6 Comments
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1463468
Put a timer on the form, set the interval to 500, and put this inside:
If GetForegroundWindow()=mw.hwnd then me.show
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1463469
Put a timer on the form, set the interval to 500, and put this inside:
If GetForegroundWindow()<>mw.hwnd then me.show
0
 

Author Comment

by:GeorgeVT
ID: 1463470
I have error on the line.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 8

Accepted Solution

by:
MikeP090797 earned 200 total points
ID: 1463471
GetForegroundWindow us an api that must be declared:

Declare Function GetForegroundWindow Lib "user32" Alias "GetForegroundWindow" () As Long

0
 

Author Comment

by:GeorgeVT
ID: 1463472
If GetForegroundWindow()=mw.hwnd then me.show
 
mw give me error. do you mean me?
0
 
LVL 8

Expert Comment

by:MikeP090797
ID: 1463473
My mistake again, replace mw with ME, I missplelled it
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month18 days, 18 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question