• Displaying a Message Box


    Demonstration Program
    We will demonstrate a short program that demonstrates some capabilities of the MessageBoxA
    function. The first function call displays a warning message:

    Program Listing
    Following is a complete listing of a MessageBox demonstration program. The function named
    MessageBox is an alias for the MessageBoxA function, so we will use the simpler name:

    TITLE Demonstrate MessageBoxA (MessageBox.asm)
    INCLUDE Irvine32.inc
    .data
    captionW BYTE "Warning",0
    warningMsg BYTE "The current operation may take years "
    BYTE "to complete.",0
    
    captionQ BYTE "Question",0
    questionMsg BYTE "A matching user account was not found."
    BYTE 0dh,0ah,"Do you wish to continue?",0
    captionC BYTE "Information",0
    infoMsg BYTE "Select Yes to save a backup file "
    BYTE "before continuing,",0dh,0ah
    BYTE "or click Cancel to stop the operation",0
    captionH BYTE "Cannot View User List",0
    haltMsg BYTE "This operation not supported by your "
    BYTE "user account.",0
    .code
    main PROC
    ; Display Exclamation icon with OK button
    INVOKE MessageBox, NULL, ADDR warningMsg,
    ADDR captionW,
    MB_OK + MB_ICONEXCLAMATION
    ; Display Question icon with Yes/No buttons
    INVOKE MessageBox, NULL, ADDR questionMsg,
    ADDR captionQ, MB_YESNO + MB_ICONQUESTION
    ; interpret the button clicked by the user
    cmp eax,IDYES ; YES button clicked?
    ; Display Information icon with Yes/No/Cancel buttons
    INVOKE MessageBox, NULL, ADDR infoMsg,
    ADDR captionC, MB_YESNOCANCEL + MB_ICONINFORMATION 
    + MB_DEFBUTTON2
    ; Display stop icon with OK button
    INVOKE MessageBox, NULL, ADDR haltMsg,
    ADDR captionH,
    MB_OK + MB_ICONSTOP
    exit
    main ENDP
    END main
  • 相关阅读:
    markdown转HTML,目录生成
    schedule与scheduleAtFixedRate之Timer源码分析
    rocketmq刷盘过程
    rocketmq消息存储概述
    Cassandra修改集群名称
    Cassandra读写性能测试
    rocketmq--push消费过程
    rocketmq消费负载均衡--push消费为例
    go反射实例
    JUnit4参数的使用
  • 原文地址:https://www.cnblogs.com/dreamafar/p/5978558.html
Copyright © 2020-2023  润新知