blikblum/luipack

New UniqueInstance Version hangs Application if modal window is in the foreground

Closed this issue · 6 comments

Add a tButton to the mainform of the testcomponent project (fmain), the onClick handler is like this:

procedure TForm1.Button1Click(Sender: TObject); begin Application.MessageBox('Hi! I am a modal Window!','Modal Window Check',MB_ICONINFORMATION); end;
If the message is displayed, and a second instance is launched, the second instance will terminate and the first instance will come to the foreground, like intended, but you will not be able to dismiss the message box any longer. Instead, the first instance hangs idefinitely.

Sometimes it may help to bring another app into the foreground, launch the task manager, shift the focus away from the hanging app several times, and if you try a while, the message may go away and the first instance will continue as normal.

I tried other modal boxes as well, like ShowMessage oder Messagebox(Hwnd,....), all do hang.

! This behavior does not occur with the older version uniqueinstance-1.0.zip Apr 18, 2011 !

Armin Linder

5b66a33 should fix for fpc 3.0.0. Needs to test with fpc 3.0.2 and trunk still. So keeping open the issue

I tested with fpc 3.0.2rc1 (that has similar implementation as trunk) and is working. Reopen if necessary

Problem persists, and is reproducible on 3 different machines (W10x64, W7x32, W8x64). Sent my project files along description on how to test per e-mail to blikblum. Develpment machine (W7x32) uses latest release version of Lazarus (1.6.2).

What email did you sent?
Did not received.
What fpc version and what UniqueInstance version are you using?

Hi, i tested your example and is working fine. If you look at most recent version the test component demo has a button that does the same as your example. Initially i reproduced the issue and after the changes i made (basically using the same approach as before) it started to work

Please ensure that you are compiling the new version. Sometimes it does not recompile the project. Delete all exe and lib from the project and package directories than recompile