[Gambas-user] "mutex" applications
Bruce
bbruen at ...2308...
Wed Jun 6 14:20:57 CEST 2012
On Wed, 2012-06-06 at 12:38 +0200, Rolf-Werner Eilert wrote:
> Hi Bruce,
>
> I have successfully used this code which is from Jussi Lahtinen. I built
> it into two of my applications, and it works reliably, at least under
> Gambas2 on our somewhat older system:
>
> PUBLIC SUB Form_Open()
> DIM sOutput AS String
>
> EXEC ["pgrep", "-f", "-l", "-u", System.User.Name, "Stein3.gambas"]
> WAIT TO sOutput
>
> IF Split(Trim$(sOutput), gb.NewLine).Count > 1 THEN
> QUIT
> ENDIF
>
> Just replace "Stein3" by your binary's name.
>
> Regards
>
> Rolf
Nice! A lot quicker than using gb.Desktop.
Sadly!
It doesn't solve the problem of activating the desired window.
And there is a slight "weird", it doesn't detect an instance that is
running via the IDE. No idea, but don't really care much, that's not
the problem.
Ah well, back to Benoit's dbus suggestion. Oh, how I hate having to
learn these "new" techo things.
Back tomorrow.
regards
Bruce
More information about the User
mailing list