Problem when launching from another application

This is a advanced question
I'm developping an application launcher that resides in the system tray. It's going pretty well, except when I try to launch smartFTP.
Using both ShellExecute() or CreateProcess() Windows API functions with smartFTP.exe do not launch the program, even if I set the right start directory. In fact, the process is created (CreateProcess returns a handle), but it is automatically closed a few second after).

SmartFTP is the only program that raise this problem.

Is there a reason for this behaviour ?

Thanks for your great program
Mario Brosse

No clue.
The exe packer may cause the problem.

I think the Windows Explorer also uses ShellExecute to execute a .exe file. Thus it "should" work with this API function.

-Mat

Thanks for your reply.
You remark is good, Explorer uses ShellAPI(), so there's probably something wrong with my code.

If I find an answer, I will post it.

Mario

Ok,
I think I finally found the answer: SmartFTP does not launch when my program is starting from my development environment.

So, correct me if I'm wrong, but I think the problem is due to the fact that when my program is launched from the development environment, a debugger is attached to it. Do you prevent your app from launching attached to a debugger (might be an anti-piracy measure) ?

Mario