zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    hdu 4293 2012成都赛区网络赛 dp ****
    hdu 4291 2012成都赛区网络赛 矩阵快速幂 ***
    hdu 4288 线段树 暴力 **
    hdu 4278 2012天津赛区网络赛 数学 *
    zoj 3888 线段树 ***
    虚拟化技术详解
    BRD、MRD 和 PRD 之间的区别与联系有哪些?
    salt-master配置、salt-minion配置
    Shell 脚本实现 Linux 系统监控
    Centos 7 安装 Xen
  • 原文地址:https://www.cnblogs.com/dreamafar/p/5978558.html
Copyright © 2011-2022 走看看