Click to Rate and Give Feedback
MSDN
MSDN Library
Development Guides
Windows API

  Switch on low bandwidth view
Windows API

Purpose

The Microsoft Windows application programming interface (API) provides services used by all Windows-based applications. You can provide your application with a graphical user interface; access system resources such as memory and devices; display graphics and formatted text; incorporate audio, video, networking, or security.

Where Applicable

The Windows API can be used in all Windows-based applications. The same functions are generally supported on 32-bit and 64-bit Windows.

Developer Audience

This API is designed for use by C/C++ programmers. Familiarity with the Windows graphical user interface and message-driven architecture is required.

Run-Time Requirements

For information on which operating systems are required to use a particular function, see the Requirements section of the documentation for the function.

In This Section

TopicDescription

Overview

General information about the Windows API.

What's New

Information about additions to the Windows API.

Reference

Information about the programming elements in the Windows API.

 

See Also

Order a Windows SDK DVD
Windows Developer Center
Windows Server Developer Center
Windows SDK Downloads

Build date: 5/7/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Simple code - caller id - modem      soft12345 ... qingyun   |   Edit   |   Show History
Hope this helps, its better than whats there already.


#include "stdafx.h"
#include <tapi3.h>

int _tmain(int argc, _TCHAR* argv[])
{
HRESULT hr;
ITTAPI * gpTapi;


hr = CoInitialize(NULL);
//if ( CoInitializeEx(NULL,COINIT_MULTITHREADED) != S_OK )
//{
// printf("not initialised");
// return FALSE;
//}
hr = CoCreateInstance(
CLSID_TAPI,
NULL,
CLSCTX_INPROC_SERVER,
IID_ITTAPI,
(LPVOID *)&gpTapi
);
hr = gpTapi->Initialize(); // Initialize TAPI.

if(hr == S_OK)
{
printf("CallerID:");
}
else
{
printf("No Devices");
}
// Pointer to our interface pointer


if ( SUCCEEDED ( hr ) )
{
// Call methods using pISL here.
printf("\n");

//do something useful


// enumerate available addresses.

//ITMediaSupport * pMediaSupport;
VARIANT_BOOL bSupport;
IEnumAddress * pIEnumAddress;
ITAddress * pAddress;

//event

hr = gpTapi->EnumerateAddresses( &pIEnumAddress );
while ( (S_OK == pIEnumAddress->Next(1, &pAddress, NULL) ) )
{
//hr = pAddress->QueryInterface(IID_ITMediaSupport,(void **)&pMediaSupport);
//hr = pMediaSupport->QueryMediaType((TAPIMEDIATYPE_DATAMODEM),&bSupport);
//if (bSupport)
//{
// break;
//}


ITAddressCapabilities * pAddressCaps;
long lType = 0;
BOOL bFoundAddress = FALSE;
hr = pAddress->QueryInterface(IID_ITAddressCapabilities, (void**)&pAddressCaps);

//hr = pAddressCaps->get_AddressCapability( AC_ADDRESSTYPES, &lType );
//hr = pAddressCaps->get_AddressCapability( AC_TRANSFERMODES, &lType );
hr = pAddressCaps->get_AddressCapability( AC_CALLERIDSUPPORT, &lType );



//AC_TRANSFERMODES
pAddressCaps->Release();

if ( SUCCEEDED(hr) )
{
printf("calleridOK ");
//printf(lType);
//printf("code: %d\n", lType);


}


//CAPABILITIES
// typedef enum ADDRESS_CAPABILITY {
// AC_ADDRESSTYPES,...
// AC_CALLERIDSUPPORT,

// ITAddressCapabilities cap;
// cap = pAddress as ITAddressCapabilities;

printf("\n");
}






//end useful code


}
else
{
//Error
printf("(error code %08x)\n", hr);
}

return 0;
}


Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker