⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 masmed.asm

📁 MasmEd是一款专门针对Masm32做的汇编代码编辑器
💻 ASM
📖 第 1 页 / 共 4 页
字号:
			.elseif eax==IDM_FORMAT_SNAP
				invoke GetWindowLong,hResEd,GWL_STYLE
				xor		eax,DES_SNAPTOGRID
				invoke SetWindowLong,hResEd,GWL_STYLE,eax
			.elseif eax==IDM_FORMAT_ALIGN_LEFT
				invoke SendMessage,hResEd,DEM_ALIGNSIZE,0,ALIGN_LEFT
			.elseif eax==IDM_FORMAT_ALIGN_CENTER
				invoke SendMessage,hResEd,DEM_ALIGNSIZE,0,ALIGN_CENTER
			.elseif eax==IDM_FORMAT_ALIGN_RIGHT
				invoke SendMessage,hResEd,DEM_ALIGNSIZE,0,ALIGN_RIGHT
			.elseif eax==IDM_FORMAT_ALIGN_TOP
				invoke SendMessage,hResEd,DEM_ALIGNSIZE,0,ALIGN_TOP
			.elseif eax==IDM_FORMAT_ALIGN_MIDDLE
				invoke SendMessage,hResEd,DEM_ALIGNSIZE,0,ALIGN_MIDDLE
			.elseif eax==IDM_FORMAT_ALIGN_BOTTOM
				invoke SendMessage,hResEd,DEM_ALIGNSIZE,0,ALIGN_BOTTOM
			.elseif eax==IDM_FORMAT_SIZE_WIDTH
				invoke SendMessage,hResEd,DEM_ALIGNSIZE,0,SIZE_WIDTH
			.elseif eax==IDM_FORMAT_SIZE_HEIGHT
				invoke SendMessage,hResEd,DEM_ALIGNSIZE,0,SIZE_HEIGHT
			.elseif eax==IDM_FORMAT_SIZE_BOTH
				invoke SendMessage,hResEd,DEM_ALIGNSIZE,0,SIZE_BOTH
			.elseif eax==IDM_VIEW_TOOLBAR
				invoke GetDlgItem,hWin,IDC_TBR
				mov		hCtl,eax
				xor		wpos.fView,1
				test	wpos.fView,1
				.if !ZERO?
					invoke ShowWindow,hCtl,SW_SHOWNA
				.else
					invoke ShowWindow,hCtl,SW_HIDE
				.endif
				invoke SendMessage,hWin,WM_SIZE,0,1
			.elseif eax==IDM_VIEW_STATUSBAR
				invoke GetDlgItem,hWin,IDC_SBR
				mov		hCtl,eax
				xor		wpos.fView,2
				test	wpos.fView,2
				.if !ZERO?
					invoke ShowWindow,hCtl,SW_SHOWNA
				.else
					invoke ShowWindow,hCtl,SW_HIDE
				.endif
				invoke SendMessage,hWin,WM_SIZE,0,1
				invoke SendMessage,hOut,WM_SIZE,0,0
				invoke SendMessage,hOut,REM_REPAINT,0,0
			.elseif eax==IDM_VIEW_OUTPUT
				xor		wpos.fView,4
				invoke SendMessage,hWin,WM_SIZE,0,1
				test	wpos.fView,4
				.if !ZERO?
					invoke ShowWindow,hOut,SW_SHOWNA
				.else
					invoke ShowWindow,hOut,SW_HIDE
				.endif
			.elseif eax==IDM_VIEW_FILEBROWSER
				xor		wpos.fView,8
				invoke SendMessage,hWin,WM_SIZE,0,1
				test	wpos.fView,8
				.if !ZERO?
					invoke ShowWindow,hBrowse,SW_SHOWNA
				.else
					invoke ShowWindow,hBrowse,SW_HIDE
				.endif
			.elseif eax==IDM_RESOURCE_DIALOG
				invoke SendMessage,hProject,PRO_ADDITEM,TPE_DIALOG,TRUE
			.elseif eax==IDM_RESOURCE_MENU
				invoke SendMessage,hProject,PRO_ADDITEM,TPE_MENU,TRUE
			.elseif eax==IDM_RESOURCE_ACCEL
				invoke SendMessage,hProject,PRO_ADDITEM,TPE_ACCEL,TRUE
			.elseif eax==IDM_RESOURCE_VERINF
				invoke SendMessage,hProject,PRO_ADDITEM,TPE_VERSION,TRUE
			.elseif eax==IDM_RESOURCE_INCLUDE
				invoke SendMessage,hProject,PRO_ADDITEM,TPE_INCLUDE,TRUE
			.elseif eax==IDM_RESOURCE_RESOURCE
				invoke SendMessage,hProject,PRO_ADDITEM,TPE_RESOURCE,TRUE
			.elseif eax==IDM_RESOURCE_STRING
				invoke SendMessage,hProject,PRO_ADDITEM,TPE_STRING,TRUE
			.elseif eax==IDM_RESOURCE_NAME
				invoke SendMessage,hProject,PRO_SHOWNAMES,0,hOut
			.elseif eax==IDM_RESOURCE_REMOVE
				invoke SendMessage,hProject,PRO_DELITEM,0,0
			.elseif eax==IDM_RESOURCE_UNDO
				invoke SendMessage,hProject,PRO_UNDODELETED,0,0
			.elseif eax==IDM_MAKE_COMPILE
				invoke UpdateAll,SAVE_ALL
				invoke OutputMake,IDM_MAKE_COMPILE,offset FileName,TRUE
			.elseif eax==IDM_MAKE_ASSEMBLE
				invoke UpdateAll,SAVE_ALL
				invoke OutputMake,IDM_MAKE_ASSEMBLE,offset FileName,TRUE
			.elseif eax==IDM_MAKE_LINK
				invoke UpdateAll,SAVE_ALL
				invoke OutputMake,IDM_MAKE_LINK,offset FileName,TRUE
			.elseif eax==IDM_MAKE_RUN
				invoke UpdateAll,SAVE_ALL
				invoke OutputMake,IDM_MAKE_RUN,offset FileName,2
			.elseif eax==IDM_MAKE_GO
				invoke UpdateAll,SAVE_ALL
				invoke OutputMake,IDM_MAKE_COMPILE,offset FileName,2
				or		eax,eax
				jne		Ex
				invoke OutputMake,IDM_MAKE_ASSEMBLE,offset FileName,0
				or		eax,eax
				jne		Ex
				invoke OutputMake,IDM_MAKE_LINK,offset FileName,3
				or		eax,eax
				jne		Ex
				invoke OutputMake,IDM_MAKE_RUN,offset FileName,4
			.elseif eax==IDM_OPTION_CODE
				invoke DialogBoxParam,hInstance,IDD_DLGKEYWORDS,hWin,offset KeyWordsProc,0
			.elseif eax==IDM_OPTION_DIALOG
				invoke DialogBoxParam,hInstance,IDD_TABOPTIONS,hWin,offset TabOptionsProc,0
;--------------------------------------------------------------------------------
			.elseif eax==IDM_OPTION_MPATH
				invoke DialogBoxParam,hInstance,IDD_MPATH,hWin,offset MPathProc,0
;--------------------------------------------------------------------------------				
			.elseif eax==IDM_OPTION_TOOLS
				invoke DialogBoxParam,hInstance,IDD_DLGOPTMNU,hWin,offset MenuOptionProc,1
				invoke SetToolMenu
			.elseif eax==IDM_OPTION_HELP
				invoke DialogBoxParam,hInstance,IDD_DLGOPTMNU,hWin,offset MenuOptionProc,2
				invoke SetHelpMenu
			.elseif eax==IDM_HELP_ABOUT
				invoke DialogBoxParam,hInstance,IDD_DLGABOUT,hWin,offset AboutProc,0
			.elseif ax==-3
				;Expand button clicked
				invoke SendMessage,hREd,REM_EXPANDALL,0,0
				invoke SendMessage,hREd,EM_SCROLLCARET,0,0
				invoke SendMessage,hREd,REM_REPAINT,0,0
			.elseif ax==-4
				;Collapse button clicked
				mov		ebx,offset blocks
				mov		edx,[ebx]
				.while edx
					invoke SendMessage,hREd,REM_COLLAPSEALL,0,edx
					add		ebx,4
					mov		edx,[ebx]
				.endw
				invoke SendMessage,hREd,EM_SCROLLCARET,0,0
				invoke SendMessage,hREd,REM_REPAINT,0,0
			.elseif eax==IDM_HELPF1
				;F1-Help key pressed
				mov		mnu.szcap,0
				mov		mnu.szcmnd,0
				invoke lstrcpy,addr buffer,addr szMenuHelp
				invoke lstrlen,addr buffer
				mov		word ptr buffer[eax],'1'
				mov		lpcbData,sizeof mnu
				invoke RegQueryValueEx,hReg,addr buffer,0,addr lpType,addr mnu,addr lpcbData
				movzx	eax,mnu.szcmnd
				.if eax
					invoke SendMessage,hREd,REM_GETWORD,sizeof buffer,addr buffer
					invoke WinHelp,hWin,addr mnu.szcmnd,HELP_KEY,addr buffer
				.endif
			.elseif eax>=20000 && eax<=20020
				mov		mnu.szcap,0
				mov		mnu.szcmnd,0
				mov		edx,eax
				sub		edx,19999
				invoke MakeKey,addr szMenuTool,edx,addr buffer
				mov		lpcbData,sizeof mnu
				invoke RegQueryValueEx,hReg,addr buffer,0,addr lpType,addr mnu,addr lpcbData
				movzx	eax,mnu.szcmnd
				.if eax
					mov		buffer1,0
					push	ebx
					push	esi
					push	edi
					xor		ebx,ebx
					lea		esi,mnu.szcmnd
					lea		edi,buffer
				  @@:
					mov		al,[esi]
					.if al=='$'
						.if !ebx
							mov		byte ptr [edi],0
							lea		edi,buffer1
							inc		ebx
						.endif
						push	esi
						mov		esi,offset FileName
						.while al!='.' && al
							mov		al,[esi]
							.if al!='.' && al
								mov		[edi],al
								inc		esi
								inc		edi
							.endif
						.endw
						pop		esi
						inc		esi
						jmp		@b
					.endif
					mov		[edi],al
					inc		esi
					inc		edi
					or		al,al
					jne		@b
					pop		edi
					pop		esi
					pop		ebx
					invoke ShellExecute,hWin,NULL,addr buffer,addr buffer1,NULL,SW_SHOWDEFAULT
				.endif
			.elseif eax>=30000 && eax<=30020
				mov		mnu.szcap,0
				mov		mnu.szcmnd,0
				mov		edx,eax
				sub		edx,29999
				invoke MakeKey,addr szMenuHelp,edx,addr buffer
				mov		lpcbData,sizeof mnu
				invoke RegQueryValueEx,hReg,addr buffer,0,addr lpType,addr mnu,addr lpcbData
				movzx	eax,mnu.szcmnd
				.if eax
					invoke ShellExecute,hWin,NULL,addr mnu.szcmnd,NULL,NULL,SW_SHOWDEFAULT
				.endif
			.elseif eax==IDC_CBO
				invoke SelectCombo
			.endif
		.endif
	.elseif eax==WM_NOTIFY
		mov		edx,lParam
		mov		eax,[edx].NMHDR.code
		mov		ecx,[edx].NMHDR.idFrom
		.if eax==EN_SELCHANGE && ecx==IDC_RAE
			mov		edi,edx
			mov		eax,[edi].RASELCHANGE.chrg.cpMin
			sub		eax,[edi].RASELCHANGE.cpLine
			invoke ShowPos,[edi].RASELCHANGE.line,eax
			.if [edi].RASELCHANGE.seltyp==SEL_OBJECT
				invoke SendMessage,hREd,REM_GETBOOKMARK,[edi].RASELCHANGE.line,0
				.if eax==1
					;Collapse
					mov		esi,offset blocks
					mov		edx,[esi]
					.while edx
						mov		edx,[edx].RABLOCKDEF.lpszStart
						invoke SendMessage,hREd,REM_ISLINE,[edi].RASELCHANGE.line,edx
						.if eax!=-1
							mov		edx,[esi]
							invoke SendMessage,hREd,REM_COLLAPSE,[edi].RASELCHANGE.line,edx
							.break
						.endif
						add		esi,4
						mov		edx,[esi]
					.endw
				.elseif eax==2
					;Expand
					invoke SendMessage,hREd,REM_EXPAND,[edi].RASELCHANGE.line,0
				.elseif eax==8
					;Expand hidden lines
					invoke SendMessage,hREd,REM_EXPAND,[edi].RASELCHANGE.line,0
				.else
					;Clear bookmark
					invoke SendMessage,hREd,REM_SETBOOKMARK,[edi].RASELCHANGE.line,0
				.endif
			.else
				invoke SendMessage,hREd,REM_SETHILITELINE,prvline,0
				mov		eax,[edi].RASELCHANGE.line
				mov		prvline,eax
				.if edopt.hiliteline
					invoke SendMessage,hREd,REM_SETHILITELINE,prvline,2
				.endif
				.if [edi].RASELCHANGE.fchanged && ![edi].RASELCHANGE.nWordGroup
					invoke SendMessage,hREd,REM_SETCOMMENTBLOCKS,addr szCmntStart,addr szCmntEnd
				  OnceMore:
					invoke SendMessage,hREd,REM_GETBOOKMARK,nLastLine,0
					mov		ebx,eax
					mov		esi,offset blocks
					mov		ecx,[esi]
					.while ecx
						mov		ecx,[ecx].RABLOCKDEF.lpszStart
						invoke SendMessage,hREd,REM_ISLINE,nLastLine,ecx
						.break .if eax!=-1
						add		esi,4
						mov		ecx,[esi]
					.endw
					.if eax==-1
						.if ebx==1 || ebx==2
							.if ebx==2
								invoke SendMessage,hREd,REM_EXPAND,nLastLine,0
							.endif
							invoke SendMessage,hREd,REM_SETBOOKMARK,nLastLine,0
							invoke SendMessage,hREd,REM_SETDIVIDERLINE,nLastLine,FALSE
							invoke SendMessage,hREd,REM_SETSEGMENTBLOCK,nLastLine,FALSE
						.endif
					.else
						xor		eax,eax
						mov		ecx,[esi]
						test	[ecx].RABLOCKDEF.flag,BD_NONESTING
						.if !ZERO?
							invoke SendMessage,hREd,REM_ISINBLOCK,nLastLine,ecx
						.endif
						.if !eax
							mov		edx,nLastLine
							inc		edx
							invoke SendMessage,hREd,REM_ISLINEHIDDEN,edx,0
							.if eax
								invoke SendMessage,hREd,REM_SETBOOKMARK,nLastLine,2
							.else
								invoke SendMessage,hREd,REM_SETBOOKMARK,nLastLine,1
							.endif
							mov		edx,[esi]
							mov		edx,[edx].RABLOCKDEF.flag
							and		edx,BD_DIVIDERLINE
							invoke SendMessage,hREd,REM_SETDIVIDERLINE,nLastLine,edx
							mov		edx,[esi]
							mov		edx,[edx].RABLOCKDEF.flag
							and		edx,BD_SEGMENTBLOCK
							invoke SendMessage,hREd,REM_SETSEGMENTBLOCK,nLastLine,edx
						.endif
					.endif
					mov		eax,[edi].RASELCHANGE.line
					.if eax>nLastLine
						inc		nLastLine
						jmp		OnceMore
					.elseif eax<nLastLine
						dec		nLastLine
						jmp		OnceMore
					.endif
				.endif
				.if [edi].RASELCHANGE.fchanged
					invoke ApiListBox,edi
				.endif
				mov		eax,[edi].RASELCHANGE.line
				.if eax!=nLastLine
					mov		nLastLine,eax
					invoke ShowWindow,hCCLB,SW_HIDE
					invoke ShowWindow,hCCTT,SW_HIDE
				.endif
			.endif
			mov		fTimer,2
		.elseif eax==EN_SELCHANGE && ecx==IDC_HEX
			mov		fTimer,2
		.elseif eax==FBN_DBLCLICK && ecx==IDC_FILE
			push	edx
			invoke lstrcpy,addr buffer,[edx].FBNOTIFY.lpfile
			invoke CharUpper,addr buffer
			invoke lstrlen,addr buffer
			mov		eax,dword ptr buffer[eax-4]
			pop		edx
			.if eax=='EXE.' || eax=='TAB.' || eax=='MOC.'
				invoke WinExec,[edx].FBNOTIFY.lpfile,SW_SHOWNORMAL
			.else
				invoke OpenEditFile,[edx].FBNOTIFY.lpfile
			.endif
		.elseif eax==TTN_NEEDTEXT
			;Toolbar tooltip
			mov		edx,(NMHDR ptr [edx]).idFrom
			invoke LoadString,hInstance,edx,addr buffer,sizeof buffer
			lea		eax,buffer
			mov		edx,lParam
			mov		(TOOLTIPTEXT ptr [edx]).lpszText,eax
		.elseif eax==TCN_SELCHANGE
			invoke TabToolActivate
		.endif
	.elseif eax==WM_SETFOCUS
		invoke SetFocus,hREd
	.elseif eax==WM_CLOSE
		invoke UpdateAll,WM_CLOSE
		.if !eax
			invoke CloseNotify
			invoke GetWindowLong,hWin,GWL_STYLE
			test	eax,WS_MAXIMIZE
			.if ZERO?
				test	eax,WS_MINIMIZE
				.if ZERO?
					mov		wpos.fMax,FALSE
					invoke GetWindowRect,hWin,addr rect
					mov		eax,rect.left
					mov		wpos.x,eax
					mov		eax,rect.top
					mov		wpos.y,eax
					mov		eax,rect.right
					sub		eax,rect.left
					mov		wpos.wt,eax
					mov		eax,rect.bottom
					sub		eax,rect.top
					mov		wpos.ht,eax
				.endif
			.else
				mov		wpos.fMax,TRUE
			.endif
			invoke DestroyWindow,hCCLB
			invoke DestroyWindow,hCCTT
			invoke DestroyWindow,hWin
		.endif
	.elseif eax==WM_DESTROY
		mov		nInx,1
		mov		ebx,offset hCustDll
		.while nInx<=32
			mov		eax,[ebx]
			.if eax
				invoke FreeLibrary,eax
			.endif
			add		ebx,4
			inc		nInx
		.endw
		invoke KillTimer,hWin,200
		invoke UpdateAll,WM_DESTROY
		invoke DeleteObject,hFont
		invoke DeleteObject,hIFont
		invoke DeleteObject,hLnrFont
		invoke DestroyCursor,hVSplitCur
		invoke DestroyCursor,hHSplitCur
		invoke DestroyIcon,hIcon
		invoke ImageList_Destroy,hMnuIml
		invoke DeleteObject,hBrBack
		invoke PostQuitMessage,NULL
	.elseif eax==WM_CONTEXTMENU
		mov		eax,wParam
		.if eax==hREd
			mov		eax,lParam
			.if eax==-1
				invoke GetCaretPos,addr pt
				invoke GetFocus
				mov		edx,eax
				invoke ClientToScreen,edx,addr pt
			.else
				and		eax,0FFFFh
				mov		pt.x,eax
				mov		eax,lParam
				shr		eax,16
				mov		pt.y,eax
			.endif
			invoke GetMenu,hWin
			invoke GetSubMenu,eax,1
			invoke TrackPopupMenu,eax,TPM_LEFTALIGN or TPM_RIGHTBUTTON,pt.x,pt.y,0,hWin,0
			jmp		Ex
		.endif
	.elseif eax==WM_INITMENUPOPUP
		movzx	eax,word ptr lParam
		.if eax==2
			invoke SendMessage,hResEd,DEM_ISLOCKED,0,0
			mov		edx,MF_BYCOMMAND
			.if eax
				mov		edx,MF_BYCOMMAND or MF_CHECKED
			.endif
			invoke CheckMenuItem,wParam,IDM_FORMAT_LOCK,edx
			invoke GetWindowLong,hResEd,GWL_STYLE
			push	eax
			test	eax,DES_GRID
			mov		edx,MF_BYCOMMAND
			.if !ZERO?
				mov		edx,MF_BYCOMMAND or MF_CHECKED
			.endif
			invoke CheckMenuItem,wParam,IDM_FORMAT_GRID,edx
			pop		eax
			test	eax,DES_SNAPTOGRID
			mov		edx,MF_BYCOMMAND
			.if !ZERO?
				mov		edx,MF_BYCOMMAND or MF_CHECKED
			.endif
			invoke CheckMenuItem,wParam,IDM_FORMAT_SNAP,edx
		.elseif eax==3
			mov		edx,MF_BYCOMMAND
			test	wpos.fView,1
			.if !ZERO?
				mov		edx,MF_BYCOMMAND or MF_CHECKED
			.endif
			invoke CheckMenuItem,wParam,IDM_VIEW_TOOLBAR,edx
			mov		edx,MF_BYCOMMAND
			test	wpos.fView,2
			.if !ZERO?
				mov		edx,MF_BYCOMMAND or MF_CHECKED
			.endif
			invoke CheckMenuItem,wParam,IDM_VIEW_STATUSBAR,edx
			mov		edx,MF_BYCOMMAND
			test	wpos.fView,4
			.if !ZERO?
				mov		edx,MF_BYCOMMAND or MF_CHECKED
			.endif
			invoke CheckMenuItem,wParam,IDM_VIEW_OUTPUT,edx
			mov		edx,MF_BYCOMMAND
			test	wpos.fView,8
			.if !ZERO?
				mov		edx,MF_BYCOMMAND or MF_CHECKED
			.endif
			invoke CheckMenuItem,wParam,IDM_VIEW_FILEBROWSER,edx
		.endif
	.elseif eax==WM_DROPFILES
		xor		ebx,ebx
	  @@:
		invoke DragQueryFile,wParam,ebx,addr buffer,sizeof buffer
		.if eax
			invoke OpenEditFile,addr buffer
			inc		ebx
			jmp		@b
		.endif
	.elseif eax==WM_ACTIVATE
		mov		fTimer,2
	.elseif eax==WM_CTLCOLORLISTBOX || eax==WM_CTLCOLOREDIT
		invoke SetBkColor,wParam,col.toolback
		invoke SetTextColor,wParam,col.tooltext
		mov		eax,hBrBack
		jmp		ExRet
	.else
		invoke DefWindowProc,hWin,uMsg,wParam,lParam
		jmp		ExRet
	.endif
  Ex:
	xor    eax,eax
  ExRet:
	ret

WndProc endp

end start

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -