API Call to switch off the device

Hello everybody!

I'd like to programatically switch of my Mobile Device. I think about a call to a dll file, like you do when you perform a softreset. (coredll.dll)
I know that switching off a device is only possible with a special series.... like the Qtek S100.
Are there any hints

thx in advance & kind regards



Answer this question

API Call to switch off the device

  • Ayooya

    Hi

    Calling this API should do the trick:

    [DllImport ("coredll.dll")]
    private static extern void PowerOffSystem ();

    This works for fine for my i-Mate JASJAR device.



  • SHARANU

    The following thread sould answer your question
    http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=561187&SiteID=1

  • minhnguyen

    Hi,

    I tried both, this:

    [DllImport ("coredll.dll")]
    internal static extern int SetSystemPowerState (string psState, int StateFlags, int Options);
    ...
    SetSystemPowerState(null, POWER_STATE_SUSPEND, POWER_FORCE);

    and this:
    [DllImport("Coredll.dll")]
    private extern static void PowerOffSystem();

    the second does nothing, the first one turns of my Display, which is the same effekt like pushing the power button. With the QTek S200 it is possible to turn the device off when pushing the power button for about 2 seconds. Perhaps I can simulate pressing the hardware button, do you have any hints

    kr & tia


  • Osiris43

    Thank you for the quick answer,
    unfortunately, this call just turns off the display. I'd rather need a command that switches off the device completely, like it does when you press the power button for about 2 seconds.

    thx in advance & kind regards



  • API Call to switch off the device