【问题标题】:set the font of a custom label added on a custom dialog page in nsis installer设置在 nsis 安装程序的自定义对话框页面上添加的自定义标签的字体
【发布时间】:2011-05-05 08:01:50
【问题描述】:

如何在 nsis 安装程序中设置自定义添加页面上添加的标签的字体

为了创建标签,我使用了这个:

    nsDialogs::Create 1018

var Label

${NSD_CreateLabel} 0 0 100% 32u "PLEASE CHOOSE WHAT DO YOU WANT TO INSTALL:"
Pop $Label

【问题讨论】:

    标签: installation dialog custom-controls nsis


    【解决方案1】:
    !include nsDialogs.nsh
    var Label
    page custom pre
    function pre
    nsDialogs::Create 1018
    
    ${NSD_CreateLabel} 0 0 100% 32u "PLEASE CHOOSE WHAT DO YOU WANT TO INSTALL:"
    Pop $Label
    CreateFont $0 "Arial" 18
    SendMessage $Label ${WM_SETFONT} $0 1
    
    nsDialogs::Show
    functionend
    

    【讨论】:

    • 非常感谢先生,但您能否解释一下它的工作原理: CreateFont $0 "Arial" 18 ----这会将字体详细信息放入变量 $0 中,对吗?
    • @sqlchild:是的,它将字体句柄(win32 中的 HFONT)放在 $0 中
    • 之后这是在做什么:SendMessage $Label ${WM_SETFONT} $0 1 ---'1'最后在做什么?
    • @sqlchild:所有 WM_* 消息都记录在 MSDN 上:msdn.microsoft.com/en-us/library/ms632642%28v=vs.85%29.aspx
    猜你喜欢
    • 2012-10-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多