Two method : to launch CONTACTS/Calendar/Tasks on Pocket 2003 ~ WM6

static void Launch1(const LPCTSTR pApp, const LPCTSTR pCmd = NULL)
{
    STARTUPINFO si;
    PROCESS_INFORMATION pi;
    ZeroMemory(&si, sizeof(si));
    si.cb = sizeof(si);
    ZeroMemory(&pi, sizeof(pi));
    CreateProcess(pApp, pCmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
}

static void Launch2(const LPCTSTR pPath, const LPCTSTR pParam = NULL)
{
    // Specify an action for the application to perform,
    // flags and other parameters
    SHELLEXECUTEINFO info;
    //TCHAR    buff[256];
    ZeroMemory(&info, sizeof(info));
    info.cbSize = sizeof(info);
    info.fMask = SEE_MASK_FLAG_NO_UI;
    info.hwnd = NULL;
    info.lpVerb = _T("open");
    info.lpFile = pPath;
    info.lpParameters = pParam;
    info.lpDirectory = _T("");
    info.nShow = SW_SHOWNORMAL;
    // Call to perform an action
    ShellExecuteEx(&info);

}

// launch Contacts

Launch1(_T("poutlook.exe"), _T("contacts")); // to run Contacts

Launch2(_T(\Windows\addrbook.lnk)); or Launch2(_T(\Windows\poutlook.exe), _T("contacts"));

// launch Calendar

Launch1(_T("poutlook.exe"), _T("calendar")); // to run Calendar

Launch2(_T(\Windows\caleandar.lnk); or Launch2(_T(\Windows\poutlook.exe), _T("calendar"));// to run Calendar

// launch Tasks

Launch1(_T("poutlook.exe"), _T("task")); // to run Tasks

Launch2(_T(\Windows\tasks.lnk); or Launch2(_T(\Windows\poutlook.exe), _T("tasks"));// to run Tasks

to view shortcut addrbook.lnk file, can see the following

        "21#:MSCONTACTS?outres.dll,-10000"

So Shell should to launch ":MSCONTACTS" program, but it is a special soft-key setting under [HKLMSoftwareMicrosoftShellRai]

 

廣告

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

您的留言將使用 WordPress.com 帳號。 登出 / 變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 / 變更 )

Facebook照片

您的留言將使用 Facebook 帳號。 登出 / 變更 )

Google+ photo

您的留言將使用 Google+ 帳號。 登出 / 變更 )

連結到 %s

%d 位部落客按了讚: