I have a very old program that I have no control over. It launches a filetype with its default application like this(I cannot modify this code):
LET Err (SHELL_EXECUTE 'open' (FIX_MESG '"{1}"' File_name) '' '')
^^The above code works, so long as that filetype isn't associated with a ClickOnce program.
The old program is 32 bit, the OS is Windows 7 64 bit. I can compile my clickonce program as anything, but none seem to work. (I've tried x86, x64 and anyCPU)
How can I make a 32 bit program use shell execute to launch a ClickOnce program on a 64bit OS?
More details: This is a reproducible error. Build 2 programs. Program 1 is a Clickonce program. Associate it with any filetype. Program 2 will do a shell execute command to open whatever filetype the clickonce program is associated with. If you compile program 2 as x86, it will give you a success response, but do nothing.
Test code for console shell execute program:
private static void Main()
{
int value = ShellExecuteA(IntPtr.Zero, "open", @"C:\Users\bsee\Desktop\testfile.ecn2", "", "", 0);
if (value > 32)
MessageBox.Show("Clickonce reports success. But did it actually start?");
}
[DllImport("Shell32.dll")]
public static extern int ShellExecuteA(IntPtr hwnd, string lpOperation, string lpFile, string lpParameters, string lpDirecotry, int nShowCmd);