c++ - 如何制作全屏滚动消息框或窗口?

标签 c++ c visual-c++ windows-mobile mobile

首先我要说的是,我对 C++ 一无所知,我真的只是更感兴趣让这个工作比学习 C++ 更感兴趣(我有足够的时间来学习)。

所以基本上我正在尝试为我的 Windows Mobile 6 Professional 应用程序制定服务条款,但似乎我需要使用 C++ 来做到这一点。经过几个小时的搜索,我找到了一个解决方案,但它是针对 Windows Mobile 标准开发的。

所以他们以某种方式使用 C++ 来制作消息框,并且在标准设备(即非触摸屏手机)上,消息框可以具有滚动功能。由于某种原因,专业设备(触摸屏设备)并非如此。

所以我的消息框会从页面上消失,您永远无法接受或拒绝这些条款。所以你会永远卡在屏幕上,直到你进行某种软重启。

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

上面的链接是教程,但这里是似乎显示消息的实际文件。

#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;
}

所以我想把它改成可以滚动的东西。因为我知道什么有滚动或其他东西,所以我可以像面板控件一样使用吗?

谢谢

最佳答案

我可能会创建一个对话框,其中的文本框中包含 TOS 文本。这样您就可以利用 TextBox 自动滚动的优势。

然后您可以使用 CreateDialogDialogBox进行实际显示。

这里的一个额外好处是您可以使用资源编辑器进行基本窗口布局。

我知道你说过你不想学习 C(这是 C,不是 C++),但我真的无法想象你在没有对 Win32 基础知识(如 WndPrcs 等)有一些基本了解的情况下这样做。 Doug Boling 的书“Programming Windows CE”中有一些使用普通 Win32 的 super 简单的 UI 应用程序,因此这些将是一个不错的开始。任何基本教程也可能如此 on DialogBox or CreateDialog .

关于c++ - 如何制作全屏滚动消息框或窗口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1949580/

相关文章:

创建递归函数以返回异或运算结果的整数

c - C 中的链接列表错误 : conflicting types. 解决方案?

c++ - 将 long 转换为 wchar_t *

c++ - 带有多行单元格的 QTableView

c++ - C++11的array end()如何找到数组结尾

c - 为什么这段代码从 fork 开始执行 printf 8 次?

c++ - 如何在不区分大小写的情况下检查文本文件是否为回文

c++ - CEDel.exe : 0xC0000005: Access violation writing location 0x002e0364 中 0x03f7111c 的第一次机会异常

c++ - 通过引用重载多个函数对象

c++ - SFINAE - 用一个参数检测构造函数