Click here to Skip to main content
6,822,123 members and growing! (17,506 online)
Email Password   helpLost your password?
Platforms, Frameworks & Libraries » Mobile Development » Dialogs and Windows     Intermediate

Fullscreen Windows In Windows CE

By Barney L. Parker

Fullscreen Windows in Windows CE Without using SHFullScreen
C++, Windows, WinMobile, Mobile, Visual-Studio, Dev
Posted:2 Sep 2006
Views:39,386
Bookmarked:30 times
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
10 votes for this article.
Popularity: 3.34 Rating: 3.34 out of 5

1
2 votes, 20.0%
2
2 votes, 20.0%
3
4 votes, 40.0%
4
2 votes, 20.0%
5

Introduction

The usual method of creating a full screen window in Windows CE involves using the function SHFullScreen. This article describes a method of creating full screen windows with standard window management calls.

The Variables

HWND hWnd;                     // The main window handle


HWND hWndInputPanel = NULL;    // The SIP

HWND hWndTaskBar    = NULL;    // The TaskBar

HWND hWndSipButton  = NULL;    // The SIP Button


BOOL mode = false;             // Our current window mode.  

                               //  True = Fullscreen

                               //  False - Windowed (Startup Default)

Finding the Window Information

The first step is to find the handles of the three main windows that handle the TaskBar, Standard Input Panel (SIP) and SIP Button Bar. This should be done early on in the application during initialization.

void InitFullScreen (void)
{
    hWndInputPanel = FindWindow(TEXT("SipWndClass"), NULL);
    hWndSipButton = FindWindow(TEXT("MS_SIPBUTTON"), NULL);
    hWndTaskBar = FindWindow(TEXT("HHTaskBar"), NULL);
}

Toggling Between The Two Modes

Toggling between the two modes is a simple matter of setting the windows states, and sizing our window appropriately.

To Enter Fullscreen mode we use ShowWindow(HWND,SW_HIDE) on each of the system windows.

To Exit Fullscreen mode we use ShowWindow(HWND,SW_SHOW) on each of the system windows. This will however also show the input panel, which is not desirable, so hWndInputPanel should be ignored.

Sizing the window to the correct size involves a different system call depending on whether you are entering or exiting Fullscreen Mode.

Entering Fullscreen mode we call SetWindowPos(hWnd... using the results from a GetSystemMetrics call.

Exiting Fullscreen mode we call SetWindowPos(hWnd... using the results from a SystemParametersInfo(... call.

void ToggleFullScreen()
{
    RECT rtDesktop;

    if (mode)
    {
        if(hWndTaskBar != NULL)        
        ShowWindow(hWndTaskBar, SW_SHOW);
        //if(hWndInputPanel != NULL)    

        ShowWindow(hWndInputPanel, SW_SHOW);
        //Never forcibly show the input panel

        if(hWndSipButton != NULL)    
        ShowWindow(hWndSipButton, SW_SHOW);

        if(SystemParametersInfo(SPI_GETWORKAREA, 0, &rtDesktop, NULL) == 1)
            SetWindowPos(hWnd,HWND_TOPMOST,0,0,rtDesktop.right - 
        rtDesktop.left,rtDesktop.bottom - rtDesktop.top, SWP_SHOWWINDOW);

        mode = false;
    }
    else
    {
        if (hWndTaskBar != NULL)    ShowWindow(hWndTaskBar, SW_HIDE);
        if (hWndInputPanel != NULL)    ShowWindow(hWndInputPanel, SW_HIDE);
        if (hWndSipButton != NULL)    ShowWindow(hWndSipButton, SW_HIDE);

        SetWindowPos(hWnd,HWND_TOPMOST,0,0,GetSystemMetrics(SM_CXSCREEN),
                GetSystemMetrics(SM_CYSCREEN), SWP_SHOWWINDOW);

        mode = true;
    }
}

Points of Interest

Changing to a fullscreen window is surprisingly simple. There are functions in .NET and MFC which do the same thing, however for extra performance, nothing beats standard Win32 functions!

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Barney L. Parker


Member

Location: United Kingdom United Kingdom

Other popular Mobile Development articles:

  • Writing Your Own GPS Applications: Part 2
    In part two of the series, the author of "GPS.NET" teaches developers how to write GPS applications suitable for the real world by mastering GPS precision concepts. Source code includes a working NMEA interpreter and sample high-precision application in C# and VB.NET.
  • Writing Your Own GPS Applications: Part I
    What is it that GPS applications need to be good enough to use for in-car navigation? Also, how does the process of interpreting GPS data actually work? In this three-part series, I will cover both topics and give you the skills you need to write a commercial-grade GPS application.
  • Learn How to Find GPS Location on Any SmartPhone, and Then Make it Relevant
    A step by step tutorial for getting GPS from any SmartPhone, even without GPS built in, and then making location useful.
  • Windows Mobile, iPhone, Android - Marketplace Comparison
    Detailed comparison between Windows Mobile Marketplace, Apple's iPhone AppStore and Android Market from developer point of view.
  • iPhone UI in Windows Mobile
    It's an interface that works with transparency effects. As a sample I used an interface just like the iPhone one. In this tutorial I am explaining how simple is working with transparency on Windows Mobile.
Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 9 of 9 (Total in Forum: 9) (Refresh)FirstPrevNext
GeneralNice, a suggestion for WM5 Pinmembertrevor.hart15:54 5 Sep '06  
GeneralRe: Nice, a suggestion for WM5 PinmemberBarney L. Parker13:13 6 Sep '06  
QuestionWhy ? PinsupporterAlain Rist23:34 3 Sep '06  
AnswerRe: Why ? PinmemberBarney L. Parker23:40 4 Sep '06  
GeneralRe: Why ? PinsupporterAlain Rist4:39 5 Sep '06  
AnswerRe: Why ? Pinmemberdimi21:02 5 Sep '06  
GeneralRe: Why ? PinsupporterAlain Rist21:47 5 Sep '06  
GeneralWinCE 4.2 Pinmemberalpor0:18 22 Nov '08  
GeneralRe: WinCE 4.2 Pinmemberzhangjingfei2:12 18 Jan '10  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads.

PermaLink | Privacy | Terms of Use
Last Updated: 2 Sep 2006
Editor: Deeksha Shenoy
Copyright 2006 by Barney L. Parker
Everything else Copyright © CodeProject, 1999-2010
Web10 | Advertise on the Code Project