fntdlg.asm

来自「这是一个数字图像处理的matlab仿真程序」· 汇编 代码 · 共 71 行

ASM
71
字号
; #########################################################################

    .386
    .model flat, stdcall  ; 32 bit memory model
    option casemap :none  ; case sensitive

    include \MASM32\INCLUDE\windows.inc
    include \MASM32\INCLUDE\comdlg32.inc
    include \MASM32\INCLUDE\user32.inc

    .code

; #########################################################################

FontDialog proc hWin:DWORD, lf:DWORD, fStyle:DWORD

  ; ---------------------------------
  ; hWin   = parent handle
  ; lf     = ADDR LOGFONT structure
  ; fstyle = font listing style flags
  ; styles are ORed for required results
  ; Font flags are found in the CHOOSEFONT
  ; reference.
  ;
  ; If eax returns zero, cancel was
  ; pressed. If selection is made,
  ; return in eax is non zero and
  ; LOGFONT structure is filled
  ; with font information.
  ; ---------------------------------

    LOCAL hDC   :DWORD
    LOCAL cf    :CHOOSEFONT

    invoke GetDC,hWin
    push eax
    mov hDC, eax

    mov cf.lStructSize,     sizeof CHOOSEFONT
    push hWin
    pop cf.hWndOwner
    pop eax
    mov cf.hDC,             eax
    push lf
    pop cf.lpLogFont
    mov cf.iPointSize,      0
    push fStyle                 ; font listing style flags
    pop cf.Flags
    mov cf.rgbColors,       0
    mov cf.lCustData,       0
    mov cf.lpfnHook,        0
    mov cf.lpTemplateName,  0
    mov cf.hInstance,       0
    mov cf.lpszStyle,       0
    mov cf.nFontType,       0
    mov cf.Alignment,       0
    mov cf.nSizeMin,        0
    mov cf.nSizeMax,        0

    invoke ChooseFont,ADDR cf
    push eax
    invoke ReleaseDC,hWin,hDC
    pop eax

    ret

FontDialog endp

; #########################################################################

end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?