Hide caption bar

  • Thread starter Thread starter cyberco
  • Start date Start date
C

cyberco

(WM5 PPC)
Using the designer I am able to hide the caption bar (top bar), but
when returning from another application that was started by my
application, the caption bar reappears. Resetting the WindowState to
FormWindowState.Maximized when the Form regains focus changes nothing.

public partial class MainForm : Form {
protected override void OnGotFocus(System.EventArgs e) {
this.WindowState = FormWindowState.Maximized;
}
}

This only happens when returning from other applications, not when
returning from other screens in the same application.

What can I do to always hide the caption bar?
 
Hi,

Try to hide your start bar :
ShowWindow( FindWindow( _T("HHTaskBar"), _T("") ),
SW_HIDE);
If you use C# you can import this function with a dllImport and it
works fine too.


BR


Fabien Decret
Windows Embedded Consultant


ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/



cyberco a écrit :
 
That works, thanks! What I did for C# was:

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

[DllImport("coredll.dll")]
private static extern IntPtr ShowWindow(IntPtr hWnd, int visible);

ShowWindow(FindWindow("HHTaskBar", null), 0); //0=hide, 1=show
 
Back
Top