I can’t see any significant difference either. Running on my Windows XP P3 system, loading the current MASM32 windows.inc 10 times, whether I use the default stack size, or /STACK:10000000,10000000, I get ~1720ms.
;==============================================================================
; Build as a console app.
;==============================================================================
include \masm32\include\masm32rt.inc
;==============================================================================
IDC_RE equ 100
;==============================================================================
;----------------------------------------------------------------------
; This is a general-purpose control definition macro that adds support
; for controls of any type to the MASM32 In-Memory Dialogs. For this
; macro the control class is specified as a quoted string, instead of
; being hard coded.
;----------------------------------------------------------------------
DlgControl MACRO quoted_caption,quoted_class,dstyle,tx,ty,wd,ht,ctlID
align_4 edi
mov DWORD PTR [edi+0], WS_VISIBLE or WS_CHILD or dstyle
mov WORD PTR [edi+8], tx
mov WORD PTR [edi+10], ty
mov WORD PTR [edi+12], wd
mov WORD PTR [edi+14], ht
mov WORD PTR [edi+16], ctlID
add edi, 18
ustring quoted_class
ustring quoted_caption
;-------------------------------------------
; Advance edi past the creation data array.
;-------------------------------------------
add edi, 2
ENDM
;==============================================================================
.data
hInst HMODULE 0
hwndRE HWND 0
hFile HANDLE 0
flag dd 0
editstream EDITSTREAM <1,,EditStreamCallback>
filename db "\masm32\include\windows.inc",0
.code
;==============================================================================
EditStreamCallback proc dwCookie:DWORD, pbBuff:DWORD, cb:DWORD, pcb:DWORD
invoke ReadFile, hFile, pbBuff, cb, pcb, NULL
xor eax, eax
ret
EditStreamCallback endp
;==============================================================================
DlgProc proc hwndDlg:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
LOCAL rc:RECT
SWITCH uMsg
CASE WM_INITDIALOG
invoke CreateFile, ADDR filename, GENERIC_READ, FILE_SHARE_READ,
NULL, OPEN_EXISTING, NULL, NULL
mov hFile, eax
invoke GetDlgItem, hwndDlg, IDC_RE
mov hwndRE, eax
invoke SendMessage, hwndRE, EM_EXLIMITTEXT, 1000000*10, 0
CASE WM_SYSCOMMAND
.IF flag == 0
inc flag
invoke GetTickCount
push eax
REPEAT 10
invoke SendMessage, hwndRE,
EM_STREAMIN,
SF_TEXT,
ADDR editstream
invoke SetFilePointer, hFile, 0, NULL, FILE_BEGIN
ENDM
invoke GetTickCount
pop edx
sub eax, edx
printf("%dms\n", eax)
.ENDIF
CASE WM_SIZE
invoke GetClientRect, hwndDlg, ADDR rc
invoke MoveWindow, hwndRE, 0, 0, rc.right, rc.bottom, TRUE
CASE WM_COMMAND
SWITCH wParam
Case IDCANCEL
invoke CloseHandle,hFile
invoke EndDialog, hwndDlg, NULL
ENDSW
CASE WM_CLOSE
invoke CloseHandle,hFile
invoke EndDialog, hwndDlg, NULL
EndSw
return 0
DlgProc endp
;==============================================================================
start:
;==============================================================================
invoke LoadLibrary, chr$("RICHED20.DLL")
invoke GetModuleHandle, NULL
mov hInst, eax
Dialog "Click title bar to start test", \
"Courier New",8, \
WS_OVERLAPPED or WS_SYSMENU or DS_CENTER, \
1, \
0,0,200,150, \
1024
DlgControl 0, \
"RichEdit20A", \
WS_VSCROLL or \
WS_HSCROLL or \
ES_SUNKEN or \
ES_MULTILINE or \
ES_AUTOVSCROLL or \
ES_AUTOHSCROLL or \
ES_NOHIDESEL or \
ES_WANTRETURN, \
0,0,0,0,IDC_RE
CallModalDialog hInst, 0, DlgProc, NULL
exit
;==============================================================================
end start
I didn’t think to test the effect of the RE control styles, and I am apparently testing a Rich Edit 3.0 control.