ShellExecuteEx hangs until Textpad is closed

Ideas for new features

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
OliverKurowski
Posts: 3
Joined: Thu Mar 08, 2007 2:09 pm

ShellExecuteEx hangs until Textpad is closed

Post 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.");
      }
   }
}
OliverKurowski
Posts: 3
Joined: Thu Mar 08, 2007 2:09 pm

Post by OliverKurowski »

This is fixed in 5.0.3.
Post Reply