From http://www.dotblogs.com.tw/larry/archive/2008/10/01/5551.aspx
The method is as follows...
1. enable the full screen of form, This. windowstate = formwindowstate. maximized;
2. Hide control box and minimize/maximize buttons
3. Use the following program to show or hide the start options above the form.
Code
Private const int sw_hide = 0x00;
Private const int sw_show = 0x0001;
[Dllimport ("coredll. dll", charset = charset. Auto)]
Private Static extern intptr findwindow (string lpclassname, string lpwindowname );
[Dllimport ("coredll. dll", charset = charset. Auto)]
Private Static extern bool showwindow (intptr hwnd, int ncmdshow );
[Dllimport ("coredll. dll", charset = charset. Auto)]
Private Static extern bool enablewindow (intptr hwnd, bool enabled );
Public static void showtaskbar ()
{
Intptr H = findwindow ("hhtaskbar ","");
Showwindow (H, sw_show );
Enablewindow (H, true );
}
Public static void hidetaskbar ()
{
Intptr H = findwindow ("hhtaskbar ","");
Showwindow (H, sw_hide );
Enablewindow (H, false );
}
How to hide Start Menu?
Http://forums.microsoft.com/msdn/ShowPost.aspx? Postid = 639012 & siteid = 1
In this way, all the above work columns are removed, which will affect other functions and does not meet my requirements. Then, another method is found to retain the taskbar, start Menu, OK, and X are not displayed.
As a result, this. windowstate = formwindowstate. maximized; do not renew this line,
Otherwise, after show other forms, the task bar on the top of the active node will be invisible.
1. Complete findwindow first
Code
Private const string formwindowclassname = "# netcf_agl_base _";
[Dllimport ("coredll. dll", charset = charset. Auto)]
Private Static extern intptr findwindow (string lpclassname, string lpwindowname );
Private Static intptr findwindow (string a_windowname)
{
Return findwindow (formwindowclassname, a_windowname );
}
2. Unzip showstarticon
Code
Public const int shfs_showtaskbar = 1;
Public const int shfs_hidetaskbar = 2;
Public const int shfs_showsipbutton = 4;
Public const int shfs_hidesipbutton = 8;
Public const int shfs_showstarticon = 16;
Public const int shfs_hidestarticon = 32;
[Dllimport ("aygshell. dll")]
Private extern static bool shfullscreen (intptr hwnd, int dwstate );
Public static bool fullscreen (intptr hwnd)
{
Return shfullscreen (hwnd, shfs_hidestarticon );
}
Public static bool showstarticon (Form a_form, bool a_show)
{
Int32 dwflag = a_show? Shfs_showstarticon: shfs_hidestarticon;
Return shfullscreen (findwindow (a_form.text), dwflag );
}
3. In order to control the active and load events of the form, call showstarticon will be OK.
Private void startform_activated (Object sender, eventargs E)
{
Showstarticon (this, false );
}