The
Tue Feb 27 18:13:17 CST 2007
> I use a mutex to detect running instance, then use FindWindow to find
that instance,
that's the idea, but in order to do things rights, you also need to make
sure that FindWindow will not be called before the first instance actually
created its window. i.e. the second instance should wait is the first
instance is in the process of initializing and has not yet created its
window. this involves some synchronization.
<r_z_aret@pen_fact.com> wrote in message
news:ran8u2th41hbfbml02koa8o9cl4hkckjs3@4ax.com...
> On Tue, 27 Feb 2007 03:20:52 -0800, "The PocketTV Team"
> <support@pockettv.com> wrote:
>
>>that advice only works for applications that take no parameters (i.e. that
>>do not open files associated to the application and passed as a
>>parameter).
>>
>>if your application opens files, then handling that is noticeably more
>>complicated if you want to do it correctly.
>
> I use a mutex to detect running instance, then use FindWindow to find
> that instance, and then send a WM_COPYDATA message with the command
> line (if it's not empty). That much is pretty simple, but I switching
> files would be more complex.
>
>
>>
>>"Amit" <amitranjan@nospam-saskendotcom> wrote in message
>>news:1F58A247-3A8D-45A8-9E94-FAD4999B9FEC@microsoft.com...
>>> Create a named mutex at the start of the application,and check for the
>>> return
>>> value.If you get an error saying that mutex already exists then you can
>>> exit
>>> (an instance of your application already exists) else you can go ahead
>>> with
>>> the normal execution of the application.
>>>
>>> --
>>> Thanks and Regards
>>> Amit Ranjan
>>> blog:
http://amitranjan.wordpress.com
>>>
>>>
>>> "Michael" wrote:
>>>
>>>> Hello
>>>>
>>>> My Pocket app starts twice if i click fast 2 times on the start-button
>>>> of
>>>> the pda.
>>>>
>>>> How can I catch this problem?
>>>> Thank you
>>>>
>>>>
>>>>
>>
>
> -----------------------------------------
> To reply to me, remove the underscores (_) from my email address (and
> please indicate which newsgroup and message).
>
> Robert E. Zaret, eMVP
> PenFact, Inc.
> 20 Park Plaza, Suite 478
> Boston, MA 02116
> www.penfact.com