Full question:
Hi folk,
This is Rakesh working with Windows Mobile 2005 using C#. I have few basic and I spent around a week on this so had nice thought to write U all.
My all doubt is related to Windows Mobile 2005(WM5) with C# and I m using the device Treo 700W.
1 .How to know the running instance. Simply I want to run only one instance of my application on device.
2. How to run an application in unattended mode.
I have written a SMS listener using SNB in managed code(C#). But I have done the same using a windows form, I want this application to be run unattended, I do not wanted to show my form to the user.
Simply I want this SMS listener running as a service as our SQL Mobile runs in background. It would be very helpful if I get the code in C#
On Form Load this.Visible = false; does not work at all, forms come as popup in full screen.
3.How to do Hard reset of the device through code. Do not ask the need, I have identified the need( for theft protection) I will push the same form the server. I have tried with the following code but it does only soft reset...
[DllImport("Coredll.dll")]
extern static int KernelIoControl(int dwIoControlCode,
IntPtr lpInBuf,
int nInBufSize,
IntPtr lpOutBuf,
int nOutBufSize,
ref int lpBytesReturned);
[DllImport("Coredll.dll")]
extern static void SetCleanRebootFlag();
public static void ResetDevice(bool l_Is_HardReset)
{
int IOCTL_HAL_REBOOT = 0x101003C;
int bytesReturned = 0;
if (l_Is_HardReset == true)
{
SetCleanRebootFlag();
}
KernelIoControl(IOCTL_HAL_REBOOT, IntPtr.Zero, 0, IntPtr.Zero, 0, ref bytesReturned);
}
Even though I pass true to this function, it does only soft reset. Please let me know where and what I am missing. I m using Treo 700W device for the development.
Please let me what other information you guys need from me to sole these. I have more Q to ask but all these on priority.
For my development I m targeting 15,000 device so I request u all to help me in this regard.
Thanks in anticipation.
Thanks & regards,
Rakesh Ranjan