This is for Windows CE Compact Framework.
In the "onLoad" method:
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
To show:
int h = FindWindow ("HHTaskBar", "");
ShowWindow (h, SW_SHOW);
Rectangle rc = this.Bounds;
this.Capture = true;
IntPtr hwnd = GetCapture();
this.Capture = false;
MoveWindow (hwnd, rc.Left, rc.Top, rc.Right, rc.Bottom - taskBarSize, true);
To hide:
int h = FindWindow ("HHTaskBar", "");
ShowWindow (h, SW_HIDE);
Rectangle rc = this.Bounds;
this.Capture = true;
IntPtr hwnd = GetCapture();
this.Capture = false;
MoveWindow (hwnd, rc.Left, rc.Top, rc.Right, rc.Bottom + taskBarSize, true);
where:
private int taskBarSize = 24;
const int SW_HIDE = 0x0000;
const int SW_SHOW = 0x0001;
[DllImport("coredll")]
public static extern IntPtr GetCapture();
[DllImport("coredll.dll")]
public static extern int FindWindow (string lpClassName, string
lpWindowName);
[DllImport("coredll.dll")]
public static extern int ShowWindow (int hwnd, int nTaskShow);
[DllImport("coredll.dll")]
public static extern int MoveWindow(IntPtr hwnd, int X, int Y, int nWidth,
int nHeight, bool bRepaint);
Enjoy!
No comments:
Post a Comment