Disabling top line in Win Mobile 2003

Hi.

I'm using CF 2.0 under Win Mobile 2003.

Could you tell me how I can disable top line (which consist of StartMenu, time, some connection logos, etc...)

I execute some programms from my programm and I don't want users to switch to another ones before they exit executed.

Thank you very much!



Answer this question

Disabling top line in Win Mobile 2003

  • cmaro84

    Can someone explain to me why the solution isn't windowstate=maximized

  • Rick T

    I can do windowstate=maximized for forms I've created but It doesn't work with other application's forms (I run applications whith Process.Start() function). And now I maximize them whith FindWindow and SHFullScreen functions.
  • gdumazet

    Thank you very much! That's really what I looked for!


  • Karl S

    Try this snipset

    public class SHAPI
    {
    public const int SHFS_SHOWTASKBAR = 1;
    public const int SHFS_HIDETASKBAR = 2;
    public const int SHFS_SHOWSIPBUTTON = 4;
    public const int SHFS_HIDESIPBUTTON = 8;
    public const int SHFS_SHOWSTARTICON = 16;
    public const int SHFS_HIDESTARTICON = 32;

    [DllImport("aygshell.dll")]
    private extern static bool SHFullScreen(IntPtr hWnd, int dwState);

    public static bool FullScreen(IntPtr hWnd)
    {
    return SHFullScreen(hWnd, SHFS_HIDESTARTICON | SHFS_HIDETASKBAR);
    }

    [DllImport("coredll.dll")]
    internal static extern int SetForegroundWindow(IntPtr hWnd);

    }

    public class API
    {
    [DllImport("coredll.dll", EntryPoint = "FindWindow")]
    private extern static IntPtr FindWindow(string lpClassName, string
    lpWindowName);

    public static IntPtr FindWindow(string windowName)
    {
    return FindWindow(null, windowName);
    }
    }

    //use the code code above like that
    private void Form1_Load(object sender, EventArgs e)
    {
    this.WindowState = FormWindowState.Maximized;
    IntPtr hWnd = API.FindWindow(this.Text);
    if (hWnd != IntPtr.Zero)
    {
    this.MaximizeBox = false;

    this.MinimizeBox = false;

    this.Focus();

    SHAPI.SetForegroundWindow(hWnd);
    SHAPI.FullScreen(hWnd);
    }
    }

    However you should also disable the hardware keys in order to prevent user from switching to another application. See if the following posts may help:
    http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/search group=microsoft.public.dotnet.framework.compactframework&q=disable+hardware+keys&qt_g=1&searchnow=Search+this+group




  • kamal101

  • Disabling top line in Win Mobile 2003