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
  • 相关阅读:
    初赛第四场B
    初赛第四场A
    初赛第六场C
    CF 365(2) C 思维,图形模拟 D 树状数组,离线处理,思维
    CF 725C 模拟 725D
    CF 378(2) C D 模拟
    CF 729D 模拟,思维
    CF 729C 模拟,二分
    CF 381(2) D. dfs序,二分,数组模拟维护
    CF 395(2) D.矩形上色,模拟
  • 原文地址:https://www.cnblogs.com/dreamafar/p/5978558.html
Copyright © 2011-2022 走看看