App stops till it has focus

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?
GeorgeVTAsked:
Who is Participating?
 
MikeP090797Connect With a Mentor Commented:
GetForegroundWindow us an api that must be declared:

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

0
 
MikeP090797Commented:
Put a timer on the form, set the interval to 500, and put this inside:
If GetForegroundWindow()=mw.hwnd then me.show
0
 
MikeP090797Commented:
Put a timer on the form, set the interval to 500, and put this inside:
If GetForegroundWindow()<>mw.hwnd then me.show
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
GeorgeVTAuthor Commented:
I have error on the line.
0
 
GeorgeVTAuthor Commented:
If GetForegroundWindow()=mw.hwnd then me.show
 
mw give me error. do you mean me?
0
 
MikeP090797Commented:
My mistake again, replace mw with ME, I missplelled it
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.