ppclib.cs

来自「c# 基于windows mobile 访问基站信息源程序」· CS 代码 · 共 49 行

CS
49
字号
using System;
using System.Runtime.InteropServices;

namespace NiceTracker
{
	/// <summary>
	/// Summary description for PPCLib.
	/// </summary>
	public class PPCLib
	{
		[DllImport("coredll.dll")]
		private static extern bool SipShowIM(int dwFlag);
		
		public enum PowerState 
		{
			PwrDeviceUnspecified = -1,		
			FullOn = 0,		// Full on
			LowOn = 1,		// Low on
			Standby = 2,	// Standby
			Sleep = 3,		// Sleep
			Off = 4,		// Off
			PwrDeviceMaximum = 5 
		};

		[DllImport("coredll.dll")]
		private static extern int DevicePowerNotify( string device, PowerState deviceState, int deviceFlags );

		public PPCLib()
		{
		}

		public static bool ShowSip
		{
			set
			{
				if ( value )
					SipShowIM( 1 );
				else
					SipShowIM( 0 );
			}
		}

		public static void SetBacklight( PowerState pwr )
		{
			DevicePowerNotify( "BKL1:", pwr, 1 );
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?