Link to home
Start Free TrialLog in
Avatar of npatel
npatel

asked on

First caller on tray

My application startup on the windows tray during windows startup. Is there a way to insure that my application will always be the first one that is executed during windows startup. It must work for both Win9X and NT.
Avatar of inthe
inthe

id suggest putting your program under
HKEY_CURRENT_USERS\Software\microsoft\windows\currentversion\run key and make your program the first one in the list.
if you need the code to put it there i shall give it you just ask.
cheers
Avatar of npatel

ASKER

Thank you for your response.

I will check this out and give you an answer for the points tomorrow.

How can I garantee that no other program when loaded will change the order of this call?


as far as i can tell the orderis first in the list starst first.
notice the order is alphabetical so you just need to name your program something with a couple of "a's" first like "aapple" or name it something like "!apple" to pu it first in list.
There are several places where you can install the autostart for your program:

HKEY_LOCAL_MACHINE\...\Run
HKEY_LOCAL_MACHINE\...\RunService
HKEY_CURRENT_USER\...\Run
HKEY_CURRENT_USER\...\RunService
c:\windows\startmenu\programs\startup
win.ini\[windows]\load
win.ini\[windows]\run

I don't know which place is looked at first. I guess, it's RunService. But you'll have to check that.

Regards, Madshi.
Avatar of npatel

ASKER

inthe and madshi,

I have an idea!.

What if my program was converted to a self extracting file that was named the same as the windows desktop exe (I am assuming that it is a ????.exe) . when windows executes the destop, it runs my code which extracts the original desktop exe and runs it.

Bonus of this is that
- my program will be able to have total control of the desktop.
- can be made to secure the access to the desktop.
- allow me to modify the registry before and after the desktop executes.

Will this work? better then a tray exec that changes the registry.

ASKER CERTIFIED SOLUTION
Avatar of Madshi
Madshi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of npatel

ASKER

Your detailed answers has given me enough information to get started.

Your on a roll keep it up!.

thanks inthe for your quick answer.

I gave the points to madshi since it involved a lot more information and helped me with my desktop issue as well as been the first to exec.

Still have to try it out,that's just coding anyways, its the idea and knowledgable experiance that counts.
Sorry to Barry...   :-(

Thanx to npatel for the points (and the A grade this time... :-)

Regards, Madshi.

P.S: npatel, if you want to start the startmenu&desktop after your program has launched first, you have to switch back to the old shell settings (shell = explorer.exe), THEN start explorer.exe. Then - after the explorer has started - you can restore your special shell settings.