B
bhavin
Hi,
I need a application running on the PPC without any interface, like a
windows service. Is it possible in the CF?
Googling for it didn't really give me any relevant tips. So I thought of
creating a Form and the Hiding it in the constructor itself, and then
quietly keep doing what the application needs to do. Not too neat, but would
work I thought.
Wrong!
this.Hide() in the Application (Form) constructor doesnt seem to work for
some reason. Any thing special I need to do here?
If I try doing a this.Hide in a GotFocus event handler, it kind of works
(form dissapears but the main menu, with the keyboard control still shows).
also inside this eventhandler if I have a messagebox, the form doesnt
disappear. I am thinking there is something to do with the screen refresh
maybe.
I've attached the code of a test form I created.
really appreciate any help. on the Service issue, as well as Form hiding.
tia
-bh
********************** code *****************************
public Form1()
{
InitializeComponent();
this.FormBorderStyle = FormBorderStyle.None;
// this.Size = new Size(0,0);
// this.Hide();
this.GotFocus += new EventHandler(Form1_GotFocus);
}
/// <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.Menu = this.mainMenu1;
this.Text = "Form1";
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main()
{
Application.Run(new Form1());
}
private void Form1_GotFocus(object sender, EventArgs e)
{
// MessageBox.Show("got focus");
this.Hide();
}
***************************************************
I need a application running on the PPC without any interface, like a
windows service. Is it possible in the CF?
Googling for it didn't really give me any relevant tips. So I thought of
creating a Form and the Hiding it in the constructor itself, and then
quietly keep doing what the application needs to do. Not too neat, but would
work I thought.
Wrong!
this.Hide() in the Application (Form) constructor doesnt seem to work for
some reason. Any thing special I need to do here?
If I try doing a this.Hide in a GotFocus event handler, it kind of works
(form dissapears but the main menu, with the keyboard control still shows).
also inside this eventhandler if I have a messagebox, the form doesnt
disappear. I am thinking there is something to do with the screen refresh
maybe.
I've attached the code of a test form I created.
really appreciate any help. on the Service issue, as well as Form hiding.
tia
-bh
********************** code *****************************
public Form1()
{
InitializeComponent();
this.FormBorderStyle = FormBorderStyle.None;
// this.Size = new Size(0,0);
// this.Hide();
this.GotFocus += new EventHandler(Form1_GotFocus);
}
/// <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.Menu = this.mainMenu1;
this.Text = "Form1";
}
#endregion
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main()
{
Application.Run(new Form1());
}
private void Form1_GotFocus(object sender, EventArgs e)
{
// MessageBox.Show("got focus");
this.Hide();
}
***************************************************