Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Loading programs as start up

Hi all,
Some advice please guys.

At start up of my PC's I need to load a number of programs BUT I do not have the "explorer.exe" loading so I can not use the startup folder.

I have a program that will load up (mainMenu.exe) and this will in turn load the other programs I need.

My question is how can I wait for a progam to load and then move onto the next one?

I need for example

Shell to OPoSSwipe.exe
Wait untill the OPoSSwipe.exe to load
Once it has loaded change a label caption to say "Loaded" and then move onto the next program.

Is this possiable with VB6 or do I need to use a bat file?? (dos) I do not want to do this as I can not create a bat file with the correct information in it

(app.path would enter = c:\program files\EPoS\OPoSSwipe\OPoSSwipe.exe)

and dos does not like that.

Thanks for any advice you can offer me

Drew
[945 byte] By [Drew_gable] at [2007-11-11 8:33:07]
# 1 Re: Loading programs as start up
Another alternative to the Startup folder is to add the desired programs to registry. Add them to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run if you want them to load when a specific user logs on, or HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run if you want them to load for all users.
Phil Weber at 2007-11-11 17:25:17 >
# 2 Re: Loading programs as start up
Thanks for the replay,

I am not willing to play with the registry (I am not confident to use it)

Can I do my idea with VB or should I use another methold to load the addon programs?

any other idea's?

Drew
Drew_gable at 2007-11-11 17:26:17 >
# 3 Re: Loading programs as start up
You can Shell an app and then pause until it terminates, but I don't know of any way to determine that an app is fully loaded. Is there a reason you need to wait for each program to finish loading? Why can't you just start them one after the other?
Phil Weber at 2007-11-11 17:27:26 >
# 4 Re: Loading programs as start up
If you want to wait till each app is loaded, why not have each app create a file in a specific place when loaded (nowloaded.txt) which you delete before loading each app, and then loop looking for it - when it exists, app is loaded. Repeat this step for each app.

You would obviously want a timer to indicate that there has been a problem loading, so that you do not wait indefinitely.
gupex at 2007-11-11 17:28:20 >
# 5 Re: Loading programs as start up
The reason I want to determin if each program is loaded so I can feed this information to the user.

I do not want the to be staring at blank screen

ie

|-------|
| Loading...... |
|-------|

At lest with the status feed back they can see what is happening

The apps are my own creations so I can modify them to include the (nowloaded.txt) file if that will do the trick.

The way that the programs load are as follows

OPoSSwipe.exe - this sends information from the OPoS card reader to the PS/2 port
Card.exe - This is the interface between my EPoS Software and the card processor
ETopup.exe - This is the interface for the E top up services.

Drew
Drew_gable at 2007-11-11 17:29:30 >
# 6 Re: Loading programs as start up
Instead of the text file approach (which can be flaky), why not make your apps either ActiveX EXE's or DLL's. Then you can raise an event when the loading is finished... or report any other status back to the calling program.
edburdo at 2007-11-11 17:30:27 >
# 7 Re: Loading programs as start up
ok

how do i convert them from standard exe file to dll's?

Also is it possaible to use a control in another program?

I have a OPoS Printer that is being used by my EPoS Software and I need to use it once in a while from my cheque printing module. is it poissble to access the OPoS control in the EPoS Program?

Example
Form name = OPoSForm
Control Name = OPoSPoSPrinter1
Exe name = FoodPoS

I need to print to it from my chequemodule.exe can this be done or would I need to create a printer module to control the printer and have all the other programs talk to it?

Thanks for all the advice

Drew
Drew_gable at 2007-11-11 17:31:31 >