R
Rüdiger Kardel
this one is driving me crazy:
I'm just porting an old app from CF 1.0 (VS2003) to CF 2.0 (VS2008)
OS CE 4.2
as in the past I'm hiding the taskbar with:
public static void TaskbarOff()
{
int h = FindWindow("HHTaskBar", "");
ShowWindow(h, SW_HIDE);
EnableWindow(h, false);
}
and afterwards the form is resized:
public void Fullscreen(Form form)
{
form.Capture = true;
IntPtr hwnd = GetCapture();
form.Capture = false;
form.WindowState = FormWindowState.Maximized; // ** here's the problem **
SetWindowPos(hwnd,
SetWindowPosZOrder.HWND_TOPMOST, 0, 0,
Screen.PrimaryScreen.Bounds.Width,
Screen.PrimaryScreen.Bounds.Height, 0);
form.Update();
}
when we use "FormWindowState.Normal" everything works as expected.
Using "FormWindowState.Maximized" the area of the hidden taskbar is not used
by the form.
Even moving the taskbar out of the screen area did not help.
What's wrong with the above code? Did work as expected under CF1.
It seems that the behavior of
"form.WindowState = FormWindowState.Maximized;"
changed from CF1 to CF2.
Is there an alternative to prevent the user from moving forms around?
regards
Ruediger
I'm just porting an old app from CF 1.0 (VS2003) to CF 2.0 (VS2008)
OS CE 4.2
as in the past I'm hiding the taskbar with:
public static void TaskbarOff()
{
int h = FindWindow("HHTaskBar", "");
ShowWindow(h, SW_HIDE);
EnableWindow(h, false);
}
and afterwards the form is resized:
public void Fullscreen(Form form)
{
form.Capture = true;
IntPtr hwnd = GetCapture();
form.Capture = false;
form.WindowState = FormWindowState.Maximized; // ** here's the problem **
SetWindowPos(hwnd,
SetWindowPosZOrder.HWND_TOPMOST, 0, 0,
Screen.PrimaryScreen.Bounds.Width,
Screen.PrimaryScreen.Bounds.Height, 0);
form.Update();
}
when we use "FormWindowState.Normal" everything works as expected.
Using "FormWindowState.Maximized" the area of the hidden taskbar is not used
by the form.
Even moving the taskbar out of the screen area did not help.
What's wrong with the above code? Did work as expected under CF1.
It seems that the behavior of
"form.WindowState = FormWindowState.Maximized;"
changed from CF1 to CF2.
Is there an alternative to prevent the user from moving forms around?
regards
Ruediger