开发者

Relying on PR_DISPLAY_NAME property for "SMS" and "ActiveSync" named message stores

开发者 https://www.devze.com 2023-02-05 05:57 出处:网络
I\'m trying to find out the type of message store on windows mobile devices (version 6.1 & 6.5). More specifically I\'m trying to figure out if a message store is of type \"Exchange (ActiveSync)\

I'm trying to find out the type of message store on windows mobile devices (version 6.1 & 6.5).

More specifically I'm trying to figure out if a message store is of type "Exchange (ActiveSync)" and NOT SMS or other E-Mail account type (POP3, IMAP etc).

I'm relying on the fact that the value returned for property PR_DISPLAY_NAME for SMS Store is "SMS" and for Exchange Store is "ActiveSync".

My question is, can I rely on these values to determine the message-store type? Is there a better way to achieve this?

Following is the pseudo-code depicting my logic:

 bool isActiveSyncSet = areAnySyncAccountSet(); // I use Sync configuration service
                                                // provider to check if any ActiveSync accounts are set.

// Initialize MAPI and fetch all stores
while(we_have_stores) {

    // Open Current Store
    openCurrentStore(&currentStore);

    string storeName = fetchStoreName(currentStore); // using GetProps method fetch PR_DISPLAY_NAME

    if(storeName == "SMS" ) continue;
    if(isActiveSyncSet && storeName == "ActiveSync") {
          // We got the Exchange M开发者_运维问答essage Store
          break;
    } else {
          // We have an E-Mail store but not an ActiveSync one
    }
}


After a lot of offline research and testing the string returned on lots of different devices[1], I've come to the conclusion that:

One can rely on the string "ActiveSync" being returned for PR_DISPLAY_NAME property of a message store to identify it as an ActiveSync Exchange Message store. This message store is displayed as Outlook E-Mail on the device UI. This is true for 6.1 and 6.5 devices at least. I did not test on Windows 7 phone, as that is not the target audience for my app[2].

Hope this helps anyone doing similar stuff.

[1] Devices that I tested were from different Vendors(HTC, LG, Samsung), so I'm pretty confident this should hold true for obscure devices running Windows Mobile 6.1 or 6.5 OS.
[2] Please feel free to add info about Windows 7 phones, if you have one or have access to one. (I'm not sure if they still have MAPI still on those phones).


I don't have much experience with Windows Mobile, but why can't you check the PR_MDB_PROVIDER property?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号