I am trying to run an application (operating system, my application and the application I want to run, all 32 bits) from .NET 3.51.
The code that starts Process is used for other applications, but one that gives us a headache. If we double-click the application icon, it works as expected, which means that it works great as an application on a computer. Double-clicking .exe directly also works.
Operating system - Windows 7 32Bits (home and / or professional).
Our .NET application is compiled with x86 to avoid problems.
The code that starts the "Processes" is inside the DLL (also 32 bits) that we made, basically it is a simple DLL that contains some "common code" in all directions, common methods, functions, etc. that we use throughout our the code. One of these methods is as follows:
public static bool FireUpProcess( Process process, string path, bool enableRaisingEvents,
ProcessWindowStyle windowStyle, string arguments )
{
if ( process != null )
{
try
{
process.StartInfo.FileName = @path;
if ( arguments != null )
{
if ( arguments != String.Empty )
{
process.StartInfo.Arguments = arguments;
}
}
process.StartInfo.WindowStyle = windowStyle;
process.EnableRaisingEvents = enableRaisingEvents;
process.Start();
}
catch
{
try
{
process.Kill();
}
catch ( InvalidOperationException )
{
}
return false;
}
}
else
{
return false;
}
return true;
}
I don’t know who wrote this method, but it has been working for about six years with different applications, so I assume that it is “good”. However, we do have a client with a piece of software that does not start when passing this argument.
Arguments :
- a process is System.Diagnostics.Process, created using a simple "new process ();"
- path is the full path to the .exe "c: /path/to/my.exe".
- enableRaisingEvents
- windowStyle ( ).
crappy MessageBox... . , :

:
(0x0eedfade) ...
Googling, 0x0eedfade , , , , .exe, Im , .
: (I.e.: Notepad.exe, Adobe Acrobat Reader), , , Firefox .
" , " , Windows 7 , .
- ?
: Ok; Ive . , . , , , FireUpProcess.
, WorkDirectory, :
public static bool FireUpProcess(Process process, string path, bool enableRaisingEvents, ProcessWindowStyle windowStyle)
{
if (process != null)
{
try
{
if ( !String.IsNullOrEmpty(@path) )
{
process.StartInfo.FileName = @path;
process.StartInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(@path);
process.StartInfo.WindowStyle = windowStyle;
process.EnableRaisingEvents = enableRaisingEvents;
Framework.Check.LogWarning("LAUNCHING EXTERNAL DEVICE WITH PATH: " + path);
process.Start();

, " - ddip.dll... bla bla".
, @path , :

. , "", "". , .
, : ?
- , .
?
. , , .
( , , 1- ). , VStudio 2008 add file → application manifest.
, :
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
- , , , Vista/7 .
.
note: UseShellExecute ( ), false, , .