还有一个问题,接上个关于罗云彬书9.2
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#include <resource.h>
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#define ICO_MAIN 1000
#define DLG_MAIN 1000
#define IDM_MAIN 1000
#define IDM_OPEN 1101
#define IDM_SAVEAS 1102
#define IDM_PAGESETUP 1103
#define IDM_EXIT 1104
#define IDM_FIND 1201
#define IDM_REPLACE 1202
#define IDM_SELFONT 1203
#define IDM_SELCOLOR 1204
#define IDM_MENUOPTION 1300
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
ICO_MAIN ICON "Main.ico"
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
DLG_MAIN DIALOG 150, 180, 250, 130
MENU IDM_MAIN
STYLE DS_MODALFRAME | WS_POPUP |WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
CAPTION "状态栏示例"
FONT 9, "宋体"
{
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
IDM_MAIN menu discardable
BEGIN
popup "文件(&F)"
BEGIN
menuitem "打开文件(&O)...", IDM_OPEN
menuitem "文件另存为(&C)...",IDM_SAVEAS
menuitem separator
menuitem "页面设置(&P)...",IDM_PAGESETUP
menuitem separator
menuitem "退出(&X)", IDM_EXIT
END
popup "查看(&V)"
BEGIN
menuitem "查找字符串(&S)...",IDM_FIND
menuitem "替换字符串(&R)...",IDM_REPLACE
menuitem separator
menuitem "选择字体(&F)...",IDM_SELFONT
menuitem "选择颜色(&B)...",IDM_SELCOLOR
END
END
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
stringtable discardable
BEGIN
IDM_MENUOPTION "包含文件操作的命令"
IDM_MENUOPTION+1 "包含操作视图的命令"
IDM_OPEN "打开需要编辑的文件"
IDM_SAVEAS "以另外一个文件名保存文件"
IDM_PAGESETUP "选择打印机以及设置页边距、纸张大小等打印参数"
IDM_EXIT "退出本程序"
IDM_FIND "在窗口中搜索文字"
IDM_REPLACE "在窗口中搜索文字并替换"
IDM_SELFONT "选择窗口中文字使用的字体"
IDM_SELCOLOR "选择窗口的背景颜色"
END
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.386
.model flat,stdcall
option casemap:none
include windows.inc
include user32.inc
includelib user32.lib
include kernel32.inc
includelib kernel32.lib
include Comctl32.inc
includelib Comctl32.lib
ICO_MAIN equ 1000
DLG_MAIN equ 1000
IDM_MAIN equ 1000
IDM_OPEN equ 1001
IDM_SAVEAS equ 1002
IDM_PAGESETUP equ 1003
IDM_EXIT equ 1004
IDM_FIND equ 1005
IDM_REPLACE equ 1006
IDM_SELFONT equ 1007
IDM_SELCOLOR equ 1008
IDM_MENUOPTION equ 1009
ID_STATUSBAR equ 1
ID_EDIT equ 2
.data?
hInstance dd ?
hWinMain dd ?
hWinStatus dd ?
hWinEdit dd ?
lpsz1 dd ?
lpsz2 dd ?
.const
szClass db 'EDIT',0
szFormat0 db '%02d:%02d:%02d',0
;szBufferSizeT db 'left=%d,top=%d,right=%d,bottom=%d',0
szBufferSizeT1 db 'eax=%d,ecx=%d',0
szFormat1 db '字节数:%d',0
sz1 db '插入',0
sz2 db '改写',0
dwStatusWidth dd 60,140,172,-1
dwMenuHelp dd 0,IDM_MENUOPTION,0,0
;szStatusText db '状态栏',0
.code
_Resize proc
local @stRect:RECT,@stRect1:RECT
local @szBufferSize[128]:byte
invoke MoveWindow,hWinStatus,0,0,0,0,TRUE
invoke GetWindowRect,hWinStatus,addr @stRect
invoke GetClientRect,hWinMain,addr @stRect1
mov ecx,@stRect1.right
sub ecx,@stRect1.left
mov eax,@stRect1.bottom
sub eax,@stRect1.top
sub eax,@stRect.bottom
add eax,@stRect.top
invoke MoveWindow,hWinEdit,0,0,ecx,eax,TRUE
ret
_Resize endp
_ProcDlgMain proc uses ebx esi edi hWnd,wMsg,wParam,lParam
local @szBuffer[128]:byte
local @stST:SYSTEMTIME
local @stPoint:POINT,@stRect:RECT
local @szBufferSize[128]:byte
mov eax,wMsg
.if eax == WM_TIMER
invoke GetLocalTime,addr @stST
movzx eax,@stST.wHour
movzx ebx,@stST.wMinute
movzx ecx,@stST.wSecond