|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
我要知道为什么错。谢谢啦
.386
.model flat,stdcall
option casemap:none
include user32.inc
include kernel32.inc
include windows.inc
include gdi32.inc
includelib kernel32.lib
includelib gdi32.lib
includelib user32.lib
ICO_MAIN equ 0x1000
DLG_MAIN equ 0x100
IDC_INFO equ 0x101
.data
hInstance dd ?
hWinMain dd ?
.const
sz db '物理内存总数:%016x KB',0ah,0dh
db '空闲物理内存:%016x KB',0ah,0dh
db '虚拟内存总数:%016x KB',0ah,0dh
db '空闲虚拟内存:%016x KB',0ah,0dh
db '已用内存比列:%02d KB',0ah,0dh
db '--------------------',0ah,0dh
db '用户地址空间总数:%016x kb',0ah,0dh
db '用户可用地址空间:%016x kb',0ah,0dh,0
.code
DLG1_PROC proc
local @hmemory:MEMORYSTATUS
local @szbuffer[1024]:byte
mov @hmemory.dwLength,sizeof MEMORYSTATUS
invoke GlobalMemoryStatus,addr @hmemory
invoke wsprintf,addr @szbuffer,addr sz,addr @hmemory.dwTotalPhys,addr @hmemory.dwAvailPhys,\
addr @hmemory.dwTotalPageFile,addr @hmemory.dwAvailPageFile,addr @hmemory.dwMemoryLoad,\
addr @hmemory.dwTotalVirtual,addr @hmemory.dwAvailVirtual
invoke SetDlgItemText,hWinMain,IDC_INFO,addr @szbuffer
ret
DLG1_PROC endp
DLG_PROC proc uses esi edi ebx,hWnd,wMsg,wParam,lParam
push hWnd
pop hWinMain
mov eax,wMsg
.if eax==WM_CLOSE
invoke EndDialog,hWnd,NULL
invoke KillTimer,hWnd,1
.elseif eax==WM_INITTDIALOG
invoke LoadIcon,hInstance,ICO_MAIN
invoke SendMessage,hWnd,WM_SETICON,ICO_MAIN,eax
invoke SetTimer,hWnd,1,1000,NULL
call DLG1_PROC
ret
DLG_PROC endp
start:
invoke GetModuleHandle,NULL
mov hInstance,eax
invoke DialogBoxParam,hInstance,DLG_MAIN,NULL,DLG_PROC,NULL
invoke ExitProcess,NULL
end start
|
|