Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[TIP] Making the application muti-instance

0 views
Skip to first unread message

Alex Feinman [MVP]

unread,
Oct 22, 2003, 8:37:56 PM10/22/03
to
Pocket PC applications made with .NET CF are "single-instance". If the
application is already running and you launch it again, a second copy is not
launched. Instead the first copy of application is brought to foreground. To
disable this behavior for a particular application do the following in the
application's main form Resize event handler:

IntPtr hWnd = FindWindow("#NETCF_AGL_PARK_",
System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQuali
fiedName);
if ( hWnd != IntPtr.Zero )
SetWindowText(hWnd, "#42");

Naturally this requires P/Invoke definitions for FindWindow and
SetWindowText (both are trivial). To the best of my knowledge it will not
affect any other functionality. Keep in mind that this is undocumented and
relies on some internal details that can easily change any time.

It is suggested to store the window handle inside your form class for future
use


0 new messages