Problems with program started in RunOnce

Posted on 2003-11-16
Last Modified: 2010-04-05
I have this program that is placed in RunOnce to start at Windows startup.The reason I've choosen RunOnce is that this registry entry is executed before other entries and I want my program to execute first.It seams that programs started in RunOnce that are waiting for user input blocks Windows from starting corectly.If I kill my process then Windows starts OK.How can I trick Windows to start and my process to run ?  
Question by:Silker
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2

Expert Comment

ID: 9758204
It appears that you cannot use any user input when a program is run from RunOnce. Does your program have a user interface?

Geoff M.

Author Comment

ID: 9758407
 Sorry I was late with my answer but I'm new at EE.
For gmayo :
   Yes, my program does have an user interface.

Expert Comment

ID: 9758426
Then I believe you cannot use RunOnce, sorry. How about starting it as a service? Personally I don't know much about services, they might have the same problem though.

Geoff M.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 9758487
I saw other programs do that so I thing it is posible in some way.I've managed to start my program from RunOnce but with a little trick.Instead of launching the real program,I call CreateProcess or ShellExecute with ParamStr(0) and my program starts.But that means that I have 2 processes (of course the first ends as soon as CreateProcess returns).I've also tried to kill explorer.exe and restart it but it seams that other startup items do not re-run and thats bad.
    If you look at PSTrayFactory from PS SoftLabs you we'll see that they manage to start their program in RunOnce.
    I've also tried to start my program from within a service but it seams that it doesn't work.

Expert Comment

ID: 9758508
Create process - sneaky! ;-)

Geoff M.

Accepted Solution

modulo earned 0 total points
ID: 12808395
PAQed with points refunded (125)

Community Support Moderator

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below.…

749 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