图解用RadASM开发一个同时编辑多个文档的编辑器
生活随笔
收集整理的這篇文章主要介紹了
图解用RadASM开发一个同时编辑多个文档的编辑器
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1 界面
用RadASM新建一個匯編項目,RichEdit模板;完成后,運行,該模板生成一個富文本編輯器的窗口;
用RadASM做如下界面;變富文本編輯器為四個;
運行一下,第一個會自動擴充其窗口大,阻擋了其余三個;
注釋掉MoveWindow函數一句,再運行,如下;代碼見后;
2 改變窗口標題
因為有四個編輯框,當光標移動到不同編輯框,改變窗口標題為不同;如何實現,在哪個消息中來改變?這是個問題;Petzold的書中有說嗎?記不清;
下面決定用spy++工具來觀察一下;
用VC++開發如下一個程序;
運行上面程序;打開spy++,搜索定位到 dddd 窗口;
從菜單中彈出消息選項對話框,在消息組中僅選中 鍵盤 和 鼠標 項;確定;
在 dddd 對話框中,在兩個編輯框之間切換輸入提示的光標,觀察產生的消息是什么;
觀察到產生的消息是WM_SETCURSOR;
3 error A2070
添加如下圖的消息處理代碼,在其他處添加相應代碼;構建;出現error A2070;
不論是.if wParam==hREd1 還是?.if wParam==[hREd1 ],都不行;暫時卡住;
4 代碼
rich4.Asm
.386 .model flat,stdcall option casemap:noneinclude rich4.Inc.codestart:invoke GetModuleHandle,NULLmov hInstance,eaxinvoke GetCommandLinemov CommandLine,eaxinvoke InitCommonControlsmov iccex.dwSize,sizeof INITCOMMONCONTROLSEX ;prepare common control structuremov iccex.dwICC,ICC_DATE_CLASSESinvoke InitCommonControlsEx,addr iccexinvoke LoadLibrary,addr RichEditDLLmov hRichEdDLL,eaxinvoke WinMain,hInstance,NULL,CommandLine,SW_SHOWDEFAULTpush eaxinvoke FreeLibrary,hRichEdDLLpop eaxinvoke ExitProcess,eaxWinMain proc hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:DWORDLOCAL wc:WNDCLASSEXLOCAL msg:MSGmov wc.cbSize,SIZEOF WNDCLASSEXmov wc.style,CS_HREDRAW or CS_VREDRAWmov wc.lpfnWndProc,OFFSET WndProcmov wc.cbClsExtra,NULLmov wc.cbWndExtra,DLGWINDOWEXTRApush hInstpop wc.hInstancemov wc.hbrBackground,NULLmov wc.lpszMenuName,IDM_MENUmov wc.lpszClassName,OFFSET ClassNameinvoke LoadIcon,NULL,IDI_APPLICATIONmov hIcon,eaxmov wc.hIcon,eaxmov wc.hIconSm,eaxinvoke LoadCursor,NULL,IDC_ARROWmov wc.hCursor,eaxinvoke RegisterClassEx,addr wcinvoke CreateDialogParam,hInstance,IDD_DLG,NULL,addr WndProc,NULLmov hWnd,eaxinvoke ShowWindow,hWnd,SW_SHOWNORMALinvoke UpdateWindow,hWnd.while TRUEinvoke GetMessage,addr msg,NULL,0,0.break .if !eaxinvoke IsDialogMessage,hFind,addr msg.if !eaxinvoke TranslateMessage,addr msginvoke DispatchMessage,addr msg.endif.endwmov eax,msg.wParamretWinMain endpStreamInProc proc hFile:DWORD,pBuffer:DWORD,NumBytes:DWORD,pBytesRead:DWORDinvoke ReadFile,hFile,pBuffer,NumBytes,pBytesRead,0xor eax,1retStreamInProc endpStreamOutProc proc hFile:DWORD,pBuffer:DWORD,NumBytes:DWORD,pBytesWritten:DWORDinvoke WriteFile,hFile,pBuffer,NumBytes,pBytesWritten,0xor eax,1retStreamOutProc endpSetWinCaption procLOCAL buffer[sizeof AppName+3+MAX_PATH]:BYTELOCAL buffer1[4]:BYTE;Add filename to windows captioninvoke lstrcpy,addr buffer,addr AppNamemov eax,' - 'mov dword ptr buffer1,eaxinvoke lstrcat,addr buffer,addr buffer1invoke lstrcat,addr buffer,addr FileNameinvoke SetWindowText,hWnd,addr bufferretSetWinCaption endpSaveFile proc lpFileName:DWORDLOCAL hFile:DWORDLOCAL editstream:EDITSTREAMinvoke CreateFile,lpFileName,GENERIC_WRITE,FILE_SHARE_READ,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0.if eax!=INVALID_HANDLE_VALUEmov hFile,eax;stream the text to the filemov editstream.dwCookie,eaxmov editstream.pfnCallback,offset StreamOutProcinvoke SendMessage,hREd1,EM_STREAMOUT,SF_TEXT,addr editstreaminvoke CloseHandle,hFile;Set the modify state to falseinvoke SendMessage,hREd1,EM_SETMODIFY,FALSE,0mov eax,FALSE.elseinvoke MessageBox,hWnd,addr SaveFileFail,addr AppName,MB_OKmov eax,TRUE.endifretSaveFile endpSaveEditAs procLOCAL ofn:OPENFILENAMELOCAL buffer[MAX_PATH]:BYTE;Zero out the ofn structinvoke RtlZeroMemory,addr ofn,sizeof ofn;Setup the ofn structmov ofn.lStructSize,sizeof ofnpush hWndpop ofn.hwndOwnerpush hInstancepop ofn.hInstancemov ofn.lpstrFilter,NULLmov buffer[0],0lea eax,buffermov ofn.lpstrFile,eaxmov ofn.nMaxFile,sizeof buffermov ofn.Flags,OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_PATHMUSTEXIST or OFN_OVERWRITEPROMPTmov ofn.lpstrDefExt,NULL;Show save as dialoginvoke GetSaveFileName,addr ofn.if eaxinvoke SaveFile,addr buffer.if !eax;The file was savedinvoke lstrcpy,addr FileName,addr bufferinvoke SetWinCaptionmov eax,FALSE.endif.elsemov eax,TRUE.endifretSaveEditAs endpSaveEdit proc;Check if filrname is (Untitled)invoke lstrcmp,addr FileName,addr NewFile1.if eaxinvoke SaveFile,addr FileName.elseinvoke SaveEditAs.endifretSaveEdit endpWantToSave procLOCAL buffer[512]:BYTELOCAL buffer1[2]:BYTEinvoke SendMessage,hREd1,EM_GETMODIFY,0,0.if eaxinvoke lstrcpy,addr buffer,addr WannaSaveinvoke lstrcat,addr buffer,addr FileNamemov ax,'?'mov word ptr buffer1,axinvoke lstrcat,addr buffer,addr buffer1invoke MessageBox,hWnd,addr buffer,addr AppName,MB_YESNOCANCEL or MB_ICONQUESTION.if eax==IDYESinvoke SaveEdit.elseif eax==IDNOmov eax,FALSE.elsemov eax,TRUE.endif.endifretWantToSave endpOpenEdit procLOCAL ofn:OPENFILENAMELOCAL hFile:DWORDLOCAL editstream:EDITSTREAMLOCAL buffer[MAX_PATH]:BYTELOCAL chrg:CHARRANGE;Zero out the ofn structinvoke RtlZeroMemory,addr ofn,sizeof ofn;Setup the ofn structmov ofn.lStructSize,sizeof ofnpush hWndpop ofn.hwndOwnerpush hInstancepop ofn.hInstancemov ofn.lpstrFilter,NULLmov buffer[0],0lea eax,buffermov ofn.lpstrFile,eaxmov ofn.nMaxFile,sizeof buffermov ofn.lpstrDefExt,NULLmov ofn.Flags,OFN_FILEMUSTEXIST or OFN_HIDEREADONLY or OFN_PATHMUSTEXIST;Show the Open dialoginvoke GetOpenFileName,addr ofn.if eax;Open the fileinvoke CreateFile,addr buffer,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0.if eax!=INVALID_HANDLE_VALUEmov hFile,eax;Copy buffer to FileNameinvoke lstrcpy,addr FileName,addr buffer;stream the text into the richedit controlpush hFilepop editstream.dwCookiemov editstream.pfnCallback,offset StreamInProcinvoke SendMessage,hREd1,EM_STREAMIN,SF_TEXT,addr editstreaminvoke CloseHandle,hFileinvoke SendMessage,hREd1,EM_SETMODIFY,FALSE,0mov chrg.cpMin,0mov chrg.cpMax,0invoke SendMessage,hREd1,EM_EXSETSEL,0,addr chrginvoke SetWinCaptionmov eax,FALSE.elseinvoke MessageBox,hWnd,addr OpenFileFail,addr AppName,MB_OKmov eax,TRUE.endif.endifretOpenEdit endpFindDlgProc proc hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAMLOCAL hCtl:DWORDmov eax,uMsg.if eax==WM_INITDIALOGmov eax,hWinmov hFind,eax.if !lParam;Disable replaceinvoke GetDlgItem,hWin,IDC_REPLACETEXTmov hCtl,eaxinvoke GetWindowLong,hCtl,GWL_STYLExor eax,WS_VISIBLEinvoke SetWindowLong,hCtl,GWL_STYLE,eaxinvoke GetDlgItem,hWin,IDC_REPLACESTATICmov hCtl,eaxinvoke GetWindowLong,hCtl,GWL_STYLExor eax,WS_VISIBLEinvoke SetWindowLong,hCtl,GWL_STYLE,eaxinvoke GetDlgItem,hWin,IDC_BTN_REPLACEALLinvoke EnableWindow,eax,FALSE.elseinvoke SetWindowText,hWin, addr Replace.endif.elseif eax==WM_COMMANDmov eax,wParammov edx,eaxshr edx,16and eax,0FFFFh.if edx==BN_CLICKED.if eax==IDOK.elseif eax==IDCANCELinvoke SendMessage,hWin,WM_CLOSE,NULL,NULL.endif.endif.elseif eax==WM_CLOSEmov hFind,0invoke EndDialog,hWin,NULL.elsemov eax,FALSEret.endifmov eax,TRUEretFindDlgProc endpDoToolBar proc hInst:DWORD,hToolBar:HWNDLOCAL tbab:TBADDBITMAP;Set toolbar struct sizeinvoke SendMessage,hToolBar,TB_BUTTONSTRUCTSIZE,sizeof TBBUTTON,0;Set toolbar bitmappush hInstpop tbab.hInstmov tbab.nID,IDB_TBRBMPinvoke SendMessage,hToolBar,TB_ADDBITMAP,15,addr tbab;Set toolbar buttonsinvoke SendMessage,hToolBar,TB_ADDBUTTONS,ntbrbtns,addr tbrbtnsmov eax,hToolBarretDoToolBar endpSetFormat proc hWin:DWORDLOCAL chrg1:CHARRANGELOCAL chrg2:CHARRANGELOCAL pf:PARAFORMAT2LOCAL cf:CHARFORMATLOCAL tp:DWORDLOCAL buffer[16]:BYTELOCAL pt:POINTLOCAL hDC:HDC;Save modify stateinvoke SendMessage,hWin,EM_GETMODIFY,0,0push eax;Save selectioninvoke SendMessage,hWin,EM_EXGETSEL,0,addr chrg1invoke SendMessage,hWin,EM_HIDESELECTION,TRUE,0;Select all textmov chrg2.cpMin,0mov chrg2.cpMax,-1invoke SendMessage,hWin,EM_EXSETSEL,0,addr chrg2;Set font charsetmov cf.cbSize,sizeof cfmov cf.dwMask,CFM_CHARSET or CFM_FACE or CFM_SIZE or CFM_COLORmov al,lfnt.lfCharSetmov cf.bCharSet,almov al,lfnt.lfPitchAndFamilymov cf.bPitchAndFamily,alinvoke lstrcpyn,addr cf.szFaceName,addr lfnt.lfFaceName,LF_FACESIZEmov eax,lfnt.lfHeightneg eaxmov ecx,15mul ecxmov cf.yHeight,eaxmov eax,rgbmov cf.crTextColor,eaxinvoke SendMessage,hWin,EM_SETCHARFORMAT,SCF_SELECTION,addr cf;Get tab widthinvoke GetDC,hWinmov hDC,eaxinvoke SelectObject,hDC,hFontpush eaxmov eax,'WWWW'mov dword ptr buffer,eaxinvoke GetTextExtentPoint32,hDC,addr buffer,4,addr ptpop eaxinvoke SelectObject,hDC,eaxinvoke ReleaseDC,hWin,hDCmov eax,pt.xmov ecx,TabSizemul ecxmov ecx,15mul ecxshr eax,2mov tp,eax;Set tab stopsmov pf.cbSize,sizeof pfmov pf.dwMask,PFM_TABSTOPSmov pf.cTabCount,MAX_TAB_STOPSxor eax,eaxxor edx,edxmov ecx,MAX_TAB_STOPS@@:add eax,tpmov dword ptr pf.rgxTabs[edx],eaxadd edx,4loop @binvoke SendMessage,hWin,EM_SETPARAFORMAT,0,addr pf;Restore modify statepop eaxinvoke SendMessage,hWin,EM_SETMODIFY,eax,0;Restore selectioninvoke SendMessage,hWin,EM_EXSETSEL,0,addr chrg1invoke SendMessage,hWin,EM_HIDESELECTION,FALSE,0retSetFormat endpWndProc proc hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAMLOCAL pt:POINTLOCAL rect:RECTLOCAL ht:DWORDLOCAL hCtl:HWNDLOCAL chrg:CHARRANGELOCAL cf:CHOOSEFONTmov eax,uMsg.if eax==WM_INITDIALOGpush hWinpop hWndmov fView,3mov TabSize,4;Set the toolbar buttonsinvoke GetDlgItem,hWin,IDC_TBRinvoke DoToolBar,hInstance,eax;Set FileName to NewFile1invoke lstrcpy,addr FileName,addr NewFile1invoke SetWinCaption;Get handle of RichEdit window and give it focusinvoke GetDlgItem,hWin,IDC_REDmov hREd1,eaxinvoke SendMessage,hREd1,EM_SETTEXTMODE,0,TM_PLAINTEXT;Set event maskinvoke SendMessage,hREd1,EM_SETEVENTMASK,0,ENM_SELCHANGE;Set the text limit. The default is 64Kinvoke SendMessage,hREd1,EM_LIMITTEXT,-1,0;Create fontinvoke lstrcpy,addr lfnt.lfFaceName,offset szFontmov lfnt.lfHeight,-12mov lfnt.lfWeight,400invoke CreateFontIndirect,addr lfntmov hFont,eax;Set font & formatinvoke SetFormat,hREd1;Init RichEditinvoke SendMessage,hREd1,EM_SETMODIFY,FALSE,0invoke SendMessage,hREd1,EM_EMPTYUNDOBUFFER,0,0invoke SetFocus,hREd1.elseif eax==WM_COMMAND;Menu and toolbar has the same ID'smov eax,wParamand eax,0FFFFh.if eax==IDM_FILE_NEWinvoke WantToSave.if !eaxinvoke SetWindowText,hREd1,addr szNULLinvoke lstrcpy,addr FileName,addr NewFile1invoke SetWinCaption.endifinvoke SetFocus,hREd1.elseif eax==IDM_FILE_OPENinvoke WantToSave.if !eaxinvoke OpenEdit.endifinvoke SetFocus,hREd1.elseif eax==IDM_FILE_SAVEinvoke SaveEditinvoke SetFocus,hREd1.elseif eax==IDM_FILE_SAVEASinvoke SaveEditAsinvoke SetFocus,hREd1.elseif eax==IDM_FILE_PRINT.elseif eax==IDM_FILE_EXITinvoke SendMessage,hWin,WM_CLOSE,0,0.elseif eax==IDM_EDIT_UNDOinvoke SendMessage,hREd1,EM_UNDO,0,0.elseif eax==IDM_EDIT_REDOinvoke SendMessage,hREd1,EM_REDO,0,0.elseif eax==IDM_EDIT_DELETEinvoke SendMessage,hREd1,EM_REPLACESEL,TRUE,0.elseif eax==IDM_EDIT_CUTinvoke SendMessage,hREd1,WM_CUT,0,0.elseif eax==IDM_EDIT_COPYinvoke SendMessage,hREd1,WM_COPY,0,0.elseif eax==IDM_EDIT_PASTEinvoke SendMessage,hREd1,WM_PASTE,0,0.elseif eax==IDM_EDIT_SELECTALLmov chrg.cpMin,0mov chrg.cpMax,-1invoke SendMessage,hREd1,EM_EXSETSEL,0,addr chrg.elseif eax==IDM_EDIT_FIND.if hFind==0invoke CreateDialogParam,hInstance,IDD_FINDDLG,hWin,addr FindDlgProc,FALSE.elseinvoke SetFocus,hFind.endif.elseif eax==IDM_EDIT_REPLACE.if hFind==0invoke CreateDialogParam,hInstance,IDD_FINDDLG,hWin,addr FindDlgProc,TRUE.elseinvoke SetFocus,hFind.endif.elseif eax==IDM_VIEW_TOOLBARinvoke GetDlgItem,hWin,IDC_TBRmov hCtl,eaxxor fView,1mov eax,fViewand eax,1.if eaxinvoke ShowWindow,hCtl,SW_SHOWNA.elseinvoke ShowWindow,hCtl,SW_HIDE.endifinvoke SendMessage,hWin,WM_SIZE,0,0.elseif eax==IDM_VIEW_STATUSBARinvoke GetDlgItem,hWin,IDC_SBRmov hCtl,eaxxor fView,2mov eax,fViewand eax,2.if eaxinvoke ShowWindow,hCtl,SW_SHOWNA.elseinvoke ShowWindow,hCtl,SW_HIDE.endifinvoke SendMessage,hWin,WM_SIZE,0,0.elseif eax==IDM_OPTION_FONTinvoke RtlZeroMemory,addr cf,sizeof cfmov cf.lStructSize,sizeof cfmov eax,hWinmov cf.hwndOwner,eaxmov cf.lpLogFont,offset lfntmov cf.Flags,CF_SCREENFONTS or CF_EFFECTS or CF_INITTOLOGFONTSTRUCTmov eax,rgbmov cf.rgbColors,eaxinvoke ChooseFont,addr cf.if eaxinvoke DeleteObject,hFontinvoke CreateFontIndirect,addr lfntmov hFont,eaxmov eax,cf.rgbColorsmov rgb,eaxinvoke SetFormat,hREd1.endifinvoke SetFocus,hREd1.elseif eax==IDM_HELP_ABOUTinvoke ShellAbout,hWin,addr AppName,addr AboutMsg,hIconinvoke SetFocus,hREd1.endif.elseif eax==WM_NOTIFY.if wParam==IDC_RED;Auto horizontal scroll text into viewinvoke GetCaretPos,addr ptinvoke GetClientRect,hREd1,addr rectmov eax,rect.rightsub eax,pt.x.if eax<20;Caret near right edgeinvoke SendMessage,hREd1,EM_GETSCROLLPOS,0,addr ptadd pt.x,70invoke SendMessage,hREd1,EM_SETSCROLLPOS,0,addr pt.endif.endif.elseif eax==WM_SETCURSOR.if wParam==hREd1invoke lstrcpy,addr FileName,addr NewFile1invoke SetWinCaption .endif.if wParam==hREd2invoke lstrcpy,addr FileName,addr NewFile2invoke SetWinCaption.endif.if wParam==hREd3invoke lstrcpy,addr FileName,addr NewFile3invoke SetWinCaption .endif.if wParam==hREd4invoke lstrcpy,addr FileName,addr NewFile4invoke SetWinCaption.endif.elseif eax==WM_SIZEmov eax,fViewand eax,1.if eax;Resize toolbarinvoke GetDlgItem,hWin,IDC_TBRmov hCtl,eaxinvoke MoveWindow,hCtl,0,0,0,0,TRUE;Get height of toolbarinvoke GetWindowRect,hCtl,addr rectmov eax,rect.bottomsub eax,rect.top.endifpush eaxmov eax,fViewand eax,2.if eax;Resize statusbarinvoke GetDlgItem,hWin,IDC_SBRmov hCtl,eaxinvoke MoveWindow,hCtl,0,0,0,0,TRUE;Get height of statusbarinvoke GetWindowRect,hCtl,addr rectmov eax,rect.bottomsub eax,rect.top.endifpush eax;Get size of windows client areainvoke GetClientRect,hWin,addr rect;Subtract height of statusbar from bottompop eaxsub rect.bottom,eax;Add height of toolbar to toppop eaxadd rect.top,eax;Get new height of RichEdit windowmov eax,rect.bottomsub eax,rect.topmov ht,eax;Resize RichEdit window;invoke MoveWindow,hREd1,0,rect.top,rect.right,ht,TRUE.elseif eax==WM_CLOSE invoke WantToSave.if !eaxinvoke DestroyWindow,hWin.endif.elseif eax==WM_DESTROYinvoke DeleteObject,hFontinvoke PostQuitMessage,NULL.elseinvoke DefWindowProc,hWin,uMsg,wParam,lParamret.endifxor eax,eaxretWndProc endpend startrich4.Inc include windows.inc include user32.inc include kernel32.inc include shell32.inc include comctl32.inc include comdlg32.inc include gdi32.incincludelib user32.lib includelib kernel32.lib includelib shell32.lib includelib comctl32.lib includelib comdlg32.lib includelib gdi32.libWinMain PROTO :DWORD,:DWORD,:DWORD,:DWORD WndProc PROTO :DWORD,:DWORD,:DWORD,:DWORD;Find.dlg IDD_FINDDLG equ 2000 IDC_FINDTEXT equ 2001 IDC_BTN_REPLACE equ 2007 IDC_REPLACETEXT equ 2002 IDC_REPLACESTATIC equ 2009 IDC_BTN_REPLACEALL equ 2008 IDC_CHK_WHOLEWORD equ 2004 IDC_CHK_MATCHCASE equ 2003 IDC_RBN_DOWN equ 2005 IDC_RBN_UP equ 2006;rich4.dlg IDD_DLG equ 1000 IDC_SBR equ 1003 IDC_TBR equ 1001 IDC_RED equ 1002 IDB_TBRBMP equ 1212 IDM_MENU equ 10000;rich4.mnu IDM_FILE_NEW equ 10001 IDM_FILE_OPEN equ 10002 IDM_FILE_SAVE equ 10003 IDM_FILE_SAVEAS equ 10004 IDM_FILE_PRINT equ 10005 IDM_FILE_EXIT equ 10006 IDM_EDIT_UNDO equ 10101 IDM_EDIT_REDO equ 10102 IDM_EDIT_DELETE equ 10103 IDM_EDIT_CUT equ 10104 IDM_EDIT_COPY equ 10105 IDM_EDIT_PASTE equ 10106 IDM_EDIT_SELECTALL equ 10107 IDM_EDIT_FIND equ 10108 IDM_EDIT_FINDNEXT equ 10110 IDM_EDIT_FINDPREV equ 10111 IDM_EDIT_REPLACE equ 10109 IDM_VIEW_TOOLBAR equ 10008 IDM_VIEW_STATUSBAR equ 10009 IDM_OPTION_FONT equ 10007 IDM_HELP_ABOUT equ 10201.const;structure for ToolBar buttons tbrbtns TBBUTTON <0,0,TBSTATE_ENABLED,TBSTYLE_SEP,0,0>TBBUTTON <6,IDM_FILE_NEW,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>TBBUTTON <7,IDM_FILE_OPEN,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>TBBUTTON <8,IDM_FILE_SAVE,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>TBBUTTON <0,0,TBSTATE_ENABLED,TBSTYLE_SEP,0,0>TBBUTTON <0,IDM_EDIT_CUT,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>TBBUTTON <1,IDM_EDIT_COPY,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>TBBUTTON <2,IDM_EDIT_PASTE,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>TBBUTTON <0,0,TBSTATE_ENABLED,TBSTYLE_SEP,0,0>TBBUTTON <3,IDM_EDIT_UNDO,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>TBBUTTON <4,IDM_EDIT_REDO,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>TBBUTTON <5,IDM_EDIT_DELETE,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>TBBUTTON <0,0,TBSTATE_ENABLED,TBSTYLE_SEP,0,0>TBBUTTON <12,IDM_EDIT_FIND,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>TBBUTTON <13,IDM_EDIT_REPLACE,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>TBBUTTON <0,0,TBSTATE_ENABLED,TBSTYLE_SEP,0,0>TBBUTTON <14,IDM_FILE_PRINT,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0>TBBUTTON <0,0,TBSTATE_ENABLED,TBSTYLE_SEP,0,0> ;Number of buttons in tbbtns ntbrbtns equ 18RichEditDLL db 'riched20.dll',0 ClassName db 'DLGCLASS',0 AppName db 'RichEdit editor',0 AboutMsg db 'RadASM RichEdit editor',13,10,'KetilO (C) 2002',0 Replace db 'Replace ..',0 OpenFileFail db 'Cannot open the file',0 SaveFileFail db 'Cannot save the file',0 WannaSave db 'Want to save changes to',0Dh,0 NewFile1 db '學習1',0 NewFile2 db '工作1',0 NewFile3 db '生活1',0 NewFile4 db '計劃1',0 szNULL db 0 szFont db 'Courier New',0.data?hRichEdDLL dd ? hInstance dd ? CommandLine dd ? hIcon dd ? hWnd HWND ? hREd1 HWND ? hREd2 HWND ? hREd3 HWND ? hREd4 HWND ? hFind HWND ? FileName db MAX_PATH dup(?) ;structure for DateTimePicker iccex INITCOMMONCONTROLSEX <?>fView dd ? TabSize dd ? lfnt LOGFONT <?> hFont dd ? rgb dd ?
總結
以上是生活随笔為你收集整理的图解用RadASM开发一个同时编辑多个文档的编辑器的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java异常处理学习总结
- 下一篇: 图解net use 命令使用示例