Shantanu

I am doing a project that needs to put a static text in the default Incoming Phone Call Dialog in Pocket PC 2005.

I am sharing my piece of code. Please help me out if anybody can.

When a phone call comes, I am doing this:-

HWND lIncomingPhCallHwnd = (HWND)NULL;

LPCTSTR lpClassName = TEXT("Dialog");

LPCTSTR lpWindowName = L"Phone - Incoming...";

HWND lLastChildWnd = (HWND)NULL;

RECT lLstWndRect = {0};

lIncomingPhCallHwnd = FindWindow(lpClassName, lpWindowName);

lLastChildWnd = ::GetWindow(lIncomingPhCallHwnd, GW_HWNDLAST);

if((HWND)NULL != lLastChildWnd)

{

::GetWindowRect(lLastChildWnd, &lLstWndRect);

}

This GetWindowRect() API is returning me the coordinates of the last control in the default incoming phone call dialog. And, after this, I am calling the CreateWindow(), MoveWindow() and a ShowWindow() APIs. The control is getting created. But, it is not showing on the default incoming phone call dialog.

If anybody has any idea, please share it with me.



Re: Smart Devices Native C++ Development Customizing Default Incoming Phone Call Window

Zero Dai - MSFT

Hi Shantanu,

lLastChildWnd = ::GetWindow(lIncomingPhCallHwnd, GW_HWNDLAST);

This line will not get the handle of the last control in the default incoming phone call dialog. Instead, You will get the last sibling window related to the incoming phone call dialog in z-order. If you want to enumerate/find the control on a dialog, try to use EnumWindows function.

Regards,

Zero Dai - MSFT






Re: Smart Devices Native C++ Development Customizing Default Incoming Phone Call Window

Shantanu

Hi Zero,

Can you tell me one more thing Is it possible to put one more control inside the default "Phone - Incoming" dialog ( I don't think it is possible as my application is crashing while doing that. )

If it is possible, can you share me the idea





Re: Smart Devices Native C++ Development Customizing Default Incoming Phone Call Window

dseifert

While on the one hand I am looking for a solution to the same problem (display additional data during an incoming call), I don't think this is the correct solution as I'm not sure that "Phone - Incoming" as the name of the window is a guarantee (or is it ). What about non-English Windows Mobile versions, wouldn't the window name be different





Re: Smart Devices Native C++ Development Customizing Default Incoming Phone Call Window

Zero Dai - MSFT

Hi all,

Sorry for delaying reply.

Yes, we can put our own control onto the default "Phone - Incoming" dialog. But, keep in mind, it is not true for all the build-in dialog/window.

The following code (just some modification on your code) add a static lable onto the Phone - Incoming dialog, and it will be shown at the left top of this dialog. Although it is ugly, it proves this is feasible.

Code Snippet

HWND lIncomingPhCallHwnd = (HWND)NULL;
LPCTSTR lpClassName = TEXT("Dialog");
LPCTSTR lpWindowName = L"Phone - Incoming";
HWND lLastChildWnd = (HWND)NULL;

lIncomingPhCallHwnd = ::FindWindow(lpClassName, lpWindowName);
CWnd* pIncoming = CWnd::FromHandle(lIncomingPhCallHwnd);

CWnd* pWnd = new CWnd;
pWnd->Create(_T("STATIC"), L"Hello", WS_CHILD | WS_VISIBLE,
CRect(0, 0, 20, 20), pIncoming, 1234);

// you can adjust the position of the control in CRect.

Furthermore, I agree with what dseifert said. His suggestion is mainly needed to care.

Regards,

Zero Dai - MSFT






Re: Smart Devices Native C++ Development Customizing Default Incoming Phone Call Window

acdl

Zero Dai - MSFT wrote:

Furthermore, I agree with what dseifert said. His suggestion is mainly needed to care.

Then could you and dseifert show some lights on how could that be catered, especially with so many different countries windows devices

Thanks,

A_C





Re: Smart Devices Native C++ Development Customizing Default Incoming Phone Call Window

dseifert

acdl wrote:
Zero Dai - MSFT wrote:

Furthermore, I agree with what dseifert said. His suggestion is mainly needed to care.

Then could you and dseifert show some lights on how could that be catered, especially with so many different countries windows devices



I can't, I have no better idea (as I am said I am looking for the same solution). From experience the dirty solution will be to just put in as many translations as possible (usually you know your major market and languages). This of course is not a proper/clean approach.

On another note it should be pointed out that it says "default [incoming call] dialog". Question: is every device out there using the default incoming call dialog Or may there be OEMs who put in their own custom ones (Plus users using some 3rd party phone application or having some other application installed that takes this dialog over).

By the way, I am interested in this topic because I am maintaining my own addressbook and need to display the name of the caller. I've asked whether the OS can be made to request the name for a number from my app (answer was no). I also registered for the incoming call notification and quickly inserted a dummy contact into Pocket Outlook - didn't make a difference. The remaining suggestion on this forum to solve my problem was to write my own phone application (talk about overkill).

Anyway, despite the fact that it may be impossible to determine the incoming call dialog on every localized Windows Mobile version using generic code, I am also worried that the dialog may be using a different layout for some OEMs or even a different dialog at all.