WM中电话相关的技巧

 //启动控制面板中的电话设置
    SHELLEXECUTEINFO info;
    TCHAR szControlPanelCmdLine[ 200 ];
    swprintf( szControlPanelCmdLine, L"\\windows\\cplmain.cpl",20);  //参数20代表调用Phone Setting
    info.cbSize = sizeof( info );
    info.fMask = SEE_MASK_NOCLOSEPROCESS | SEE_MASK_FLAG_NO_UI;
    info.lpVerb = NULL;
    info.lpFile = TEXT("ctlpnl.exe");
    info.lpParameters = szControlPanelCmdLine;
    info.lpDirectory = NULL;
    info.nShow = SW_SHOW;
    info.hInstApp = NULL;
    ShellExecuteEx( &info );

    //拨打电话,提示是否拨号
    PHONEMAKECALLINFO callinfo;
    callinfo.cbSize = sizeof(callinfo);
    callinfo.dwFlags= PMCF_PROMPTBEFORECALLING;//PMCF_DEFAULT
    callinfo.pszDestAddress = L"13411897756";
    PhoneMakeCall(&callinfo);

    //启动拨号界面,(命令行参数,直接拨号)
    SHELLEXECUTEINFO info;
    TCHAR szControlPanelCmdLine[ 200 ];
    swprintf( szControlPanelCmdLine, L"-url tel:13411897756");  //url tel:121
    info.cbSize = sizeof( info );
    info.fMask = SEE_MASK_NOCLOSEPROCESS | SEE_MASK_FLAG_NO_UI;
    info.lpVerb = L"Open";
    info.lpFile = TEXT("cprog.exe");
    info.lpParameters = szControlPanelCmdLine;
    info.lpDirectory = NULL;
    info.nShow = SW_SHOW;
    info.hInstApp = NULL;
    ShellExecuteEx( &info );

你可能感兴趣的:(技巧)