G
Guest
I am working with VS2005 to deploy a CF .NET 2.0 app that will display an
animation whenever an incoming call comes in.
In order to do this, I want to hide the default incoming call pop-up window
titled "Phone - Incoming..." (it has the menu buttons Answer/Ignore at the
bottom), and display my own animation once I get it coded, but my attempts so
far have been unsuccessful.
Here's a snippet of my code I'm working with so far:
private Microsoft.WindowsMobile.Status.SystemState incomingProperty;
....
incomingProperty = new
Microsoft.WindowsMobile.Status.SystemState(Microsoft.WindowsMobile.Status.SystemProperty.PhoneIncomingCall);
incomingProperty.Changed += new
Microsoft.WindowsMobile.Status.ChangeEventHandler(incomingProperty_Changed);
....
void incomingProperty_Changed(object sender,
Microsoft.WindowsMobile.Status.ChangeEventArgs args)
{
IntPtr incomingHandle = FindWindow(IntPtr.Zero, "Phone -
Incoming...");
lblStatus.Text = "Status: Incoming Call";
lblPhoneNumber.Text =
Microsoft.WindowsMobile.Status.SystemState.PhoneIncomingCallerNumber;
// 0x80 = Hide Window, 0x1 = No Size, 0x2 = No Move
SetWindowPos(incomingHandle, 0,0,0,0, (0x80 | 0x1 | 0x2));
}
[DllImport("CoreDll")]
public static extern IntPtr FindWindow(IntPtr classname, string
WindowName);
[DllImport("CoreDll")]
public static extern bool SetWindowPos(IntPtr hWndInsertAfter,int
x,int y,int cx,int cy,int nFlags);
....
FindWindow seems to come back with a valid window handle for the pop-up, and
the SetWindow comes back as true, but the pop-up window does not hide. Is
there anything I am missing here?
animation whenever an incoming call comes in.
In order to do this, I want to hide the default incoming call pop-up window
titled "Phone - Incoming..." (it has the menu buttons Answer/Ignore at the
bottom), and display my own animation once I get it coded, but my attempts so
far have been unsuccessful.
Here's a snippet of my code I'm working with so far:
private Microsoft.WindowsMobile.Status.SystemState incomingProperty;
....
incomingProperty = new
Microsoft.WindowsMobile.Status.SystemState(Microsoft.WindowsMobile.Status.SystemProperty.PhoneIncomingCall);
incomingProperty.Changed += new
Microsoft.WindowsMobile.Status.ChangeEventHandler(incomingProperty_Changed);
....
void incomingProperty_Changed(object sender,
Microsoft.WindowsMobile.Status.ChangeEventArgs args)
{
IntPtr incomingHandle = FindWindow(IntPtr.Zero, "Phone -
Incoming...");
lblStatus.Text = "Status: Incoming Call";
lblPhoneNumber.Text =
Microsoft.WindowsMobile.Status.SystemState.PhoneIncomingCallerNumber;
// 0x80 = Hide Window, 0x1 = No Size, 0x2 = No Move
SetWindowPos(incomingHandle, 0,0,0,0, (0x80 | 0x1 | 0x2));
}
[DllImport("CoreDll")]
public static extern IntPtr FindWindow(IntPtr classname, string
WindowName);
[DllImport("CoreDll")]
public static extern bool SetWindowPos(IntPtr hWndInsertAfter,int
x,int y,int cx,int cy,int nFlags);
....
FindWindow seems to come back with a valid window handle for the pop-up, and
the SetWindow comes back as true, but the pop-up window does not hide. Is
there anything I am missing here?