【问题标题】:How do I make a full screen scrolling messagebox or window?如何制作全屏滚动消息框或窗口?
【发布时间】:2010-12-29 07:21:06
【问题描述】:

首先让我开始说我对 c++ 一无所知,我真的只是更感兴趣的是让它工作然后学习 c++(我的盘子里有足够的东西来学习)。

所以基本上我正在尝试为我的 windows mobile 6 专业应用程序制定服务条款,但似乎我需要使用 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;
}

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

谢谢

【问题讨论】:

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


    【解决方案1】:

    我可能会在其上的 TextBox 中创建一个带有 TOS 文本的对话框。这样您就可以利用 TextBox 自动滚动的事实。

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

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

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

    【讨论】:

      猜你喜欢
      • 2010-10-23
      • 1970-01-01
      • 1970-01-01
      • 2016-04-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多