Solved

App stops till it has focus

Posted on 1998-06-16
6
131 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 8

Accepted Solution

by:
MikeP090797 earned 100 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

733 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