Re: File Associations - Multiple Instances



Since the CF enforces singleton behavior before you get an opportunity to
intervene, you have to hack around it. The typical way I go is to hack the
window name to prevent multiple instances and use IPC to send the new path
to the existing instance as you suggest. Yes, it changed how it works in CF
2, but the principal remains the same. You can use the Environment class to
determine which you're running under when you launch.


--
Chris Tacke
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--




"Martin" <sousoux@xxxxxxxxxxxxx> wrote in message
news:526659AC-A6F7-468F-8B15-C58E567FDE58@xxxxxxxxxxxxxxxx
Hi

I have a CF.Net small application which is set up with a file association.
I
click on a file of a certain type and my program loads fine and the
filename
is passed as an argument.

If I click on another file the previous window redisplays and the new file
is not loaded. This is the CF.Net single instance restriction at work.

Is there an accepted way to be able to pass or retrieve the new arguments
in
the old instance of the application? I've looked for documentation on this
but I haven't found any.

The ways of "hacking" multiple instances seem to have changed in CE 5.0
since the window class is now #NETCF_AGL_PARK_+pathtoapp and the window
title
blank. The old trick of changing the window title doesn't work. If that
did
work I'd use a named event + WM_COPYDATA but it seems that route is
closed. I
don't really want to have two *.exe's.

Thanks in advance for any suggestions.



.



Relevant Pages

  • Re: Executing system() command without console popping ...
    ... >window and on the other tell it to hide it. ... >and tried my hack again on XP/SP2. ... Doug Harrison ... Microsoft MVP - Visual C++ ...
    (microsoft.public.vc.language)
  • Re: "Changes Betty wants made"
    ... This sort of personification is common among computer programmers, ... Right now in the other window I'm trying to hack a spec file ...
    (alt.usage.english)
  • Re: Msconfig window size
    ... What is the hack to change the view on it? ... > window never results in the normal double-ended arrow used for ... Prev by Date: ...
    (microsoft.public.windowsxp.general)
  • Re: Executing system() command without console popping ...
    ... > I recommend doing both, as SW_HIDE doesn't seem to hurt anything, ... I don't think it does either, Doug. ... window and on the other tell it to hide it. ... Then I copied the hack to an old and slow 2K box, ...
    (microsoft.public.vc.language)