WEB开发网
开发学院手机开发Windows Mobile 开发 Windows mobile PPC 下利用 tmail.exe 发送短信、... 阅读

Windows mobile PPC 下利用 tmail.exe 发送短信、彩信、邮件

 2010-03-18 21:22:00 来源:WEB开发网   
核心提示:strContent = _T("-service \"MMS\"");if (tData.lpTo != NULL){strTmp = tData.lpTo;if (!strTmp.IsEmpty()){strTmp.Replace(_T("\""

strContent = _T("-service \"MMS\"");

if (tData.lpTo != NULL)

{

strTmp = tData.lpTo;

if (!strTmp.IsEmpty())

{

strTmp.Replace(_T("\""),_T("\\""));

strFormat.Format(_T(" -to \"%s\""),strTmp);

strContent += strFormat;

}

}

if (tData.lpSubject != NULL)

{

strTmp = tData.lpSubject;

if (!strTmp.IsEmpty())

{

strTmp.Replace(_T("\""),_T("\\""));

strFormat.Format(_T(" -subject \"%s\""),strTmp);

strContent += strFormat;

}

}

if (tData.lpBody != NULL)

{

strTmp = tData.lpBody;

if (!strTmp.IsEmpty())

{

strTmp.Replace(_T("\""),_T("\\""));

strFormat.Format(_T(" -body \"%s\""),strTmp);

strContent += strFormat;

}

}

if (tData.lpAttach != NULL)

{

strTmp = tData.lpAttach;

if (!strTmp.IsEmpty())

{

strTmp.Replace(_T("\""),_T("\\""));

strFormat.Format(_T(" -attach \"%s\""),strTmp);

strContent += strFormat;

}

}

if (Run(strContent))

{

return TMAIL_SUCCESS;

}

else

{

DWORD deError = GetLastError();

return (TMAIL_ERROR)deError;

}

}

BOOL CTmailPanel::Run(CString strParameter)

{

SHELLEXECUTEINFO lpExecInfo = {0};

lpExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);

lpExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;

lpExecInfo.lpVerb = L"Open";

lpExecInfo.hwnd = NULL;

lpExecInfo.lpFile = L"tmail.exe";

lpExecInfo.lpDirectory = L"\windows";

lpExecInfo.nShow = SW_SHOW;

lpExecInfo.lpParameters = strParameter.GetBuffer();

lpExecInfo.hInstApp = NULL;

BOOL bRet = ShellExecuteEx(&lpExecInfo);

WaitForSingleObject(lpExecInfo.hProcess,INFINITE);

strParameter.ReleaseBuffer();

return bRet;

}

上一页  1 2 3 4 5 

Tags:Windows mobile PPC

编辑录入:coldstar [复制链接] [打 印]
赞助商链接