Hide caption bar

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?
 
F

Fabien

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 :
 
C

cyberco

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top