先要启动蓝牙,再用代码与蓝牙设备建立联接,最后用建立好的拨号连接拨号!
看下代码,有问题直接发我邮件吧:51anygo#gmail.com
a.启动蓝牙,因为没找到API,所以用发消息的方式模拟点击事件,手工启动,代码如下:
void CBlueTooth_WM::ActiveBluetooth(HWND hWnd,BOOL bIsFirst)
{
// MessageBox(hWnd,_T("Find1"),_T("Find1"),MB_OK);
HWND mybthwnd = FindWindow(NULL, _T("BlueTooth"));
if(!mybthwnd)
{
HWND nowforewin=GetFocus();
HWND myyfhwnd = FindWindow(NULL, _T("YFMainMenu"));
if (bIsFirst || nowforewin==myyfhwnd)
{
if(myyfhwnd)
{
{
//BringWindowToTop(myyfhwnd);
//SetForegroundWindow(myyfhwnd);
//PostMessage(nowforewin,WM_QUIT,0,0);
//Sleep(100);
//MessageBox(hWnd,_T("Find1"),_T("Find1"),MB_OK);
//TCHAR szClassName[MAX_PATH]={0};
//wsprintf(szClassName,_T("%x,%x"),nowforewin,myyfhwnd);
//MessageBox(hWnd,szClassName,_T("Find"),MB_OK);
//SetWindowPos(nowforewin,HWND_NOTOPMOST,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE);
//SetWindowPos(myyfhwnd,HWND_TOP,0,0,0,0,SWP_NOMOVE | SWP_NOSIZE);
//SetForegroundWindow(myyfhwnd);
Sleep(100);
SendMessage(myyfhwnd, WM_LBUTTONDOWN, 0, 0x008500BC);
//Sleep(100);
SendMessage(myyfhwnd, WM_LBUTTONUP, 0, 0x008500BC);
int iwait=0;
while(iwait