Page 1 of 1

ShellExecuteEx hangs until Textpad is closed

Posted: Thu Apr 19, 2007 8:11 am
by OliverKurowski
Hi all!

Textpad 5.0.0 and 5.0.2 has a behavior that is quite annoying: When Textpad is started using a file association then the call hangs until Textpad is closed. Since I usually reuse the instance for other files I usually don't close Textpad soon which blocks the calling program completly. Textpad 4 was ok in this respect.
E.g. TotalCommander suffers from this behavior: when you start a file by double click, no keyboard shortcuts work until Textpad is closed. It seems that keyboard shortcuts are executed in a background thread that is blocked by the call to ShellExecuteEx. I also wrote a small C# program to demonstrate the behavior:

Code: Select all

using System;
using System.Diagnostics;

namespace FileStartTest
{
   class Program
   {
      static void Main(string[] args)
      {
         Console.WriteLine("Starting the file test.txt from the current directory...");
         Process process = new Process();
         process.StartInfo.UseShellExecute = true;
         process.StartInfo.FileName = "test.txt";
         process.Start();
         Console.WriteLine("This text appears only if Textpad is closed.");
      }
   }
}

Posted: Fri Apr 20, 2007 11:15 am
by OliverKurowski
This is fixed in 5.0.3.