views:

60

answers:

3

Hello,

I'm creating a Win32 program that will be executed every time the computer turns on. I manage to do this by adding the .exe path into the registry. The problem is; I want to make the program appear minimized in the system tray when the computer is turned on but if I double click it [after the computer turns on and the program is not currently running] the program should appear on its normal [maximized] size.

Question, I was thinking on whether is was possible to pass an argument to the program when the program is executed from the registry. Is this possible? If yes/no, how would I manage to do this?

(Using windows XP) Thanks.

+3  A: 

Even if it's not possible to launch your program with command line arguments from the registry, you can use a batch script to do so. Just create a batch script that launches your program with the appropriate arguments, and use the registry to run that batch script instead.

Adam Rosenfield
Hey LOL, That makes sense!!! let me try it...
Y_Y
+2  A: 

Why not put arguments on the program's shortcut instead? That way you can make the default behavor be what it does on system startup, and use the arguments on the shortcut to tell it how to behave when the user starts it.

T.E.D.
+4  A: 

Yes, if your using HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run you can simply quote the path & add a command line:

Your App = "c:\xxxx\yourapp.exe" /mycommand
Alex K.