CompactFramework applocation class name

S

Sharon

Hello,
I develop for SmartDevice using VS2005
I my application to be able to load multiple times.
In VS2003 I used FindWindow with class name : "#NETCF_AGL_PARK_"
But with VS2005 the FinsWindow cannot find the window.
If I check with RemoteSpy And I see the class name is the same as I search.

This is the code i use :

[DllImport("coredll.dll", EntryPoint = "FindWindowW", SetLastError = true)]
private static extern IntPtr FindWindowCE(string lpClassName, string
pWindowName);

string sName =
Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName;
string sClass = "#NETCF_AGL_PARK_";
IntPtr i1 = FindWindowCE(sClass, sName);

How can I get the application window ?

Thanks,
Sharon
 
D

Daniel Moth

You are using VS2005 but are you still under v1 or have you upgraded to v2?

The class name has changed with v2:
http://www.danielmoth.com/Blog/2005/12/netcfagl.html

To get the application window, this:
IntPtr i1 = FindWindowCE(sClass, sName);
Should be:
IntPtr i1 = FindWindowCE(sClass + sName, String.Empty);

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

Sharon said:
Hello,
I develop for SmartDevice using VS2005
I my application to be able to load multiple times.
In VS2003 I used FindWindow with class name : "#NETCF_AGL_PARK_"
But with VS2005 the FinsWindow cannot find the window.
If I check with RemoteSpy And I see the class name is the same as I
search.

This is the code i use :

[DllImport("coredll.dll", EntryPoint = "FindWindowW", SetLastError =
true)]
private static extern IntPtr FindWindowCE(string lpClassName, string
pWindowName);

string sName =
Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName;
string sClass = "#NETCF_AGL_PARK_";
IntPtr i1 = FindWindowCE(sClass, sName);

How can I get the application window ?

Thanks,
Sharon
 
S

Sharon

Hi,

I used the FindWindow to open multiple instance of my application, using
SetWindowText to change the application name.
But now I cannot use this anymore.

Is there any other way to open multiple instance on the same application.


Thanks,
Sharon


Daniel Moth said:
You are using VS2005 but are you still under v1 or have you upgraded to
v2?

The class name has changed with v2:
http://www.danielmoth.com/Blog/2005/12/netcfagl.html

To get the application window, this:
IntPtr i1 = FindWindowCE(sClass, sName);
Should be:
IntPtr i1 = FindWindowCE(sClass + sName, String.Empty);

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

Sharon said:
Hello,
I develop for SmartDevice using VS2005
I my application to be able to load multiple times.
In VS2003 I used FindWindow with class name : "#NETCF_AGL_PARK_"
But with VS2005 the FinsWindow cannot find the window.
If I check with RemoteSpy And I see the class name is the same as I
search.

This is the code i use :

[DllImport("coredll.dll", EntryPoint = "FindWindowW", SetLastError =
true)]
private static extern IntPtr FindWindowCE(string lpClassName, string
pWindowName);

string sName =
Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName;
string sClass = "#NETCF_AGL_PARK_";
IntPtr i1 = FindWindowCE(sClass, sName);

How can I get the application window ?

Thanks,
Sharon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top