📄 tstyle2.asm
字号:
; #########################################################################
; This example emulates a technique used in older style TASM code
; called a message despatcher. It hides the manual stack manipulation
; in two macros and uses equates to make the stack parameters easier
; to use. The manual push & call syntax is done in the normal STDCALL
; calling convention of pushing parameters in reverse order.
; #########################################################################
.386
.model flat, stdcall ; 32 bit memory model
option casemap :none ; case sensitive
; include files
; ~~~~~~~~~~~~~
include \MASM32\INCLUDE\windows.inc
include \MASM32\INCLUDE\user32.inc
include \MASM32\INCLUDE\kernel32.inc
include \masm32\include\shell32.inc
; libraries
; ~~~~~~~~~
includelib \MASM32\LIB\user32.lib
includelib \MASM32\LIB\kernel32.lib
includelib \masm32\lib\shell32.lib
; ---------------------------------------------
; make stack parameters look half intelligible
; ---------------------------------------------
hWin equ <DWORD PTR [ebp + 8]>
uMsg equ <DWORD PTR [ebp + 12]>
wParam equ <DWORD PTR [ebp + 16]>
lParam equ <DWORD PTR [ebp + 20]>
wWidth equ <DWORD PTR [ebp + 8]>
sWidth equ <DWORD PTR [ebp + 12]>
hInst equ <DWORD PTR [ebp + 8]>
EnterStack MACRO
push ebp
mov ebp, esp
ENDM
LeaveStack MACRO
mov esp, ebp
pop ebp
ENDM
.data?
hIcon dd ?
hWnd dd ?
Wtx dd ?
Wty dd ?
wWid dd ?
wHgt dd ?
hMnu dd ?
.data
wc WNDCLASSEX <>
msg MSG <>
message1 db "Leaving ?",0
title1 db "TASM style message despatcher",0
szClassName db "Old_TASM_Message_Despatcher_Class",0
AboutMsg db "Obsolete code design example.",13,10,\
"Copyright
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -