How to hide the taskbar in WinCe? (not pocket pc)

  • Thread starter Thread starter Dante
  • Start date Start date
D

Dante

I'm using Windows CE 4.2 (not Pocket Pc) and i need to
know how to hide the task bar completly. I figured out how
to set the task bar to Auto Hide, but a small portion of
it still shows and users are able to click the task bar
and get it to popup. I need to be able to hide it
completly so users can't get to it.
 
I don't have code handy, but use FindWindow to find the handle, Use
SetWindowLong or similar to set it's visible property to false, then resize
your form to cover then entire screen.
 
This code works for me:

[DllImport("coredll.dll")]
public static extern IntPtr FindWindow( string className, string
windowName );
private const int SW_HIDE = 0x00;

IntPtr taskBarHWnd = FindWindow( "HHTaskBar", string.Empty );
ShowWindow( taskBarHWnd, SW_HIDE );

HTH,

Bogdan
 
Sorry, I left out the import for ShowWindow:

[DllImport("coredll.dll")]
public static extern bool ShowWindow( IntPtr hWnd, int cmdShow );
private const int SW_HIDEWINDOW = 0x0000;
private const int SW_SHOWNORMAL = 0x0001;


Bogdan Sima said:
This code works for me:

[DllImport("coredll.dll")]
public static extern IntPtr FindWindow( string className, string
windowName );
private const int SW_HIDE = 0x00;

IntPtr taskBarHWnd = FindWindow( "HHTaskBar", string.Empty );
ShowWindow( taskBarHWnd, SW_HIDE );

HTH,

Bogdan

Dante said:
I'm using Windows CE 4.2 (not Pocket Pc) and i need to
know how to hide the task bar completly. I figured out how
to set the task bar to Auto Hide, but a small portion of
it still shows and users are able to click the task bar
and get it to popup. I need to be able to hide it
completly so users can't get to it.
 
I tried the code mentioned earlier in the thread. It appears the
taskbar window handle is correctly found, but the showwindow call
returns false and does not hide the taskbar, at least in the emulator.
I'm working with the Compact Framework in VS 2003.



[DllImport("coredll.dll")]
private static extern IntPtr FindWindow(string lpClassName, string
lpWindowName);

[DllImport("coredll.dll")]
private static extern bool ShowWindow(IntPtr hWnd, int cmdShow );
private const int SW_HIDE = 0x0000;
private const int SW_SHOW = 0x0001;

private IntPtr hTaskBar;

private void frmMain_Load(object sender, System.EventArgs e)
{
hTaskBar = FindWindow("HHTaskBar", string.Empty);
//following does not seem to work in emulator
bool b = ShowWindow(hTaskBar, SW_HIDE);
//b comes up false
this.WindowState = FormWindowState.Maximized;
}
 
I use this piece of code on my Symbol PPT 8800 (running Windows CE.NET 4.1):

[DllImport("coredll.dll", CharSet=CharSet.Auto)]
public static extern int FindWindow(string lpClassName, string lpWindowName);
[DllImport("coredll.dll", CharSet=CharSet.Auto)]
public static extern bool ShowWindow(int hwnd, int nCmdShow);
[DllImport("coredll.dll", CharSet=CharSet.Auto)]
public static extern bool EnableWindow(int hwnd, bool enabled);

private void FrmMain_Load(object sender, System.EventArgs e)
{
int h = FindWindow("HHTaskBar", "");
ShowWindow(h, 0);
EnableWindow(h, false);
this.WindowState = FormWindowState.Maximized;
Update();
this.Height = Screen.PrimaryScreen.Bounds.Height;
Update();
}

Good luck.
Nicolas.
 
Back
Top