Click here to Skip to main content
15,896,557 members
Articles / Mobile Apps

Automatically Starting Your Application on Windows Mobile

Rate me:
Please Sign up or sign in to vote.
4.92/5 (26 votes)
31 Jul 2008CPOL10 min read 218.7K   2.4K   135  
An article discussing the various methods that you can use to automatically start an application on Windows Mobile, either by schedule or in reaction to a system event.
namespace TimedStart
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;
        private System.Windows.Forms.MainMenu mainMenu1;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            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.label1 = new System.Windows.Forms.Label();
            this.startTimeOut = new System.Windows.Forms.NumericUpDown();
            this.menuItemExitWithRestart = new System.Windows.Forms.MenuItem();
            this.menuItemQuit = new System.Windows.Forms.MenuItem();
            this.SuspendLayout();
            // 
            // mainMenu1
            // 
            this.mainMenu1.MenuItems.Add(this.menuItemExitWithRestart);
            this.mainMenu1.MenuItems.Add(this.menuItemQuit);
            // 
            // label1
            // 
            this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.label1.Location = new System.Drawing.Point(3, 0);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(234, 20);
            this.label1.Text = "Start Delay (seconds)";
            // 
            // startTimeOut
            // 
            this.startTimeOut.Location = new System.Drawing.Point(3, 24);
            this.startTimeOut.Maximum = new decimal(new int[] {
            300,
            0,
            0,
            0});
            this.startTimeOut.Name = "startTimeOut";
            this.startTimeOut.Size = new System.Drawing.Size(136, 22);
            this.startTimeOut.TabIndex = 1;
            this.startTimeOut.Value = new decimal(new int[] {
            15,
            0,
            0,
            0});
            // 
            // menuItemExitWithRestart
            // 
            this.menuItemExitWithRestart.Text = "&Accept";
            this.menuItemExitWithRestart.Click += new System.EventHandler(this.menuItemExitWithRestart_Click);
            // 
            // menuItemQuit
            // 
            this.menuItemQuit.Text = "Quit";
            this.menuItemQuit.Click += new System.EventHandler(this.menuItemQuit_Click);
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
            this.AutoScroll = true;
            this.ClientSize = new System.Drawing.Size(240, 268);
            this.Controls.Add(this.startTimeOut);
            this.Controls.Add(this.label1);
            this.Menu = this.mainMenu1;
            this.Name = "Form1";
            this.Text = "Form1";
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.MenuItem menuItemExitWithRestart;
        private System.Windows.Forms.MenuItem menuItemQuit;
        private System.Windows.Forms.NumericUpDown startTimeOut;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
United States United States
I attended Southern Polytechnic State University and earned a Bachelors of Science in Computer Science and later returned to earn a Masters of Science in Software Engineering. I've largely developed solutions that are based on a mix of Microsoft technologies with open source technologies mixed in. I've got an interest in astronomy and you'll see that interest overflow into some of my code project articles from time to time.



Twitter:@j2inet

Instagram: j2inet


Comments and Discussions