views:

94

answers:

1

What's the easiest way to check if my program is already running with WxPython under Windows? Ideally, if the user tries to launch the program a second time, the focus should return to the first instance (even if the window is minimized).

This question is similar but the answer is for VB.NET.

+3  A: 

You should use wx.SingleInstanceChecker. See here for more information on how to use it, and this post tells about finding the running instance (you have to use pywin32 functions for this, there's nothing built into wxPython AFAIK).

Vinay Sajip