Hi
How can I minimize application as soon as it starts up to run it at the background in Windows Mobile 6? I want to minimize application it is launch automatically (i.e. auto-starts) and when later, if user wants to see application, it can run from the Program menu etc.
I tried some of the code but it does not work!
Traditional minimize scheme, although it will not solve my problem as using this code will never show the application to the user again (even this code does not work)
private void GUI_Load(object sender, EventArgs e)
{
this.Hide();
this.Visible = false;
}
and second option is to call native API (source: http://www.blondmobile.com/2008/04/windows-mobilec-how-to-minimize-your_5311.html)
private void GUI_Load(object sender, EventArgs e)
{
this.HideApplication();
}
[DllImport("coredll.dll")]
static extern int ShowWindow(IntPtr hWnd, int nCmdShow);
const int SW_MINIMIZED = 6;
public void HideApplication()
{
ShowWindow(this.Handle, SW_MINIMIZED);
}
Second code does work from any other part of the program, but not from Load Event.