Peter__123

When I switch on the phone programmatically on a Windows Mobile 5 device I always get the "Enter PIN" dialog appearing. I subsequently unlock the SIM card myself using SimUnlockPhone since the user may not have the SIM card PIN themselves.

Is there any way of hiding this dialog, or is my only option to click on the "Cancel" button

Many thanks,

Peter



Re: Smart Devices Native C++ Development GetWirelessDevices / PIN Dialog

Sean Y Xia

Hi, Peter,

I think you can disable SIM PIN in setting. For SP: start menu->settings->security->Disable SIM PIN

Thanks

Sean





Re: Smart Devices Native C++ Development GetWirelessDevices / PIN Dialog

Peter__123

Should anyone else be attempting this, the only workaround I have found so far is to pick a window in my app and set this to the top of the Z-order before the phone application kicks in. Disabling the SIM security is also not possible unfortunately.

This works for me since we attempt to take control of the phone, but on exit the prompt for the PIN is still visible when our application closes. I have not gone down the route of programatically clicking on the cancel "button" on the SIM entry dialog since it is not a button as such and uses a different UI to the standard phone dialog.

Peter





Re: Smart Devices Native C++ Development GetWirelessDevices / PIN Dialog

znyx

Hi,

could you post the code how you unlock the sim card by using SimUnlockPhone I tried it myself, but it doesn't work.....

thx





Re: Smart Devices Native C++ Development GetWirelessDevices / PIN Dialog

Peter__123

No problem, the code is very simple. You must check that the phone has power on first:

LPWSTR simPIN = L"1234";

....

HSIM hSim;

HRESULT resOK = SimInitialize (0,NULL,0,&hSim);

if (resOK == S_OK)

{

resOK = SimUnlockPhone(hSim, simPIN, NULL);

SimDeinitialize(hSim);

}// End if : SimInitializeOK

Cheers,


Peter





Re: Smart Devices Native C++ Development GetWirelessDevices / PIN Dialog

znyx

Hi Peter,

thx for ur reply !

Well, this is what I already tried and what should I say, without knowing it already worked.

The thing is, that after the SIM unlock the device is still not connected to a provider.

I have to go into the phone's options to push the network connect manually though

'automatic network search' is checked....

If I dont, the device pretends to lookup for a network connection (antenna symbol with dots) but never gets connected so that I could make a call or a.e.

Do you know how I could programatically push a provider lookup / connect Or am I missing a point

thx in advance,

znyx