. Net CF how to enable the full form screen to show the top working column (taskbar)

Source: Internet
Author: User
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 );
}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.