Solved

App stops till it has focus

Posted on 1998-06-16
6
128 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…

822 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