梓囚徒貧圭�鮗� ○ 賜 ★ 辛酔堀貧和鍬匈��梓囚徒貧議 Enter 囚辛指欺云慕朕村匈��梓囚徒貧圭�鮗� ● 辛指欺云匈競何��
!!!!隆堋響頼��紗秘慕禰厮宴和肝写偬堋響��
。if eax
invoke EnableMenuItem��hMenu��IDM_PASTE��MF_ENABLED
。else
invoke EnableMenuItem��hMenu��IDM_PASTE��MF_GRAYED
。endif
��********************************************************************
invoke SendMessage��hWinEdit��EM_CANREDO��0��0
。if eax
invoke EnableMenuItem��hMenu��IDM_REDO��MF_ENABLED
。else
invoke EnableMenuItem��hMenu��IDM_REDO��MF_GRAYED
。endif
��********************************************************************
invoke SendMessage��hWinEdit��EM_CANUNDO��0��0
。if eax
invoke EnableMenuItem��hMenu��IDM_UNDO��MF_ENABLED
。else
invoke EnableMenuItem��hMenu��IDM_UNDO��MF_GRAYED
。endif
��********************************************************************
invoke GetWindowTextLength��hWinEdit
。if eax
invoke EnableMenuItem��hMenu��IDM_SELALL��MF_ENABLED
。else
invoke EnableMenuItem��hMenu��IDM_SELALL��MF_GRAYED
。endif
��********************************************************************
invoke SendMessage��hWinEdit��EM_GETMODIFY��0��0
。if eax && hFile
invoke EnableMenuItem��hMenu��IDM_SAVE��MF_ENABLED
。else
invoke EnableMenuItem��hMenu��IDM_SAVE��MF_GRAYED
。endif
��********************************************************************
。if szFindText
invoke EnableMenuItem��hMenu��IDM_FINDNEXT��MF_ENABLED
invoke EnableMenuItem��hMenu��IDM_FINDPREV��MF_ENABLED
。else
invoke EnableMenuItem��hMenu��IDM_FINDNEXT��MF_GRAYED
invoke EnableMenuItem��hMenu��IDM_FINDPREV��MF_GRAYED
。endif
��********************************************************************
ret
_SetStatus endp
�察掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘�
_Init proc
local @stCf��CHARFORMAT
��********************************************************************
�察」�過^臥孀 ̄斤三崇��連��兜兵晒^臥孀 ̄斤三崇議潤更
��********************************************************************
push hWinMain
pop stFind。hwndOwner
invoke RegisterWindowMessage��addr FINDMSGSTRING
mov idFindMessage��eax
��********************************************************************
�察―�羨補竃猟云完笥
��********************************************************************
invoke CreateWindowEx��WS_EX_CLIENTEDGE��offset szClassEdit��
NULL��WS_CHILD OR WS_VISIBLE OR WS_VSCROLL
OR WS_HSCROLL OR ES_MULTILINE or ES_NOHIDESEL��
0��0��0��0��hWinMain��0��hInstance��NULL
mov hWinEdit��eax
invoke SendMessage��hWinEdit��EM_SETTEXTMODE��TM_PLAINTEXT��0
invoke RtlZeroMemory��addr @stCf��sizeof @stCf
mov @stCf。cbSize��sizeof @stCf
mov @stCf。yHeight��9 * 20
mov @stCf。dwMask��CFM_FACE or CFM_SIZE or CFM_BOLD
invoke lstrcpy��addr @stCf。szFaceName��addr szFont
invoke SendMessage��hWinEdit��EM_SETCHARFORMAT��0��addr @stCf
invoke SendMessage��hWinEdit��EM_EXLIMITTEXT��0�察�1
ret
_Init endp
�察掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘�
_Quit proc
invoke _CheckModify
。if eax
invoke DestroyWindow��hWinMain
invoke PostQuitMessage��NULL
。if hFile
栖坿�叉舸唸ひ騎�井芙 恬宀�座湟同髻”碗子魁 〇慂蘢拭 ]岱子魁 �
貧匯匈 指慕朕 和匯匈
及9嫗 宥喘陣周
9。4 聞喘Richedit陣周��4��
invoke CloseHandle��hFile
。endif
。endif
ret
_Quit endp
�察掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘�
_ProcWinMain proc uses ebx edi esi hWnd��uMsg��wParam��lParam
local @stRange��CHARRANGE
local @stRect��RECT
mov eax��uMsg
。if eax WM_SIZE
invoke GetClientRect��hWinMain��addr @stRect
invoke MoveWindow��hWinEdit��0��0��
@stRect。right��@stRect。bottom��TRUE
��********************************************************************
�察ヾ�尖暇汽、紗堀囚式垢醤生��連
��********************************************************************
。elseif eax WM_MAND
mov eax��wParam
movzx eax��ax
。if eax IDM_OPEN
invoke _CheckModify
。if eax
call _OpenFile
。endif
。elseif eax IDM_SAVE
call _SaveFile
。elseif eax IDM_EXIT
invoke _Quit
。elseif eax IDM_UNDO
invoke SendMessage��hWinEdit��EM_UNDO��0��0
。elseif eax IDM_REDO
invoke SendMessage��hWinEdit��EM_REDO��0��0
。elseif eax IDM_SELALL
mov @stRange。cpMin��0
mov @stRange。cpMax�察�1
invoke SendMessage��hWinEdit��EM_EXSETSEL��
0��addr @stRange
。elseif eax IDM_COPY
invoke SendMessage��hWinEdit��WM_COPY��0��0
。elseif eax IDM_CUT
invoke SendMessage��hWinEdit��WM_CUT��0��0
。elseif eax IDM_PASTE
invoke SendMessage��hWinEdit��WM_PASTE��0��0
。elseif eax IDM_FIND
and stFind。Flags��not FR_DIALOGTERM
invoke FindText��addr stFind
。if eax
mov hFindDialog��eax
。endif
。elseif eax IDM_FINDPREV
and stFind。Flags��not FR_DOWN
invoke _FindText
。elseif eax IDM_FINDNEXT
or stFind。Flags��FR_DOWN
invoke _FindText
。endif
��********************************************************************
。elseif eax WM_INITMENU
call _SetStatus
。elseif eax idFindMessage
。if stFind。Flags & FR_DIALOGTERM
mov hFindDialog��0
。else
invoke _FindText
。endif
��********************************************************************
。elseif eax WM_ACTIVATE
mov eax��wParam
。if ��ax WA_CLICKACTIVE �� ���� ��ax WA_ACTIVE��
invoke SetFocus��hWinEdit
。endif
��********************************************************************
。elseif eax WM_CREATE
push hWnd
pop hWinMain
invoke _Init
��********************************************************************
。elseif eax WM_CLOSE
call _Quit
��********************************************************************
。else
invoke DefWindowProc��hWnd��uMsg��wParam��lParam
ret
。endif
��********************************************************************
xor eax��eax
ret
_ProcWinMain endp
�察掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘掘�
_WinMain proc
local @stWndClass��WNDCLASSEX
local @stMsg��MSG
local @hAccelerator��@hRichEdit
invoke LoadLibrary��offset szDllEdit
mov @hRichEdit��eax
invoke GetModuleHandle��NULL
mov hInstance��eax
invoke LoadMenu��hInstance��IDM_MAIN
mov hMenu��eax
invoke LoadAccelerators��hInstance��IDA_MAIN
mov @hAccelerator��eax
��********************************************************************
�察」�過完笥窃
��********************************************************************
invoke RtlZeroMemory��addr @stWndClass��sizeof @stWndClass
invoke LoadIcon��hInstance��ICO_MAIN
mov @stWndClass。hIcon��eax
mov @stWndClass。hIconSm��eax
invoke LoadCursor��0��IDC_ARROW
mov @stWndClass。hCursor��eax
push hInstance
pop @stWndClass。hInstance
mov @stWndClass。cbSize��sizeof WNDCLASSEX
mov @stWndClass。style��CS_HREDRAW or CS_VREDRAW
mov @stWndClass。lpfnWndProc��offset _ProcWinMain
mov @stWndClass。hbrBackground��COLOR_BTNFACE��1
mov @stWndClass。lpszClassName��offset szClassName
invoke RegisterClassEx��addr @stWndClass
��********************************************************************
�察―�羨旺�塋彰或�
��********************************************************************
invoke CreateWindowEx��NULL��
offset szClassName��offset szCaptionMain��
WS_OVERLAPPEDWINDOW��
CW_USEDEFAULT��CW_USEDEFAULT��700��500��
NULL��hMenu��hInstance��NULL
mov hWinMain��eax
栖坿�叉舸唸ひ騎�井芙 恬宀�座湟同髻”碗子魁 〇慂蘢拭 ]岱子魁 �
貧匯匈 指慕朕 和匯匈
及9嫗 宥喘陣周
9。4 聞喘Richedit陣周��5��
invoke ShowWindow��hWinMain��SW_SHOWNORMAL
invoke UpdateWindow��hWinMain
��********************************************************************
�察]�連儉桟
��********************************************************************
。while TRUE
invoke GetMessage��addr @stMsg��NULL��0��0
。break 。if eax 0
invoke TranslateAccelerator��hWinMain��
@hAccelerator��addr @stMsg
。if eax 0
invoke TranslateMessage��addr @stMsg
invoke DispatchMessage��addr @stMsg
。endif
。endw