/// <summary> /// Requests that the Power Manager change the power state of a device. /// </summary> /// <param name="deviceName">Specifies the device name, for example, COM1:.</param> /// <param name="deviceState">Indicates the device power state</param> /// <returns>Win32 error code</returns> /// <remarks>Should be used with extreme care since it may result in an unexpected /// application or system behavior.</remarks> public int DevicePowerNotify(string deviceName, DevicePowerStates deviceState) { uint nError = 0; nError = CEDevicePowerNotify(deviceName, (uint)deviceState, (uint)PowerReqFlags.POWER_NAME); return((int)nError); }
/// <summary> /// Requests that the Power Manager change the power state of a device. /// </summary> /// <param name="deviceName">Specifies the device name, for example, COM1:.</param> /// <param name="deviceState">Indicates the device power state</param> /// <returns>Win32 error code</returns> /// <remarks>Should be used with extreme care since it may result in an unexpected /// application or system behavior.</remarks> public int DevicePowerNotify(string deviceName, DevicePowerStates deviceState) { uint nError = 0; nError = CEDevicePowerNotify(deviceName, (uint)deviceState, (uint)PowerReqFlags.POWER_NAME); return (int)nError; }