mahendra
Fri May 02 03:18:33 CDT 2008
On May 1, 9:38 pm, Fabien <fab_00_2...@msn.com> wrote:
> Hi,
>
> You can use SNAPI, PhoneIncomingCallerName, check out this:
http://msdn.microsoft.com/en-us/library/bb154506.aspx
>
> BR
>
> Fabien Decret (Device Application Development MVP)
> Windows Embedded Consultant
>
> ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/|http://fabdecret.blogspot.com/
>
> On 28 avr, 14:13, knopper <onen...@gmx.net> wrote:
>
> > Is there other alternative to get incomming call number as read registry
> > changes ?
add code in to mainframe as :
1) MainFrame.cpp
HRESULT CMainFrame::RegisterPhoneIncommingCallNotification()
{
HRESULT hr;
NOTIFICATIONCONDITION nc;
HREGNOTIFY hNotify = NULL;
// Register the phone call calling notification.
// By setting dwMask = SN_PHONEINCOMINGCALL_BITMASK, we will get
a notification only when there is a
// change in the bit indicating whether the phone is currently
getting call.
nc.ctComparisonType = REG_CT_ANYCHANGE;
nc.dwMask = SN_PHONEINCOMINGCALL_BITMASK;
nc.TargetValue.dw = 0;
hr = RegistryNotifyCallback( SN_PHONECALLCALLING_ROOT, //
registry root to monitor
SN_PHONECALLCALLING_PATH, //
registry path to monitor
SN_PHONECALLCALLING_VALUE, //
registry value to monitor
&GetIncommingCallPhoneNumber, //
callback to be called when bit changes
0,
&nc,
&hNotify);
return hr;
}
void CMainFrame::GetIncommingCallPhoneNumber(HREGNOTIFY hNotify, DWORD
dwUserData, const PBYTE pData, const UINT cbData)
{
TCHAR szPhoneNumber[1024];
HRESULT hr =
RegistryGetString( SN_PHONELASTINCOMINGCALLERNUMBER_ROOT,
SN_PHONELASTINCOMINGCALLERNUMBER_PATH,
SN_PHONELASTINCOMINGCALLERNUMBER_VALUE,
szPhoneNumber,
sizeof(szPhoneNumber));
AfxMessageBox(szPhoneNumber, MB_OK);
}
2) MainFrame.h
#include <regext.h>
#include <snapi.h>
add fuction to your mainframe.h
HRESULT RegisterPhoneIncommingCallNotification();
static void GetIncommingCallPhoneNumber(HREGNOTIFY hNotify, DWORD
dwUserData, const PBYTE pData, const UINT cbData);