c++cvisual-c++windows-mobilemobile

How do I make a full screen scrolling messagebox or window?


First let me start of saying I know absolutely nothing about c++ and I am really just more interested in getting this to work then learning c++(I got enough on my plate to learn).

So basically I am trying to make a terms of service for my windows mobile 6 professional application but it seems I need to use c++ to do it. After hours of searching I found a solution but it developed for windows mobile standard.

So they somehow used c++ to make a message box and on standard devices(ie non touch screen phones) the message box can have like scrolling. For some reason this is not the case with professional devices(touch screen devices).

So my message box goes off the page and you can never accept or decline the terms. So your stuck and on the screen forever till you do some sort of soft restart.

http://www.mobilepractices.com/2008/10/setupdll-sample-and-walkthrough-terms.html

The above link is the tutorial but here is the actual file that seems to display the message.

#include "stdafx.h"
#include "ce_setup.h"

// This is a variable containing the text to be displayed
// in the Terms & Conditions dialog

TCHAR Message[] = _T("TERMS & CONDITIONS\r\n ")
             _T("Selecting YES you're accepting our terms & conditions.\r\n")
    _T("This is just a sample application.\r\n")
    _T("From http://www.mobilepractices.com\r\n")
    _T("You can replace this text with your own.\r\n")
    _T("We're using a setup.dll to show this dialog.\r\n")
    _T("Extra line to force vertical scrollbar.\r\n")
    _T("Extra line to force vertical scrollbar.\r\n")
    _T("Extra line to force vertical scrollbar.\r\n")
    _T("Extra line to force vertical scrollbar.\r\n")
    _T("Extra line to force vertical scrollbar.\r\n")
    _T("Extra line to force vertical scrollbar.\r\n")
    _T("Last line.\r\n")
        ;

// This function will be called when the user
// tries to install the cab. According to its return
// value the installation continues or is cancelled.
// As this could be called more than once
// (i.e. if there is not enough space on the target)
// we should take care about fFirstCall parameter
// to show the dialog only once.

codeINSTALL_INIT Install_Init(    HWND        hwndParent,
            BOOL        fFirstCall,
            BOOL        fPreviouslyInstalled,
            LPCTSTR     pszInstallDir )
{
    if (!fFirstCall 
            || 
            ::MessageBoxW(0, Message, 
            _T("SplashScreenSample")
                    , MB_YESNO) == IDYES)
        return codeINSTALL_INIT_CONTINUE;
    else
        return codeINSTALL_INIT_CANCEL;
}

So I want to change this to something that can scroll. Can I use like a panel control since I know what has scroll or something else?

Thanks


Solution

  • I'd probably create a DialogBox with the TOS text in a TextBox on it. That way you can take advantage of the fact that a TextBox automatically can do scrolling.

    You'd then use CreateDialog or DialogBox to do the actual display.

    A side bonus here is that you can use the resource editor for basic window layout.

    I know you said you don't want to learn C (this is C, not C++) but I really can't envision you doing this without at least some basic understanding of the fundamentals of Win32, like WndPrcs, etc. Doug Boling's book "Programming Windows CE" has some super-simple UI apps in it that use plain Win32, so those would be a decent start. So would probably any basic tutorial on DialogBox or CreateDialog.