why does this not work?__UNICODE__ equ TRUE
.586
.model flat,stdcall
option casemap:none
WinMain PROTO :DWORD,:DWORD,:DWORD,:DWORD
include \masm32\include\masm32rt.inc
include \masm32\include\winclasses.asm
.const
MainWindowWidth equ 500
MainWindowHeight equ 400
.data
hInstance HINSTANCE ?
wcMain WNDCLASSEX <sizeof wcMain,CS_HREDRAW+CS_VREDRAW,offset WndProc,\
0,0,?,?,?,COLOR_WINDOW,0,offset MainWindowClass,?>
UCSTR MainWindowName,"Experience 1,2,3",0
UCSTR MainWindowClass,"MainWindowClass",0
hMainWindow HWND ?
frep FINDREPLACE <>
FINDMSGSTRING dd 0
UCSTR fmsgs,"FINDMSGSTRING",0
StringBuffer dw 80 dup(0)
hButton HWND ?
UCSTR ButtonName,"Find Text",0
.code
start:
mov hInstance,rv(GetModuleHandle,0)
invoke WinMain,hInstance,0,0,SW_SHOWNORMAL
invoke ExitProcess,eax
WinMain PROC hInst:DWORD,hPrevInst:DWORD,CmdLine:DWORD,CmdShow:DWORD
local msg:MSG
push hInst
pop wcMain.hInstance
mov wcMain.hIcon,rv(LoadIcon,0,IDI_APPLICATION)
m2m wcMain.hIcon,wcMain.hIconSm
mov wcMain.hCursor,rv(LoadCursor,0,IDC_ARROW)
invoke RegisterClassEx,addr wcMain
mov eax,rv(GetSystemMetrics,SM_CYSCREEN)
shr eax,1
sub eax,MainWindowHeight/2
push eax
mov eax,rv(GetSystemMetrics,SM_CXSCREEN)
shr eax,1
sub eax,MainWindowWidth/2
pop ebx
mov hMainWindow,rv(CreateWindowEx,0,addr MainWindowClass,addr MainWindowName,WS_OVERLAPPEDWINDOW,eax,ebx,MainWindowWidth,MainWindowHeight,0,0,hInstance,0)
invoke ShowWindow,hMainWindow,CmdShow
invoke UpdateWindow,hMainWindow
msg_loop:
invoke GetMessage,addr msg,NULL,0,0
or eax,eax
jz end_msg_loop
invoke TranslateMessage,addr msg
invoke DispatchMessage,addr msg
jmp msg_loop
end_msg_loop:
mov eax,msg.wParam
ret
WinMain endp
WndProc PROC hWnd:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD
mov edx,uMsg
.if uMsg==WM_DESTROY
invoke PostQuitMessage,0
.elseif uMsg==WM_CREATE
mov edi,lParam
.if [edi.CREATESTRUCT.hWndParent]==0
invoke CreateWindowEx,0,addr WC_BUTTON,addr ButtonName,WS_VISIBLE+WS_CHILD+\
BS_PUSHBUTTON,0,0,200,32,hWnd,0,hInstance,0
mov hButton,eax
invoke RegisterWindowMessage,addr fmsgs
mov FINDMSGSTRING,eax
.endif
.elseif uMsg==WM_COMMAND
invoke RtlZeroMemory,addr StringBuffer,sizeof StringBuffer
mov frep.lStructSize,sizeof frep
push hWnd
pop frep.hwndOwner
push hInstance
pop frep.hInstance
mov frep.lpstrFindWhat,offset StringBuffer
mov frep.wFindWhatLen,80
mov frep.Flags,FR_DOWN+FR_MATCHCASE+FR_REPLACE
invoke FindText,addr frep
.elseif edx==FINDMSGSTRING
invoke MessageBox,hWnd,0,0,MB_OK
.else
invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret
.endif
xor eax,eax
ret
WndProc endp
end startThanks in advance