Guest lduck Posted March 5, 2003 Report Posted March 5, 2003 Hi! :oops: Do you know if i can get the phone number or number of Sim Card in SmartPhone2002 by using API (WinCE 3.0) or some other way(read keys in registry)? Thanks!
Guest spacemonkey Posted March 5, 2003 Report Posted March 5, 2003 There is a program dbview (search this board for it) which demonstrates reading the databases on the smartphone (which I think includes number databases...) Have a look for that and see if it helps point you in the right direction. Otherwise look in the online help in the SDK. I saw some API calls the other day for access the call history, and I'm sure there's others for phone numbers.
Guest benjymous Posted March 5, 2003 Report Posted March 5, 2003 I think the 'POOM' stuff in the sdk is what you want to use (Pocket Outlook something something) - it should let your code interface with pocket outlook and get the data you need
Guest fraser Posted March 5, 2003 Report Posted March 5, 2003 Woah! Is that not a major security risk? Haven't Microsoft learned their lesson yet? User level applications should not be able to access the directory, as it makes virus writing and propagation very easy. Most modern viruses leech your address book to find new targets to mail itself out to. It's also a serious privacy threat with the ever-growing spyware problem.
Guest rcraswell Posted March 5, 2003 Report Posted March 5, 2003 That's the reason behind the security model where apps have to be running in a privileged context to access certain APIs. The fact that they botched the security implementation elsewhere doesn't change the intent. There are two different ways to get data from the SIM card (depending on what data you want.) Take a look at the SIM Manager functions (start with SimInitialize...) -- this will let you read and write data records on the SIM. Also look at the exTAPI functions, especially lineGetGeneralInfo -- this will tell you things like the phone number, the carrier, etc. Note that you may or may not actually be able to get this data from any given SIM. Note also that you must be running as a privileged app to access these functions (in the security model as deployed on an out-of-the-box Orange SPV.)
Guest benjymous Posted March 5, 2003 Report Posted March 5, 2003 Yeah, as far as I know, there's no way (yet) to make Pocket Outlook automatically open an attachment, so a virus would have to use the old "Photos of spacemonkey in his underwear!" rouse. That coupled with the fact that most people don't have smartphones, and most smartphone owners won't have de-certified, I can't imagine a virus being too successful When (If) the time comes that the majority of all phones are microsoft powered, then it'll be a much bigger problem
Guest spacemonkey Posted March 5, 2003 Report Posted March 5, 2003 Underwear? What's that? Anyway, Smartphone 2002 does have a security model where privileged functions will not be accessable to user level applications. However, I think (not sure tho) user level applications can read the address book, however this won't help the virus writer because a user level application will not be able to create emails, sms's, or make calls.
Guest lduck Posted March 6, 2003 Report Posted March 6, 2003 Hi, All: Thanks for your answers! But what i want to know is not the phone numbers in phone book or SMS, but the local number in one Sim card ! Please help me!
Guest rcraswell Posted March 6, 2003 Report Posted March 6, 2003 Right. Once again, you can get the local number by calling lineGetGeneralInfo. --ron
Guest lduck Posted March 6, 2003 Report Posted March 6, 2003 Ok , i got it . But do you mean that "subscriber number" indicate Sim card number?
Guest rcraswell Posted March 6, 2003 Report Posted March 6, 2003 For IMEI and SimSerial, use lineGetGeneralInfo which returns a LPLINEGENERALINFO. dwSubscriberNumber is the phone IMEI. The Sim card serial number is dwSerialNumber. For phone number use lineGetAddressCaps which returns a LPLINEADDRESSCAPS. dwAddressOffset is the phone number.
Guest harshaw Posted March 6, 2003 Report Posted March 6, 2003 You can also use SMSGetPhoneNumber to get the phone number.
Guest lduck Posted March 7, 2003 Report Posted March 7, 2003 Afer my test , i think subscriber number can indicate one special Sim card becase it will be different after i change the Sim card and serial number is still as same as before . And maybe SMSGetPhoneNumber is also useful. Thanks all of you from the bottom of my heart! I think this issue can be closed. :)
Guest Sasa Popovic Posted August 25, 2004 Report Posted August 25, 2004 Hello everyone, I have a problem finding IMEI number on Smartphone. Here is the source code I use to retrive IMEI number: HRESULT hr = S_OK; WCHAR buf[255]; DWORD dwAPIVersion = TAPI_CURRENT_VERSION; LINEINITIALIZEEXPARAMS liparams; liparams.dwTotalSize = sizeof(LINEINITIALIZEEXPARAMS); liparams.dwNeededSize = 0; liparams.dwUsedSize = 0; liparams.dwOptions = LINEINITIALIZEEXOPTION_USEEVENT; liparams.Handles.hEvent = 0; liparams.dwCompletionKey = 0; hr = lineInitializeEx(&m_hLineApp, NULL, NULL, L"MyPhone", &m_dwDeviceCount, &dwAPIVersion, &liparams); hr = lineOpen(m_hLineApp, i, &m_hTestLine, dwAPIVersion, 0, NULL, LINECALLPRIVILEGE_NONE, LINEMEDIAMODE_DATAMODEM, NULL); LINEGENERALINFO lpLineGeneralInfo; memset(lpLineGeneralInfo, 0, sizeof(LINEGENERALINFO)); hr = lineGetGeneralInfo(m_hTestLine, &lpLineGeneralInfo); After the call to "lineGetGeneralInfo", I always get: "LINEERR_INVALPOINTER" error code. Am I doing something wrong? I also tried this (insted of last 3 lines of code): LPLINEGENERALINFO lpLineGeneralInfo = new LINEGENERALINFO; hr = lineGetGeneralInfo(m_hTestLine, lpLineGeneralInfo); I would apreciate any help. Thanks in advance, Sasa
Guest rcraswell Posted August 25, 2004 Report Posted August 25, 2004 you'll want to initialize the LINEGENERALINFO structure. LINEGENERALINFO lpLineGeneralInfo; memset(lpLineGeneralInfo, 0, sizeof(LINEGENERALINFO)); lpLineGeneralInfo.dwTotalSize = sizeof(lpLineGeneralInfo); hr = lineGetGeneralInfo(m_hTestLine, &lpLineGeneralInfo);[/code] Hope that helps.
Guest Sasa Popovic Posted August 25, 2004 Report Posted August 25, 2004 Thank you for such a fast answer! I tried that and the lpLineGeneralInfo.dwTotalSize was filled with a value 52 (13 x 4 bytes). After that I got error code: "LINEERR_OPERATIONUNAVAIL". I tried this on a Smartphone emulator but don't have a device right now. Have I got that error message because I started that application on emulator? Thanks again, Sasa
Guest rcraswell Posted August 26, 2004 Report Posted August 26, 2004 Exactly. The function only works on a real device and will only work under an appropriate security model..
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now