How to run a program when minimized in vb 6

February 18, 2010 at 06:44:21
Specs: XP
Im creating a program for college that counts
the number of times a button is be pressed.
The code is all full functional and is working
however it only work when the form is open...

Therefore i was wondering if there is a way of
getting it to work in the background
(minimized).

Thank you in advance


See More: How to run a program when minimized in vb 6

Report •

#1
February 18, 2010 at 07:13:20
The hard part is to stop a programme from running when minimized, no to make it continue to run.

Where is this button that the application is counting? If it is in the same application then of course it will stop counting.

If it is in another application then you need to check the way your app communicates with the other app. How is this being done? Is your application pulling the information or is the other application pushing it to the VB application.

Remember that VB6 in an event driven system. It does nothing until an event occurs that will make it do something.

Stuart


Report •

#2
February 19, 2010 at 03:04:12
The information is being being pulled in from VB... for example if
the user press the letter "a" five time it will say it has been
presses five times. im using vbkeypress to get the Ascii value of
the letter that has been pressed and then displaying it on the
form.

Report •

#3
February 19, 2010 at 04:27:09
That is why it wont work. An application will only respond to key presses when it is the active application. In Windows there can only ever be one active application. Imagine the chaos if all minimized applications continued to respond to key presses.

What you are going to need is something that intercepts the key presses at a much lower level than VB. That means something like C++ or assembly. That application then sends the information to the VB application.

Stuart


Report •

Related Solutions

#4
February 19, 2010 at 05:03:59
I understand now. Thanks for all your help.

Report •

Ask Question