用VS2005写MASM一些常的文件备份,放在这里备份。以免电脑坏了文件丢失。好有一个参考。
windowsx.h
;////////////////////////////////////////////////////////////////////////// ;//通用命令宏 IFNDEF WINDOWSX_H WINDOWSX_H EQU <1> include listview.h HANDLE_CMD_START MACRO .IF EAX !=EAX RET ENDM HANDLE_CMD MACRO subName,cmdID NameF CATSTR <.ELSEIF EAX == cmdID> NameT CATSTR <invoke > ,<subName>,<_>,<On>,<cmdID> ,<, hwnd>,<,wParam>,<,lParam> NameF NameT RET ENDM HANDLE_CMD_END MACRO .ENDIF ENDM ;////////////////////////////////////////////////////////////////////////// ;//消息宏 HANDLE_MSG_START MACRO .IF EAX != EAX RET ENDM HANDLE_MSG MACRO subName,msgID NameF CATSTR <.ELSEIF EAX == msgID> NameT CATSTR <invoke > ,<subName>,<_>,<msgID> ,<, hwnd>,<,wParam>,<,lParam> NameF NameT RET ENDM HANDLE_MSG_END MACRO .ENDIF ENDM string MACRO Name, Text:VARARG LOCAL lbl jmp lbl Name db Text,0 lbl: ENDM m2m MACRO M1, M2 push M2 pop M1 ENDM return MACRO arg mov eax, arg ret ENDM RGB MACRO red,green,blue xor eax,eax mov ah,blue shl eax,8 mov ah,green mov al,red ENDM MAKELONG macro a:REQ, b:REQ MOV EAX,0 mov AH,a SHL EAX,8 mov AL,b ENDM ;//A=1 B=100h C=MAKELONG(A, B)=(1 and 0FFFFh) or (100h shl 16)=1000001h 最后 (1 and 0FFFFh) or (100h shl 16) 这一段Masm可以直接识别 ;//这是一个常用的宏 @GetDlgItem MACRO hwnd:REQ, hwndCtrl:REQ,hVar:REQ invoke GetDlgItem ,hwnd,hwndCtrl MOV hVar,eax ENDM USEPARAM MACRO ADD wParam,0 ADD lParam,0 add hwnd,0 ENDM ENDIF
listview.h 对listview控件常用宏在汇编语言中的定义
IFNDEF LISTVIEW_H LISTVIEW_H EQU <1> ;// ListView宏定义文件 ;////////////////////////////////////////////////////////////////////////// ;// 删除所有的项目 ListView_DeleteAllItems MACRO ListView:REQ invoke GetDlgItem ,hwnd,ListView invoke SendMessage,ListView,LVM_DELETEALLITEMS,0,0 ENDM ;// 设置项目排列方式 ListView_Arrange MACRO ListView:REQ,iCode:REQ invoke GetDlgItem ,hwnd,ListView invoke SendMessage,ListView,LVM_ARRANGE,iCode,0 ENDM ;//结束编辑 ListView_CancelEditLabel MACRO ListView:REQ invoke GetDlgItem ,hwnd,ListView invoke SendMessage,ListView,LVM_CANCELEDITLABEL,0,0 ENDM ;//拖放时显示的图标 ListView_CreateDragImage MACRO ListView:REQ,iItem:REQ , lpptUpLeft:REQ invoke GetDlgItem ,hwnd,ListView invoke SendMessage,ListView,LVM_CREATEDRAGIMAGE ,iItem,lpptUpLeft ENDM ;// 删除列 ListView_DeleteColumn MACRO ListView:REQ,iCol:REQ invoke GetDlgItem ,hwnd,ListView invoke SendMessage,ListView,LVM_DELETECOLUMN ,iCol,0 ENDM ;//删除行 ListView_DeleteItem MACRO ListView:REQ,iItem:REQ invoke GetDlgItem ,hwnd,ListView invoke SendMessage,ListView,LVM_DELETEITEM ,iItem,0 ENDM ;//改变图标样式 ListView_SetView MACRO ListView:REQ,iView:REQ invoke GetDlgItem ,hwnd,ListView invoke SendMessage,ListView,LVM_SETVIEW ,iView,0 ENDM ;//开始编辑文本 ;///////////////////////////////////////////////////////////////////////////////// ListView_EditLabel MACRO ListView:REQ ,iItem:REQ ;//iItem ;//The index of the list-view item. To cancel editing, set iItem to -1. invoke GetDlgItem ,hwnd,ListView invoke SendMessage,ListView,LVM_EDITLABEL ,iItem,0 ENDM ;//启用分组预览 ListView_EnableGroupView MACRO ListView:REQ, fEnable:REQ ;//Use TRUE to enable grouping, FALSE to disable it. invoke GetDlgItem ,hwnd,ListView invoke SendMessage,ListView,LVM_ENABLEGROUPVIEW ,fEnable,0 ENDM ;//确保第i行,可以完全显示还是部分显示 ListView_EnsureVisible MACRO ListView:REQ ,i:REQ,fPartialOK:REQ invoke SendMessage,ListView,LVM_ENSUREVISIBLE ,i,fPartialOK ENDM ;//检索行 ListView_FindItem MACRO ListView:REQ,iStart:REQ ,plvfi:REQ ;// -1 to start from the beginning. invoke SendMessage,ListView,LVM_FINDITEM ,iStart,plvfi ENDM ;//取背景颜色 ListView_GetBkColor MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETBKCOLOR ,0,0 ENDM ;//取背景图片信息 ListView_GetBkImage MACRO ListView:REQ, plvbki:REQ invoke SendMessage,ListView,LVM_GETBKIMAGE ,0,plvbki ENDM ;//取状态码 ListView_GetCallbackMask MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETCALLBACKMASK ,0,0 ENDM ;//检索第行前面的选择框状态 ;ListView_GetCheckState MACRO ListView:REQ, iIndex:RREQ ; ;invoke SendMessage,ListView,LVS_EX_CHECKBOXES ,iIndex,0 ;ENDM ;//取列信息 ListView_GetColumn MACRO ListView:REQ,iCol:REQ,pcol:REQ invoke SendMessage,ListView,LVM_GETCOLUMN,iCol,pcol ENDM ;//取列的排序数组 ListView_GetColumnOrderArray MACRO ListView:REQ,iCount:REQ ,lpiArray:REQ invoke SendMessage,ListView,LVM_GETCOLUMNORDERARRAY,iCount,lpiArray ENDM ;//取列的宽度 ListView_GetColumnWidth MACRO ListView:REQ,iCol:REQ invoke SendMessage,ListView,LVM_GETCOLUMNWIDTH ,iCol,0 ENDM ListView_GetCountPerPage MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETCOUNTPERPAGE ,0,0 ENDM ;//获取编程状态的句柄窗口 ListView_GetEditControl MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETEDITCONTROL ,0,0 ENDM ;// ListView_GetEmptyText MACRO ListView:REQ,pszText:REQ ,cchText:REQ invoke SendMessage,ListView,LVM_GETEMPTYTEXT ,cchText,pszText ENDM ;//获取扩展样式表 ListView_GetExtendedListViewStyle MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETEXTENDEDLISTVIEWSTYLE ,0,0 ENDM ;// ListView_GetFocusedGroup MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETFOCUSEDGROUP ,0,0 ENDM ;// ListView_GetFooterInfo MACRO ListView:REQ,plvfi:REQ invoke SendMessage,ListView,LVM_GETFOOTERINFO ,0,plvfi ENDM ;// ListView_GetFooterItem MACRO ListView:REQ,iItem:REQ,pfi:REQ invoke SendMessage,ListView,LVM_GETFOOTERITEM ,iItem,pfi ENDM ;// ListView_GetFooterItemRect MACRO ListView:REQ,iItem:REQ,prc:REQ invoke SendMessage,ListView,LVM_GETFOOTERITEMRECT ,iItem,prc ENDM ;// ListView_GetFooterRect MACRO ListView:REQ,prc:REQ invoke SendMessage,ListView,LVM_GETFOOTERRECT,0,prc ENDM ;// ListView_GetGroupCount MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETGROUPCOUNT,0,0 ENDM ;// ;ListView_GetGroupHeaderImageList MACRO ListView:REQ ;ENDM ;// ListView_GetGroupInfo MACRO ListView:REQ,iGroupId:REQ, pgrp:REQ invoke SendMessage,ListView,LVM_GETGROUPINFO,iGroupId,pgrp ENDM ;//取分组信息 ListView_GetGroupInfoByIndex MACRO ListView:REQ,iIndex:REQ, pgrp:REQ invoke SendMessage,ListView,LVM_GETGROUPINFOBYINDEX ,iIndex,pgrp ENDM ;//取分组信息 ListView_GetGroupMetrics MACRO ListView:REQ,pGroupMetrics:REQ invoke SendMessage,ListView,LVM_GETGROUPMETRICS,0,pGroupMetrics ENDM ;// ListView_GetGroupRect MACRO ListView:REQ,iGroupId:REQ,prc:REQ invoke SendMessage,ListView,LVM_GETGROUPRECT,iGroupId,prc ENDM ;// ListView_GetGroupState MACRO ListView:REQ,dwGroupId:REQ,dwMask:REQ invoke SendMessage,ListView,LVM_GETGROUPSTATE ,dwGroupId,dwMask ENDM ;// ListView_GetHeader MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETHEADER ,0,0 ENDM ;// ListView_GetHotCursor MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETHOTCURSOR ,0,0 ENDM ListView_GetHotItem MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETHOTITEM ,0,0 ENDM ListView_GetHoverTime MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETHOVERTIME ,0,0 ENDM ListView_GetImageList MACRO ListView:REQ,iImageList:REQ invoke SendMessage,ListView,LVM_GETHOVERTIME ,0,iImageList ENDM ListView_GetInsertMark MACRO ListView:REQ,plvim:REQ invoke SendMessage,ListView,LVM_GETINSERTMARK,0,plvim ENDM ListView_GetInsertMarkColor MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETINSERTMARKCOLOR,0,0 ENDM ListView_GetInsertMarkRect MACRO ListView:REQ,prc:REQ invoke SendMessage,ListView,LVM_GETINSERTMARKCOLOR,0,prc ENDM ListView_GetISearchString MACRO ListView:REQ, lpsz:REQ invoke SendMessage,ListView,LVM_GETISEARCHSTRING ,0,lpsz ENDM ListView_GetItem MACRO ListView:REQ,pitem:REQ invoke SendMessage,ListView,LVM_GETITEM ,0,pitem ENDM ListView_GetItemCount MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETITEMCOUNT ,0,0 ENDM ListView_GetItemIndexRect MACRO ListView:REQ,plvii:REQ,prc:REQ invoke SendMessage,ListView,LVM_GETITEMINDEXRECT ,plvii,prc ENDM ListView_GetItemPosition MACRO ListView:REQ,i:REQ,ppt:REQ invoke SendMessage,ListView,LVM_GETITEMPOSITION ,i,ppt ENDM ListView_GetItemRect MACRO ListView:REQ, i:REQ,prc:REQ invoke SendMessage,ListView,LVM_GETITEMRECT ,i,prc ENDM ListView_GetItemSpacing MACRO ListView:REQ,fSmall:REQ invoke SendMessage,ListView,LVM_GETITEMSPACING,fSmall,0 ENDM ListView_GetItemState MACRO ListView:REQ,i:REQ,mask:REQ invoke SendMessage,ListView,LVM_GETITEMSTATE ,i,mask ENDM ListView_GetItemText MACRO ListView:REQ,iItem:REQ,pitem:REQ invoke SendMessage,ListView,LVM_GETITEMTEXT ,iItem,pitem ENDM ListView_GetNextItem MACRO ListView:REQ,iStart:REQ,flags:REQ invoke SendMessage,ListView,LVM_GETNEXTITEM ,iStart,flags ENDM ListView_GetNextItemIndex MACRO ListView:REQ,plvii:REQ,flags:REQ invoke SendMessage,ListView,LVM_GETNEXTITEMINDEX ,plvii,flags ENDM ListView_GetNumberOfWorkAreas MACRO ListView:REQ,lpuWorkAreas:REQ invoke SendMessage,ListView,LVM_GETNEXTITEMINDEX ,0,lpuWorkAreas ENDM ListView_GetOrigin MACRO ListView:REQ,lpptOrg:REQ invoke SendMessage,ListView,LVM_GETORIGIN ,0,lpptOrg ENDM ListView_GetOutlineColor MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETOUTLINECOLOR ,0,0 ENDM ListView_GetSelectedColumn MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETSELECTEDCOLUMN ,0,0 ENDM ListView_GetSelectedCount MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETSELECTEDCOUNT ,0,0 ENDM ListView_GetSelectionMark MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETSELECTIONMARK ,0,0 ENDM ListView_GetStringWidth MACRO ListView:REQ,psz:REQ invoke SendMessage,ListView,LVM_GETSTRINGWIDTH,0,psz ENDM ListView_GetSubItemRect MACRO ListView:REQ,iItem,lpRect:REQ invoke SendMessage,ListView,LVM_GETSUBITEMRECT,iItem,lpRect ENDM ListView_GetTextBkColor MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETTEXTBKCOLOR,0,0 ENDM ListView_GetTextColor MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETTEXTCOLOR,0,0 ENDM ListView_GetTileInfo MACRO ListView:REQ,plvtinfo:REQ invoke SendMessage,ListView,LVM_GETTILEINFO,0,plvtinfo ENDM ListView_GetTileViewInfo MACRO ListView:REQ,plvtvinfo:REQ invoke SendMessage,ListView,LVM_GETTILEVIEWINFO ,0,plvtvinfo ENDM ListView_GetToolTips MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETTOOLTIPS ,0,0 ENDM ListView_GetTopIndex MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETTOPINDEX ,0,0 ENDM ListView_GetUnicodeFormat MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETUNICODEFORMAT ,0,0 ENDM ListView_GetView MACRO ListView:REQ invoke SendMessage,ListView,LVM_GETVIEW ,0,0 ENDM ListView_GetViewRect MACRO ListView:REQ,prc:REQ invoke SendMessage,ListView,LVM_GETVIEW ,0,prc ENDM ListView_GetWorkAreas MACRO ListView:REQ,nWorkAreas:REQ,lprc:REQ invoke SendMessage,ListView,LVM_GETWORKAREAS,nWorkAreas,lprc ENDM ListView_HasGroup MACRO ListView:REQ,dwGroupId:REQ invoke SendMessage,ListView,LVM_HASGROUP,dwGroupId,0 ENDM ListView_HitTest MACRO ListView:REQ,pinfo:REQ invoke SendMessage,ListView,LVM_HITTEST,0,pinfo ENDM ListView_HitTestEx MACRO ListView:REQ,pinfo:REQ invoke SendMessage,ListView,LVM_HITTEST,0,pinfo ENDM ListView_InsertColumn MACRO ListView:REQ,iCol:REQ,pcol:REQ invoke SendMessage,ListView,LVM_INSERTCOLUMN,iCol,pcol ENDM ListView_InsertGroup MACRO ListView:REQ,index:REQ,pgrp:REQ invoke SendMessage,ListView,LVM_INSERTGROUP,index,pgrp ENDM ListView_InsertGroupSorted MACRO ListView:REQ,structInsert:REQ invoke SendMessage,ListView,LVM_INSERTGROUPSORTED,structInsert,0 ENDM ListView_InsertItem MACRO ListView:REQ,pitem:REQ invoke SendMessage,ListView,LVM_INSERTITEM,0,pitem ENDM ListView_InsertMarkHitTest MACRO ListView:REQ,point:REQ,plvim:REQ invoke SendMessage,ListView,LVM_INSERTMARKHITTEST,point,plvim ENDM ListView_IsGroupViewEnabled MACRO ListView:REQ invoke SendMessage,ListView,LVM_ISGROUPVIEWENABLED ,0,0 ENDM ListView_IsItemVisible MACRO ListView:REQ,index:REQ invoke SendMessage,ListView,LVM_ISITEMVISIBLE ,index,0 ENDM ListView_MapIDToIndex MACRO ListView:REQ,id:REQ invoke SendMessage,ListView,LVM_MAPIDTOINDEX ,id,0 ENDM ListView_MapIndexToID MACRO ListView:REQ,index:REQ invoke SendMessage,ListView,LVM_MAPINDEXTOID ,index,0 ENDM ListView_RedrawItems MACRO ListView:REQ,iFirst:REQ,iLast:REQ invoke SendMessage,ListView,LVM_REDRAWITEMS ,iFirst,iLast ENDM ListView_RemoveAllGroups MACRO ListView:REQ invoke SendMessage,ListView,LVM_REMOVEALLGROUPS ,0,0 ENDM ListView_RemoveGroup MACRO ListView:REQ,iGroupId:REQ invoke SendMessage,ListView,LVM_REMOVEGROUP ,iGroupId,0 ENDM ListView_Scroll MACRO ListView:REQ,dx:REQ,dy:REQ invoke SendMessage,ListView,LVM_SCROLL ,dx,dy ENDM ListView_SetBkColor MACRO ListView:REQ,clrBk:REQ invoke SendMessage,ListView,LVM_SETBKCOLOR ,0,clrBk ENDM ListView_SetBkImage MACRO ListView:REQ,plvbki:REQ invoke SendMessage,ListView,LVM_SETBKIMAGE ,0,plvbki ENDM ListView_SetCallbackMask MACRO ListView:REQ,mask:REQ invoke SendMessage,ListView,LVM_SETCALLBACKMASK ,mask,0 ENDM ListView_SetCheckState MACRO ListView:REQ,i:REQ,pitem:REQ invoke SendMessage,ListView,LVM_SETITEMSTATE,i,pitem ENDM ListView_SetColumn MACRO ListView:REQ,iCol:REQ,pcol:REQ invoke SendMessage,ListView,LVM_SETCOLUMN,iCol,pcol ENDM ListView_SetColumnOrderArray MACRO ListView:REQ,iCount:REQ,lpiArray:REQ invoke SendMessage,ListView,LVM_SETCOLUMNORDERARRAY,iCount,lpiArray ENDM ListView_SetColumnWidth MACRO ListView:REQ,iCol:REQ,cx:REQ invoke SendMessage,ListView,LVM_SETCOLUMNWIDTH ,iCol,cx ENDM ListView_SetExtendedListViewStyle MACRO ListView:REQ,dwExMask:REQ,dwExStyle:REQ invoke SendMessage,ListView,LVM_SETEXTENDEDLISTVIEWSTYLE ,dwExMask,dwExStyle ENDM ListView_SetGroupInfo MACRO ListView:REQ,iGroupId:REQ,pgrp:REQ invoke SendMessage,ListView,LVM_SETGROUPINFO ,iGroupId,pgrp ENDM ListView_SetGroupMetrics MACRO ListView:REQ,pGroupMetrics:REQ invoke SendMessage,ListView,LVM_SETGROUPMETRICS,0,pGroupMetrics ENDM ListView_SetHotCursor MACRO ListView:REQ,hCursor:REQ invoke SendMessage,ListView,LVM_SETHOTCURSOR,0,hCursor ENDM ListView_SetHotItem MACRO ListView:REQ,iIndex:REQ invoke SendMessage,ListView,LVM_SETHOTITEM ,iIndex,0 ENDM ListView_SetHoverTime MACRO ListView:REQ,dwHoverTime:REQ invoke SendMessage,ListView,LVM_SETHOVERTIME , 0,dwHoverTime ENDM ListView_SetIconSpacing MACRO ListView:REQ,cx:REQ,cy:REQ invoke SendMessage,ListView,LVM_SETICONSPACING , 0,MAKELONG(cx,cy) ENDM ListView_SetImageList MACRO ListView:REQ,iImageList:REQ,himl:REQ invoke SendMessage,ListView,LVM_SETIMAGELIST , iImageList,himl ENDM ListView_SetInfoTip MACRO ListView:REQ,plvSetInfoTip:REQ invoke SendMessage,ListView,LVM_SETINFOTIP , 0,plvSetInfoTip ENDM ListView_SetInsertMark MACRO ListView:REQ,plvim:REQ invoke SendMessage,ListView,LVM_SETINSERTMARK, 0, plvim ENDM ListView_SetInsertMarkColor MACRO ListView:REQ,color:REQ invoke SendMessage,ListView,LVM_SETINSERTMARKCOLOR, 0, plvim ENDM ListView_SetItem MACRO ListView:REQ,pitem:REQ invoke SendMessage,ListView,LVM_SETITEM , 0, pitem ENDM ListView_SetItemCount MACRO ListView:REQ,cItems:REQ,dwFlags:REQ invoke SendMessage,ListView,LVM_SETITEMCOUNT , cItems, dwFlags ENDM ListView_SetItemIndexState MACRO ListView:REQ,plvii:REQ,lvi:REQ invoke SendMessage,ListView,LVM_SETITEMINDEXSTATE , plvii, lvi ENDM ListView_SetItemPosition MACRO ListView:REQ,i:REQ,x:REQ,y:REQ invoke SendMessage,ListView,LVM_SETITEMPOSITION , i, MAKELONG(x,y) ENDM ListView_SetItemPosition32 MACRO ListView:REQ,i:REQ,x:REQ,y:REQ invoke SendMessage,ListView,LVM_SETITEMPOSITION , i, MAKELONG(x,y) ENDM ListView_SetItemState MACRO ListView:REQ,i:REQ,pitem:REQ invoke SendMessage,ListView,LVM_SETITEMSTATE , i,pitem ENDM ListView_SetItemText MACRO ListView:REQ,i:REQ,pitem:REQ invoke SendMessage,ListView,LVM_SETITEMTEXT , i,pitem ENDM ListView_SetOutlineColor MACRO ListView:REQ,color:REQ invoke SendMessage,ListView,LVM_SETOUTLINECOLOR , 0,color ENDM ListView_SetSelectedColumn MACRO ListView:REQ,iCol:REQ invoke SendMessage,ListView,LVM_SETSELECTEDCOLUMN , 0,iCol ENDM ListView_SetSelectionMark MACRO ListView:REQ,iIndex:REQ invoke SendMessage,ListView,LVM_SETSELECTIONMARK , 0,iIndex ENDM ListView_SetTextBkColor MACRO ListView:REQ,clrText:REQ invoke SendMessage,ListView,LVM_SETTEXTBKCOLOR , 0,clrText ENDM ListView_SetTextColor MACRO ListView:REQ,clrText:REQ invoke SendMessage,ListView,LVM_SETTEXTCOLOR , 0,clrText ENDM ListView_SetTileInfo MACRO ListView:REQ,plvtinfo:REQ invoke SendMessage,ListView,LVM_SETTILEINFO , 0,plvtinfo ENDM ListView_SetTileViewInfo MACRO ListView:REQ,plvtvinfo:REQ invoke SendMessage,ListView,LVM_SETTILEVIEWINFO , 0,plvtinfo ENDM ListView_SetToolTips MACRO ListView:REQ,hwndToolTip:REQ invoke SendMessage,ListView,LVM_SETTOOLTIPS , 0,hwndToolTip ENDM ListView_SetUnicodeFormat MACRO ListView:REQ,fUnicode:REQ invoke SendMessage,ListView,LVM_SETUNICODEFORMAT , fUnicode,0 ENDM ListView_SetView MACRO ListView:REQ,iView:REQ invoke SendMessage,ListView,LVM_SETVIEW , iView,0 ENDM ListView_SetWorkAreas MACRO ListView:REQ,nWorkAreas:REQ,lprc:REQ invoke SendMessage,ListView,LVM_SETWORKAREAS , nWorkAreas,lprc ENDM ListView_SortGroups MACRO ListView:REQ,pfnGroupCompare:REQ,plv:REQ invoke SendMessage,ListView,LVM_SORTGROUPS , pfnGroupCompare,plv ENDM ListView_SortItems MACRO ListView:REQ,pfnCompare:REQ,lParamSort:REQ invoke SendMessage,ListView,LVM_SORTITEMS , lParamSort,pfnCompare ENDM ListView_SubItemHitTest MACRO ListView:REQ,pInfo:REQ invoke SendMessage,ListView,LVM_SUBITEMHITTEST , 0,pInfo ENDM ListView_Update MACRO ListView:REQ,iItem:REQ invoke SendMessage,ListView,LVM_UPDATE , iItem,0 ENDM ;////////////////////////////////////////////////////////////////////////////// ;//comboBox宏 ComboBox_Enable MACRO hwndCtl:REQ, fEnable:REQ INVOKE EnableWindow ,hwndCtl ,fEnable ENDM ComboBox_GetText MACRO hwndCtl:REQ, lpch:REQ, cchMax:REQ PUSH EDI LEA EDI,lpch INVOKE GetWindowText ,hwndCtl, EDI, cchMax POP EDI ENDM ComboBox_SetText MACRO hwndCtl:REQ, lpsz:REQ INVOKE SetWindowText ,hwndCtl,addr lpsz ENDM ComboBox_LimitText MACRO hwndCtl:REQ, cchLimit:REQ INVOKE SendMessage ,hwndCtl,CB_LIMITTEXT,cchLimit,0 ENDM ComboBox_GetEditSel MACRO hwndCtl:REQ invoke SendMessage ,hwndCtl,CB_GETEDITSEL, 0,0 ENDM ComboBox_GetTextLength MACRO hwndCtl:REQ INVOKE GetWindowTextLength,hwndCtl ENDM ComboBox_SetEditSel MACRO hwndCtl:REQ, ichStart:REQ, ichEnd:REQ PUSH EDI MOV EDI,0 mov AH,ichEnd SHL EDI,8 mov AL,ichStart invoke SendMessage ,hwndCtl , CB_SETEDITSEL, 0,EDI POP EDI ENDM ComboBox_GetCount MACRO hwndCtl:REQ invoke SendMessage,hwndCtl, CB_GETCOUNT, 0, 0 ENDM ComboBox_ResetContent MACRO hwndCtl:REQ invoke SendMessage ,hwndCtl, CB_RESETCONTENT, 0, 0 ENDM ComboBox_AddString MACRO hwndCtl:REQ,lpsz:REQ PUSH EDI LEA EDI,lpsz invoke SendMessage,hwndCtl, CB_ADDSTRING, 0,EDI POP EDI ENDM ComboBox_InsertString MACRO hwndCtl:REQ, index:REQ, lpsz:REQ push edi lea edi ,lpsz invoke SendMessage,hwndCtl, CB_INSERTSTRING,index,EDI pop edi ENDM ;//////////////////////////////////////////////////////////////////////////////// ;//TAB控件对应的宏 TabCtrl_InsertItem MACRO hwndCtl:REQ, iItem:REQ, pitem:REQ invoke SendMessage,hwndCtl,TCM_INSERTITEM,iItem,pitem ENDM TabCtrl_DeleteItem MACRO hwndCtl:REQ, iItem:REQ invoke SendMessage ,hwndCtl,TCM_DELETEITEM ,iItem,0 ENDM TabCtrl_GetCurSel MACRO hwndCtl:REQ invoke SendMessage ,hwndCtl,TCM_GETCURSEL ,0,0 ENDM TabCtrl_GetItem MACRO hwndCtl:REQ, iItem:REQ, pitem:REQ invoke SendMessage ,hwndCtl,TCM_GETITEM ,iItem,addr pitem ENDM TabCtrl_GetRowCount MACRO hwndCtl:REQ invoke SendMessage ,hwndCtl,TCM_GETROWCOUNT ,0,0 ENDM TabCtrl_SetImageList MACRO hwndCtl:REQ, himl:REQ invoke SendMessage ,hwndCtl,TCM_SETIMAGELIST ,0, himl ENDM TabCtrl_SetItem MACRO hwndCtl:REQ, iItem:REQ, pitem:REQ invoke SendMessage ,hwndCtl,TCM_SETITEM ,iItem, ADDR pitem ENDM TabCtrl_GetItemCount MACRO hwndCtl:REQ invoke SendMessage ,hwndCtl,TCM_GETITEMCOUNT ,0,0 ENDM TabCtrl_SetMinTabWidth MACRO hwndCtl:REQ ,cx:REQ invoke SendMessage,hwndCtl,TCM_SETMINTABWIDTH,0,cx ENDM TabCtrl_SetItemSize MACRO hwndCtl:REQ ,cx:REQ,cy:REQ MOV eax,0 mov AH,cy SHL eax,8 mov AL,cx invoke SendMessage ,hwndCtl , TCM_SETITEMSIZE, 0,eax ENDM TabCtrl_SetCurSel MACRO hwndCtl:REQ ,iIndex:REQ invoke SendMessage ,hwndCtl,TCM_SETCURSEL ,iIndex,0 ENDM ;//////////////////////////////////////////////////////////////////////////////// ENDIF