Click here to Skip to main content
15,890,947 members
Articles / Mobile Apps / Windows Mobile

A Non Full-Screen Dialog Class for Windows CE

Rate me:
Please Sign up or sign in to vote.
4.92/5 (19 votes)
7 Sep 2002BSD1 min read 109.3K   369   35   14
This article describes a non full screen dialog class that does not switch to full screen when the SIP is activated.

Introduction

Showing a non full screen dialog under pocket pc is actually pretty easy. All you have to do is set the m_bFullScreen member of the CDialog class to FALSE in your dialog's constructor. It's after making a dialog non full screen that the problem begins. When you invoke any one of the SIP components, i.e. Keyboard, Transcriber, Block Recognizer etc. a dialog created in the above process will loose all its posture and will go full screen! To stop this erratic behavior, all you need to do is handle two windows messages, WM_ACTIVATE and WM_SETTINGCHANGE, and just call their default implementation in CWnd.

So, to put it all together, I've written a dialog class that handles all these, so that you don't have to hard code all these all the time whenever you make a non full screen dialog box. 

How to use

To instantly turn any CDialog derived class into a non full screen dialog, just do the following:

  1. Add CNonFSDialog header and source, NonFSDialog.h and NonFSDialog.cpp to your project
  2. Include the CNonFSDialog header NonFSDialog.h in your dialog
    #include "NonFSDialog.h"
    
  3. Instead of inheriting from CDialog, you'll have to inherit from CNonFSDialog.
    // Assuming dialog class name is CNonFullScreenDialogDlg
    class CNonFullScreenDialogDlg : public CNonFSDialog
    {
    	......
    }
  4. Now if you are in a search-replace mood ;-), replace all occurrences of CDialog in your dialogs source (cpp) with CNonFSDialog. But if you are in a selective mode, you could only change the reference to the CDialog class in the ctor...
    /////////////////////////////////////////////////////////////////////////////
    // CNonFullScreenDialogDlg dialog
    
    CNonFullScreenDialogDlg::CNonFullScreenDialogDlg(CWnd* pParent /*=NULL*/)
    	: /*CDialog*/CNonFSDialog(CNonFullScreenDialogDlg::IDD, pParent)
    and, in the BEGIN_MESSAGE_MAP macro...
    BEGIN_MESSAGE_MAP(CNonFullScreenDialogDlg, /*CDialog*/CNonFSDialog)
    	//{{AFX_MSG_MAP(CNonFullScreenDialogDlg)
    	//}}AFX_MSG_MAP
    END_MESSAGE_MAP()
    The reason you can get away by modifying just these two is cause only the constructor and message map have been overridden in the CNonFSDialog dialog class.

License

This article, along with any associated source code and files, is licensed under The BSD License


Written By
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
QuestionThanx! Pin
pointer15-Mar-12 3:00
pointer15-Mar-12 3:00 
Generalproblem in porting wince to smdk 2410 board. Pin
amiya das30-Mar-08 21:42
amiya das30-Mar-08 21:42 
GeneralMove Dialog in case of SIP Pin
iffi99219-Jun-06 1:49
iffi99219-Jun-06 1:49 
GeneralOne little thx for one little sentence Pin
vobject15-Dec-03 4:32
vobject15-Dec-03 4:32 
GeneralTragic :( Pin
Tanzim Husain18-Oct-02 19:13
Tanzim Husain18-Oct-02 19:13 
GeneralYou are a TERRORIST Pin
asaf99216-Oct-02 21:58
asaf99216-Oct-02 21:58 
GeneralRe: You are a TERRORIST Pin
Christian Graus16-Oct-02 22:06
protectorChristian Graus16-Oct-02 22:06 
Asaff wrote:
merdeded

Asaff wrote:
civilion

Not only are you rude, and a gutless pussy ( why didn't you post via an account ), but you're also a brain dead moron. It's a sad reflection of how the level of entry has dropped that someone who knows how to connect to the internet and use a browser can't spell 'murdered' or 'civilian'. I yearn for the days when people as bloody stupid as you simply had no idea what a computer was.


Christian

Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002

During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
GeneralRe: You are a TERRORIST Pin
Shaun Wilde16-Oct-02 22:14
Shaun Wilde16-Oct-02 22:14 
GeneralRe: You are a TERRORIST Pin
Shaun Wilde16-Oct-02 22:13
Shaun Wilde16-Oct-02 22:13 
GeneralRe: You are a TERRORIST Pin
Adi Shavit21-Jan-03 3:02
Adi Shavit21-Jan-03 3:02 
GeneralRe: You are a TERRORIST Pin
Anonymous1-Oct-03 23:58
Anonymous1-Oct-03 23:58 
GeneralNice & Simple; Useful! Pin
Codin' Carlos8-Sep-02 6:59
Codin' Carlos8-Sep-02 6:59 
GeneralRe: Nice & Simple; Useful! Pin
esmi27-Jan-05 2:21
esmi27-Jan-05 2:21 
GeneralRe: Nice & Simple; Useful! Pin
Ulyssees4-Aug-09 6:04
Ulyssees4-Aug-09 6:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

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