H
HervéP
Hi,
I tried to do a software on my PocketPC, that wait an another software to
exit.
I invoke "WaitForSingleObject" and FindWindowW :
[DllImport("coredll.dll", EntryPoint="WaitForSingleObject", SetLastError =
true)]
private static extern int WaitForSingleObject(IntPtr hHandle, uint
dwMilliseconds);
[DllImport("coredll.dll", EntryPoint="FindWindowW", SetLastError=true)]
private static extern IntPtr FindWindow(string lpClassName, string
lpWindowName);
Call to these functions (in my Form) :
IntPtr handle1 = FindWindowCE(null, "FormTest");
MessageBox.Show("Handle : "+handle1+" Wait return :
"+WaitForSingleObjectCE(handle1,50000).ToString());
But the result is always :
- when the application "FormTest" isn't running :
"Handle : 0 Wait return : -1" (this is normal)
- when the application "FormTest" is running :
"Handle : 2681648 Wait return : -1" (that don't work : the function
WaitForSingleObjectCE return immediately with "-1")
What's wrong ?
And... I also tried with OpenNETCF, but I'm wrong with the ProcessEntry and
with the Wait : that seems to work once, but not after, and after that's
ok... that's strange !
Thanks in advance !
Hervé
I tried to do a software on my PocketPC, that wait an another software to
exit.
I invoke "WaitForSingleObject" and FindWindowW :
[DllImport("coredll.dll", EntryPoint="WaitForSingleObject", SetLastError =
true)]
private static extern int WaitForSingleObject(IntPtr hHandle, uint
dwMilliseconds);
[DllImport("coredll.dll", EntryPoint="FindWindowW", SetLastError=true)]
private static extern IntPtr FindWindow(string lpClassName, string
lpWindowName);
Call to these functions (in my Form) :
IntPtr handle1 = FindWindowCE(null, "FormTest");
MessageBox.Show("Handle : "+handle1+" Wait return :
"+WaitForSingleObjectCE(handle1,50000).ToString());
But the result is always :
- when the application "FormTest" isn't running :
"Handle : 0 Wait return : -1" (this is normal)
- when the application "FormTest" is running :
"Handle : 2681648 Wait return : -1" (that don't work : the function
WaitForSingleObjectCE return immediately with "-1")
What's wrong ?
And... I also tried with OpenNETCF, but I'm wrong with the ProcessEntry and
with the Wait : that seems to work once, but not after, and after that's
ok... that's strange !
Thanks in advance !
Hervé