vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
sevAniGif - als kostenlose Vollversion auf unserer vb@rchiv CD Vol.5  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2025
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

VB.NET - Fortgeschrittene
Re: Pocket PC Aktivieren 
Autor: Milan
Datum: 14.11.04 12:01

Den Code habe ich mal gefunden ist aber leider in C#! Schau mal bei opennetcf.com vorbei. Solltest Du mal einige Interessante Sachen zum PPC finden, dann lass es mich wissen. Das aktivieren des PPC ist laut opennetcf.com nicht möglich!

using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Threading;
 
namespace DisplayOff
{
	/// <summary>
	/// Summary description for Form1.
	/// </summary>
	public class Form1 : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Button button1;
		private System.Windows.Forms.MainMenu mainMenu1;
 
		public Form1()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
 
			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			base.Dispose( disposing );
		}
		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.mainMenu1 = new System.Windows.Forms.MainMenu();
			this.button1 = new System.Windows.Forms.Button();
			// 
			// button1
			// 
			this.button1.Location = new System.Drawing.Point(24, 16);
			this.button1.Size = new System.Drawing.Size(192, 24);
			this.button1.Text = "Turn display off for 5 sec";
			this.button1.Click += new System.EventHandler(this.button1_Click);
			// 
			// Form1
			// 
			this.Controls.Add(this.button1);
			this.Menu = this.mainMenu1;
			this.MinimizeBox = false;
			this.Text = "Form1";
 
		}
		#endregion
 
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
 
		static void Main() 
		{
			Application.Run(new Form1());
		}
 
		private void button1_Click(object sender, System.EventArgs e)
		{
			IntPtr hDC = GetDC(IntPtr.Zero);
			int Esc = QUERYESCSUPPORT;
			//if ( ExtEscape(hDC, QUERYESCSUPPORT, Marshal.SizeOf(Esc.GetType()), ref _
  Esc, 0, IntPtr.Zero ) == IntPtr.Zero )
			//{
			//	MessageBox.Show("This device does not support display power on/off");
			//}
			//else
			//{
				int[] vpm = new int[3];
				vpm[0] = 3 * Marshal.SizeOf(typeof(int));
				vpm[1] = 1;
				vpm[2] = (int)VIDEO_POWER_STATE.VideoPowerOff;
				ExtEscape(hDC, SETPOWERMANAGEMENT, vpm[0], vpm, 0, IntPtr.Zero);
				Thread.Sleep(1000);
				vpm[2] = (int)VIDEO_POWER_STATE.VideoPowerOn;
				ExtEscape(hDC, SETPOWERMANAGEMENT, vpm[0], vpm, 0, IntPtr.Zero);
			//}
			ReleaseDC(IntPtr.Zero, hDC);
		}
 
		[DllImport("coredll")]
		extern static IntPtr GetDC(IntPtr hWnd);
		[DllImport("coredll")]
		extern static void ReleaseDC(IntPtr hWnd, IntPtr hDC);
		[DllImport("coredll")]
		extern static IntPtr ExtEscape(IntPtr hDC, int Esc, int cbInData, int[] _
  InData, int cbOutData, IntPtr OutData);
		[DllImport("coredll")]
		extern static IntPtr ExtEscape(IntPtr hDC, int Esc, int cbInData, ref int _
  InData, int cbOutData, IntPtr OutData);
 
		enum VIDEO_POWER_STATE 
		{
			VideoPowerOn = 1,
			VideoPowerStandBy,
			VideoPowerSuspend,
			VideoPowerOff
		}
 
		const int SETPOWERMANAGEMENT   = 6147;
		const int QUERYESCSUPPORT   = 8;
	}
}
alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
Pocket PC Aktivieren802L.B.14.11.04 10:05
Re: Pocket PC Aktivieren566Milan14.11.04 12:01

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2025 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel