Windows Mobile full screen

Source: Internet
Author: User

Recently, you need to write a full-screen program. In the past, we used showwindow in wince to hide the taskbar. However, in WM, There Is A Start Menu Bar,

I used a Chinese keyword to Google the circle, but I still did not get it out. I finally found a function shfullscreen with the English keyword. (msdn says this function can be used for wince, but the test failed)

Specific implementation:

Public class Win32
{
[Dllimport ("aygshell. dll")]
Public static extern bool shfullscreen (intptr hwnd, uint dwstate );

// Http://msdn.microsoft.com/en-us/library/aa930139.aspx
Const uint shfs_showtaskbar = 0x1; // taskbar
Const uint shfs_hidetaskbar = 0x2;
Const uint shfs_showsipbutton = 0x4; // Input Method
Const uint shfs_hidesipbutton = 0x8;
Const uint shfs_showstarticon = 0x10; // Start Menu Bar
Const uint shfs_hidestarticon = 0x20;

/// <Summary>
/// Full screen display, that is, hide the taskbar (and start menu bar) of WM and Win CE)
/// </Summary>
/// <Param name = "hwnd"> the form handle to be displayed </param>
/// <Param name = "isfull"> true full screen, false cancel full screen </param>
/// <Returns> </returns>
Public static bool fullscreen (intptr hwnd, bool isfull)
{
Uint dwstate = 0;
If (isfull)
{
Dwstate = shfs_hidetaskbar | shfs_hidesipbutton | shfs_hidestarticon;
}
Else
{
Dwstate = shfs_showtaskbar | shfs_showsipbutton | shfs_showstarticon;
}
Return win32.shfullscreen (hwnd, dwstate );
}

}

 

Form constructor calls:

 

This. windowstate = formwindowstate. maximized; // This sentence cannot be less, and note that the size of the form is the same as that of the screen.
Win32.fullscreen (this. Handle, true); // This example passes the test on Windows Mobile 6.1

 

 

After the form is started, it will be located on the Start menu and taskbar, and it is better than hiding the taskbar, because if the taskbar is hidden, the program will display the taskbar when exiting, it's not good if the program unexpectedly exits.

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.