65.9K
CodeProject is changing. Read more.
Home

Full screen feature in .NET Compact Framework

starIconstarIconstarIconstarIconemptyStarIcon

4.00/5 (8 votes)

Mar 14, 2005

CPOL
viewsIcon

134899

downloadIcon

881

Enable full screen mode in .NET compact framework applications.

Introduction

This was the conversion from my previous posted topic Having full screen without accessing the SHFullScreen API. Basically, it remain accessing the same set of native API by means of p/invoke (Platform Invoke).

  • FindWindow
  • MoveWindow
  • GetWindowRect
  • SystemParametersInfo

Using the code

In this conversion, I moved the InitFullScreen and DoFullScreen function into a new class FSEngine. Therefore, all you need to do are the below three steps, then you will be ready to ROCK! :p

First, refer the FSEngine in your project.

    Private fse As FSEngine

Second, instantiate and initialize the FSEngine class.

    ' INSTANTIATE THE FSEngine
    fse = New FSEngine
    ' INITIALIZE THE fse
    fse.InitFullScreen()

Third, switch between full screen and normal mode.

    ' SET FULL SCREEN MODE
    If fse.DoFullScreen(True) = 0 Then
        ' RESIZE YOUR MAIN WINDOW
    End If

    ' RESTORE FROM FULL SCREEN MODE
    If fse.DoFullScreen(False) = 0 Then
        ' RESIZE YOUR MAIN WINDOW
    End If

Please refer to previous topic on Full screen for more information.