2005年04月30日

1. API之网络函数

WNetAddConnection 创建同一个网络资源的永久性连接
WNetAddConnection2 创建同一个网络资源的连接
WNetAddConnection3 创建同一个网络资源的连接
WNetCancelConnection 结束一个网络连接
WNetCancelConnection2 结束一个网络连接
WNetCloseEnum 结束一次枚举操作
WNetConnectionDialog 启动一个标准对话框,以便建立同网络资源的连接
WNetDisconnectDialog 启动一个标准对话框,以便断开同网络资源的连接
WNetEnumResource 枚举网络资源
WNetGetConnection 获取本地或已连接的一个资源的网络名称
WNetGetLastError 获取网络错误的扩展错误信息
WNetGetUniversalName 获取网络中一个文件的远程名称以及/或者UNC(统一命名规范)名称
WNetGetUser 获取一个网络资源用以连接的名字
WNetOpenEnum 启动对网络资源进行枚举的过程

2. API之消息函数

BroadcastSystemMessage 将一条系统消息广播给系统中所有的顶级窗口
GetMessagePos 取得消息队列中上一条消息处理完毕时的鼠标指针屏幕位置
GetMessageTime 取得消息队列中上一条消息处理完毕时的时间
PostMessage 将一条消息投递到指定窗口的消息队列
PostThreadMessage 将一条消息投递给应用程序
RegisterWindowMessage 获取分配给一个字串标识符的消息编号
ReplyMessage 答复一个消息
SendMessage 调用一个窗口的窗口函数,将一条消息发给那个窗口
SendMessageCallback 将一条消息发给窗口
SendMessageTimeout 向窗口发送一条消息
SendNotifyMessage 向窗口发送一条消息

3. API之文件处理函数

CloseHandle 关闭一个内核对象。其中包括文件、文件映射、进程、线程、安全和同步对象等
CompareFileTime 对比两个文件的时间
CopyFile 复制文件
CreateDirectory 创建一个新目录
CreateFile 打开和创建文件、管道、邮槽、通信服务、设备以及控制台
CreateFileMapping 创建一个新的文件映射对象
DeleteFile 删除指定文件
DeviceIoControl 对设备执行指定的操作
DosDateTimeToFileTime 将DOS日期和时间值转换成一个 win32 FILETIME 值
FileTimeToDosDateTime 将一个 win32 FILETIME 值转换成DOS日期和时间值
FileTimeToLocalFileTime 将一个FILETIME结构转换成本地时间
FileTimeToSystemTime 根据一个FILETIME结构的内容,装载一个SYSTEMTIME结构
FindClose 关闭由FindFirstFile函数创建的一个搜索句柄
FindFirstFile 根据文件名查找文件
FindNextFile 根据调用FindFirstFile函数时指定的一个文件名查找下一个文件
FlushFileBuffers 针对指定的文件句柄,刷新内部文件缓冲区
FlushViewOfFile 将写入文件映射缓冲区的所有数据都刷新到磁盘
GetBinaryType 判断文件是否可以执行
GetCompressedFileSize 判断一个压缩文件在磁盘上实际占据的字节数
GetCurrentDirectory 在一个缓冲区中装载当前目录
GetDiskFreeSpace 获取与一个磁盘的组织有关的信息,以及了解剩余空间的容量
GetDiskFreeSpaceEx 获取与一个磁盘的组织以及剩余空间容量有关的信息
GetDriveType 判断一个磁盘驱动器的类型
GetExpandedName 取得一个压缩文件的全名
GetFileAttributes 判断指定文件的属性
GetFileInformationByHandle 这个函数提供了获取文件信息的一种机制
GetFileSize 判断文件长度
GetFileTime 取得指定文件的时间信息
GetFileType 在给出文件句柄的前提下,判断文件类型
GetFileVersionInfo 从支持版本标记的一个模块里获取文件版本信息
GetFileVersionInfoSize 针对包含了版本资源的一个文件,判断容纳文件版本信息需要一个多大的缓冲区
GetFullPathName 获取指定文件的完整路径名
GetLogicalDrives 判断系统中存在哪些逻辑驱动器字母
GetLogicalDriveStrings 获取一个字串,其中包含了当前所有逻辑驱动器的根驱动器路径
GetOverlappedResult 判断一个重叠操作当前的状态
GetPrivateProfileInt 为初始化文件(.ini文件)中指定的条目获取一个整数值
GetPrivateProfileSection 获取指定小节(在.ini文件中)所有项名和值的一个列表
GetPrivateProfileString 为初始化文件中指定的条目取得字串
GetProfileInt 取得win.ini初始化文件中指定条目的一个整数值
GetProfileSection 获取指定小节(在win.ini文件中)所有项名和值的一个列表
GetProfileString 为win.ini初始化文件中指定的条目取得字串
GetShortPathName 获取指定文件的短路径名
GetSystemDirectory 取得Windows系统目录(即System目录)的完整路径名
GetTempFileName 这个函数包含了一个临时文件的名字,它可由应用程序使用
GetTempPath 获取为临时文件指定的路径
GetVolumeInformation 获取与一个磁盘卷有关的信息
GetWindowsDirectory 获取Windows目录的完整路径名
hread 参考lread
hwrite 参考lwrite函数
lclose 关闭指定的文件
lcreat 创建一个文件
llseek 设置文件中进行读写的当前位置
LockFile 锁定文件的某一部分,使其不与其他应用程序共享
LockFileEx 与LockFile相似,只是它提供了更多的功能
lopen 以二进制模式打开指定的文件
lread 将文件中的数据读入内存缓冲区
lwrite 将数据从内存缓冲区写入一个文件
LZClose 关闭由LZOpenFile 或 LZInit函数打开的一个文件
LZCopy 复制一个文件
LZInit 这个函数用于初始化内部缓冲区
LZOpenFile 该函数能执行大量不同的文件处理,而且兼容于压缩文件
LZRead 将数据从文件读入内存缓冲区
LZSeek 设置一个文件中进行读写的当前位置
MapViewOfFile 将一个文件映射对象映射到当前应用程序的地址空间
MoveFile 移动文件
OpenFile 这个函数能执行大量不同的文件操作
OpenFileMapping 打开一个现成的文件映射对象
QueryDosDevice 在Windows NT中,DOS设备名会映射成NT系统设备名。该函数可判断当前的设备映射情况
ReadFile 从文件中读出数据
ReadFileEx 与ReadFile相似,只是它只能用于异步读操作,并包含了一个完整的回调
RegCloseKey 关闭系统注册表中的一个项(或键)
RegConnectRegistry 访问远程系统的部分注册表
RegCreateKey 在指定的项下创建或打开一个项
RegCreateKeyEx 在指定项下创建新项的更复杂的方式。在Win32环境中建议使用这个函数
RegDeleteKey 删除现有项下方一个指定的子项
RegDeleteValue 删除指定项下方的一个值
RegEnumKey 枚举指定项的子项。在Win32环境中应使用RegEnumKeyEx
RegEnumKeyEx 枚举指定项下方的子项
RegEnumValue 枚举指定项的值
RegFlushKey 将对项和它的子项作出的改动实际写入磁盘
RegGetKeySecurity 获取与一个注册表项有关的安全信息
RegLoadKey 从以前用RegSaveKey函数创建的一个文件里装载注册表信息
RegNotifyChangeKeyValue 注册表项或它的任何一个子项发生变化时,用这个函数提供一种通知机制
RegOpenKey 打开一个现有的注册表项
RegOpenKeyEx 打开一个现有的项。在win32下推荐使用这个函数
RegQueryInfoKey 获取与一个项有关的信息
RegQueryValue 取得指定项或子项的默认(未命名)值
RegQueryValueEx 获取一个项的设置值
RegReplaceKey 用一个磁盘文件保存的信息替换注册表信息;并创建一个备份,在其中包含当前注册表信息
RegRestoreKey 从一个磁盘文件恢复注册表信息
RegSaveKey 将一个项以及它的所有子项都保存到一个磁盘文件
RegSetKeySecurity 设置指定项的安全特性
RegSetValue 设置指定项或子项的默认值
RegSetValueEx 设置指定项的值
RegUnLoadKey 卸载指定的项以及它的所有子项
RemoveDirectory 删除指定目录
SearchPath 查找指定文件
SetCurrentDirectory 设置当前目录
SetEndOfFile 针对一个打开的文件,将当前文件位置设为文件末尾
SetFileAttributes 设置文件属性
SetFilePointer 在一个文件中设置当前的读写位置
SetFileTime 设置文件的创建、访问及上次修改时间
SetHandleCount 这个函数不必在win32下使用;即使使用,也不会有任何效果
SetVolumeLabel 设置一个磁盘的卷标(Label)
SystemTimeToFileTime 根据一个FILETIME结构的内容,载入一个SYSTEMTIME结构
UnlockFile 解除对一个文件的锁定
UnlockFileEx 解除对一个文件的锁定
UnmapViewOfFile 在当前应用程序的内存地址空间解除对一个文件映射对象的映射
VerFindFile 用这个函数决定一个文件应安装到哪里
VerInstallFile 用这个函数安装一个文件
VerLanguageName 这个函数能根据16位语言代码获取一种语言的名称
VerQueryValue 这个函数用于从版本资源中获取信息
WriteFile 将数据写入一个文件
WriteFileEx 与WriteFile类似,只是它只能用于异步写操作,并包括了一个完整的回调
WritePrivateProfileSection 为一个初始化文件(.ini)中指定的小节设置所有项名和值
WritePrivateProfileString 在初始化文件指定小节内设置一个字串
WriteProfileSection 为Win.ini初始化文件中一个指定的小节设置所有项名和值
WriteProfileString 在Win.ini初始化文件指定小节内设置一个字串

4. API之打印函数
AbortDoc 取消一份文档的打印
AbortPrinter 删除与一台打印机关联在一起的缓冲文件
AddForm 为打印机的表单列表添加一个新表单
AddJob 用于获取一个有效的路径名,以便用它为作业创建一个后台打印文件。它也会为作业分配一个作业编号
AddMonitor 为系统添加一个打印机监视器
AddPort 启动“添加端口”对话框,允许用户在系统可用端口列表中加入一个新端口
AddPrinter 在系统中添加一台新打印机
AddPrinterConnection 连接指定的打印机
AddPrinterDriver 为指定的系统添加一个打印驱动程序
AddPrintProcessor 为指定的系统添加一个打印处理器
AddPrintProvidor 为系统添加一个打印供应商
AdvancedDocumentProperties 启动打印机文档设置对话框
ClosePrinter 关闭一个打开的打印机对象
ConfigurePort 针对指定的端口,启动一个端口配置对话框
ConnectToPrinterDlg 启动连接打印机对话框,用它同访问网络的打印机连接
DeleteForm 从打印机可用表单列表中删除一个表单
DeleteMonitor 删除指定的打印监视器
DeletePort 启动“删除端口”对话框,允许用户从当前系统删除一个端口
DeletePrinter 将指定的打印机标志为从系统中删除
DeletePrinterConnection 删除与指定打印机的连接
DeletePrinterDriver 从系统删除一个打印机驱动程序
DeletePrintProcessor 从指定系统删除一个打印处理器
DeletePrintProvidor 从系统中删除一个打印供应商
DeviceCapabilities 利用这个函数可获得与一个设备的能力有关的信息
DocumentProperties 打印机配置控制函数
EndDocAPI 结束一个成功的打印作业
EndDocPrinter 在后台打印程序的级别指定一个文档的结束
EndPage 用这个函数完成一个页面的打印,并准备设备场景,以便打印下一个页
EndPagePrinter 指定一个页在打印作业中的结尾
EnumForms 枚举一台打印机可用的表单
EnumJobs 枚举打印队列中的作业
EnumMonitors 枚举可用的打印监视器
EnumPorts 枚举一个系统可用的端口
EnumPrinterDrivers 枚举指定系统中已安装的打印机驱动程序
EnumPrinters 枚举系统中安装的打印机
EnumPrintProcessorDatatypes 枚举由一个打印处理器支持的数据类型
EnumPrintProcessors 枚举系统中可用的打印处理器
Escape 设备控制函数
FindClosePrinterChangeNotification 关闭用FindFirstPrinterChangeNotification函数获取的一个打印机通告对象
FindFirstPrinterChangeNotification 创建一个新的改变通告对象,以便我们注意打印机状态的各种变化
FindNextPrinterChangeNotification 用这个函数判断触发一次打印机改变通告信号的原因
FreePrinterNotifyInfo 释放由FindNextPrinterChangeNotification函数分配的一个缓冲区
GetForm 取得与指定表单有关的信息
GetJob 获取与指定作业有关的信息
GetPrinter 取得与指定打印机有关的信息
GetPrinterData 为打印机设置注册表配置信息
GetPrinterDriver 针对指定的打印机,获取与打印机驱动程序有关的信息
GetPrinterDriverDirectory 判断指定系统中包含了打印机驱动程序的目录是什么
GetPrintProcessorDirectory 判断指定系统中包含了打印机处理器驱动程序及文件的目录
OpenPrinter 打开指定的打印机,并获取打印机的句柄
PrinterMessageBox 在拥有指定打印作业的系统上显示一个打印机出错消息框
PrinterProperties 启动打印机属性对话框,以便对打印机进行配置
ReadPrinter 从打印机读入数据
ResetDC 重设一个设备场景
ResetPrinter 改变指定打印机的默认数据类型及文档设置
ScheduleJob 提交一个要打印的作业
SetAbortProc 为Windows指定取消函数的地址
SetForm 为指定的表单设置信息
SetJob 对一个打印作业的状态进行控制
SetPrinter 对一台打印机的状态进行控制
SetPrinterData 设置打印机的注册表配置信息
StartDoc 开始一个打印作业
StartDocPrinter 在后台打印的级别启动一个新文档
StartPage 打印一个新页前要先调用这个函数
StartPagePrinter 在打印作业中指定一个新页的开始
WritePrinter 将发送目录中的数据写入打印机

5. API之文本和字体函数

AddFontResource 在Windows系统中添加一种字体资源
CreateFont 用指定的属性创建一种逻辑字体
CreateFontIndirect 用指定的属性创建一种逻辑字体
CreateScalableFontResource 为一种TureType字体创建一个资源文件,以便能用API函数AddFontResource将其加入Windows系统
DrawText 将文本描绘到指定的矩形中
DrawTextEx 与DrawText相似,只是加入了更多的功能
EnumFontFamilies 列举指定设备可用的字体
EnumFontFamiliesEx 列举指定设备可用的字体
EnumFonts 列举指定设备可用的字体
ExtTextOut 经过扩展的文本描绘函数。也请参考SetTextAlign函数
GetAspectRatioFilterEx 用SetMapperFlags要求Windows只选择与设备当前纵横比相符的光栅字体时,本函数可判断纵横比大小
GetCharABCWidths 判断TureType字体中一个或多个字符的A-B-C大小
GetCharABCWidthsFloat 查询一种字体中一个或多个字符的A-B-C尺寸
GetCharacterPlacement 该函数用于了解如何用一个给定的字符显示一个字串
GetCharWidth 调查字体中一个或多个字符的宽度
GetFontData 接收一种可缩放字体文件的数据
GetFontLanguageInfo 返回目前选入指定设备场景中的字体的信息
GetGlyphOutline 取得TureType字体中构成一个字符的曲线信息
GetKerningPairs 取得指定字体的字距信息
GetOutlineTextMetrics 接收与TureType字体内部特征有关的详细信息
GetRasterizerCaps 了解系统是否有能力支持可缩放的字体
GetTabbedTextExtent 判断一个字串占据的范围,同时考虑制表站扩充的因素
GetTextAlign 接收一个设备场景当前的文本对齐标志
GetTextCharacterExtra 判断额外字符间距的当前值
GetTextCharset 接收当前选入指定设备场景的字体的字符集标识符
GetTextCharsetInfo 获取与当前选定字体的字符集有关的详细信息
GetTextColor 判断当前字体颜色。通常也称为“前景色”
GetTextExtentExPoint 判断要填入指定区域的字符数量。也用一个数组装载每个字符的范围信息
GetTextExtentPoint 判断一个字串的大小(范围)
GetTextFace 获取一种字体的字样名
GetTextMetrics 获取与选入一种设备场景的物理字体有关的信息
GrayString 描绘一个以灰色显示的字串。通常由Windows用于标识禁止状态
PolyTextOut 描绘一系列字串
RemoveFontResource 从Windows系统中删除一种字体资源
SetMapperFlags Windows对字体进行映射时,可用该函数选择与目标设备的纵横比相符的光栅字体
SetTextAlign 设置文本对齐方式,并指定在文本输出过程中使用设备场景的当前位置
SetTextCharacterExtra 描绘文本的时候,指定要在字符间插入的额外间距
SetTextColor 设置当前文本颜色。这种颜色也称为“前景色”
SetTextJustification 通过指定一个文本行应占据的额外空间,可用这个函数对文本进行两端对齐处理
TabbedTextOut 支持制表站的一个文本描绘函数
TextOut 文本绘图函数

6. API之菜单函数

AppendMenu 在指定的菜单里添加一个菜单项
CheckMenuItem 复选或撤消复选指定的菜单条目
CheckMenuRadioItem 指定一个菜单条目被复选成“单选”项目
CreateMenu 创建新菜单
CreatePopupMenu 创建一个空的弹出式菜单
DeleteMenu 删除指定的菜单条目
DestroyMenu 删除指定的菜单
DrawMenuBar 为指定的窗口重画菜单
EnableMenuItem 允许或禁止指定的菜单条目
GetMenu 取得窗口中一个菜单的句柄
GetMenuCheckMarkDimensions 返回一个菜单复选符的大小
GetMenuContextHelpId 取得一个菜单的帮助场景ID
GetMenuDefaultItem 判断菜单中的哪个条目是默认条目
GetMenuItemCount 返回菜单中条目(菜单项)的数量
GetMenuItemID 返回位于菜单中指定位置处的条目的菜单ID
GetMenuItemInfo 取得(接收)与一个菜单条目有关的特定信息
GetMenuItemRect 在一个矩形中装载指定菜单条目的屏幕坐标信息
GetMenuState 取得与指定菜单条目状态有关的信息
GetMenuString 取得指定菜单条目的字串
GetSubMenu 取得一个弹出式菜单的句柄,它位于菜单中指定的位置
GetSystemMenu 取得指定窗口的系统菜单的句柄
HiliteMenuItem 控制顶级菜单条目的加亮显示状态
InsertMenu 在菜单的指定位置处插入一个菜单条目,并根据需要将其他条目向下移动
InsertMenuItem 插入一个新菜单条目
IsMenu 判断指定的句柄是否为一个菜单的句柄
LoadMenu 从指定的模块或应用程序实例中载入一个菜单
LoadMenuIndirect 载入一个菜单
MenuItemFromPoint 判断哪个菜单条目包含了屏幕上一个指定的点
ModifyMenu 改变菜单条目
RemoveMenu 删除指定的菜单条目
SetMenu 设置窗口菜单
SetMenuContextHelpId 设置一个菜单的帮助场景ID
SetMenuDefaultItem 将一个菜单条目设为默认条目
SetMenuItemBitmaps 设置一幅特定位图,令其在指定的菜单条目中使用,代替标准的复选符号(√)
SetMenuItemInfo 为一个菜单条目设置指定的信息
TrackPopupMenu 在屏幕的任意地方显示一个弹出式菜单
TrackPopupMenuEx 与TrackPopupMenu相似,只是它提供了额外的功能

7. API之位图、图标和光栅运算函数
BitBlt 将一幅位图从一个设备场景复制到另一个
CopyIcon 制作指定图标或鼠标指针的一个副本。这个副本从属于发出调用的应用程序
CopyImage 复制位图、图标或指针,同时在复制过程中进行一些转换工作
CreateBitmap 按照规定的格式创建一幅与设备有关位图
CreateBitmapIndirect 创建一幅与设备有关位图
CreateCompatibleBitmap 创建一幅与设备有关位图,它与指定的设备场景兼容
CreateCursor 创建一个鼠标指针
CreateDIBitmap 根据一幅与设备无关的位图创建一幅与设备有关的位图
CreateDIBSection 创建一个DIBSection
CreateIcon 创建一个图标
CreateIconIndirect 创建一个图标
DestroyCursor 清除指定的鼠标指针,并释放它占用的所有系统资源
DestroyIcon 清除图标
DrawIcon 在指定的位置画一个图标
DrawIconEx 描绘一个图标或鼠标指针。与DrawIcon相比,这个函数提供了更多的功能
ExtractAssociatedIcon 判断一个可执行程序或DLL中是否存在图标,或是否有图标与系统注册表中指定的文件存在关联并提取之
ExtractIcon 判断一个可执行文件或DLL中是否有图标存在,并将其提取出来
GetBitmapBits 将来自位图的二进制位复制到一个缓冲区
GetBitmapDimensionEx 取得一幅位图的宽度和高度
GetDIBColorTable 从选入设备场景的DIBSection中取得颜色表信息
GetDIBits 将来自一幅位图的二进制位复制到一幅与设备无关的位图里
GetIconInfo 取得与图标有关的信息
GetStretchBltMode 判断StretchBlt 和 StretchDIBits函数采用的伸缩模式
LoadBitmap 从指定的模块或应用程序实例中载入一幅位图
LoadCursor 从指定的模块或应用程序实例中载入一个鼠标指针
LoadCursorFromFile 在一个指针文件或一个动画指针文件的基础上创建一个指针
LoadIcon 从指定的模块或应用程序实例中载入一个图标
LoadImage 载入一个位图、图标或指针
MaskBlt 执行复杂的图象传输,同时进行掩模(MASK)处理
PatBlt 在当前选定的刷子的基础上,用一个图案填充指定的设备场景
PlgBlt 复制一幅位图,同时将其转换成一个平行四边形。利用它可对位图进行旋转处理
SetBitmapBits 将来自缓冲区的二进制位复制到一幅位图
SetBitmapDimensionEx 设置一幅位图的宽度。以一毫米的十分之一为单位
SetDIBColorTable 设置选入设备场景的一个DIBSection的颜色表信息
SetDIBits 将来自与设备无关位图的二进制位复制到一幅与设备有关的位图里
SetDIBitsToDevice 将一幅与设备无关位图的全部或部分数据直接复制到一个设备
SetStretchBltMode 指定StretchBlt 和 StretchDIBits函数的伸缩模式
StretchBlt 将一幅位图从一个设备场景复制到另一个
StretchDIBits 将一幅与设备无关位图的全部或部分数据直接复制到指定的设备场景

8. API之绘图函数

AbortPath 抛弃选入指定设备场景中的所有路径。也取消目前正在进行的任何路径的创建工作
AngleArc 用一个连接弧画一条线
Arc 画一个圆弧
BeginPath 启动一个路径分支
CancelDC 取消另一个线程里的长时间绘图操作
Chord 画一个弦
CloseEnhMetaFile 关闭指定的增强型图元文件设备场景,并将新建的图元文件返回一个句柄
CloseFigure 描绘到一个路径时,关闭当前打开的图形
CloseMetaFile 关闭指定的图元文件设备场景,并向新建的图元文件返回一个句柄
CopyEnhMetaFile 制作指定增强型图元文件的一个副本(拷贝)
CopyMetaFile 制作指定(标准)图元文件的一个副本
CreateBrushIndirect 在一个LOGBRUSH数据结构的基础上创建一个刷子
CreateDIBPatternBrush 用一幅与设备无关的位图创建一个刷子,以便指定刷子样式(图案)
CreateEnhMetaFile 创建一个增强型的图元文件设备场景
CreateHatchBrush 创建带有阴影图案的一个刷子
CreateMetaFile 创建一个图元文件设备场景
CreatePatternBrush 用指定了刷子图案的一幅位图创建一个刷子
CreatePen 用指定的样式、宽度和颜色创建一个画笔
CreatePenIndirect 根据指定的LOGPEN结构创建一个画笔
CreateSolidBrush 用纯色创建一个刷子
DeleteEnhMetaFile 删除指定的增强型图元文件
DeleteMetaFile 删除指定的图元文件
DeleteObject 删除GDI对象,对象使用的所有系统资源都会被释放
DrawEdge 用指定的样式描绘一个矩形的边框
DrawEscape 换码(Escape)函数将数据直接发至显示设备驱动程序
DrawFocusRect 画一个焦点矩形
DrawFrameControl 描绘一个标准控件
DrawState 为一幅图象或绘图操作应用各式各样的效果
Ellipse 描绘一个椭圆,由指定的矩形围绕
EndPath 停止定义一个路径
EnumEnhMetaFile 针对一个增强型图元文件,列举其中单独的图元文件记录
EnumMetaFile 为一个标准的windows图元文件枚举单独的图元文件记录
EnumObjects 枚举可随同指定设备场景使用的画笔和刷子
ExtCreatePen 创建一个扩展画笔(装饰或几何)
ExtFloodFill 在指定的设备场景里,用当前选择的刷子填充一个区域
FillPath 关闭路径中任何打开的图形,并用当前刷子填充
FillRect 用指定的刷子填充一个矩形
FlattenPath 将一个路径中的所有曲线都转换成线段
FloodFill 用当前选定的刷子在指定的设备场景中填充一个区域
FrameRect 用指定的刷子围绕一个矩形画一个边框
GdiComment 为指定的增强型图元文件设备场景添加一条注释信息
GdiFlush 执行任何未决的绘图操作
GdiGetBatchLimit 判断有多少个GDI绘图命令位于队列中
GdiSetBatchLimit 指定有多少个GDI绘图命令能够进入队列
GetArcDirection 画圆弧的时候,判断当前采用的绘图方向
GetBkColor 取得指定设备场景当前的背景颜色
GetBkMode 针对指定的设备场景,取得当前的背景填充模式
GetBrushOrgEx 判断指定设备场景中当前选定刷子起点
GetCurrentObject 获得指定类型的当前选定对象
GetCurrentPositionEx 在指定的设备场景中取得当前的画笔位置
GetEnhMetaFile 取得磁盘文件中包含的一个增强型图元文件的图元文件句柄
GetEnhMetaFileBits 将指定的增强型图元文件复制到一个内存缓冲区里
GetEnhMetaFileDescription 返回对一个增强型图元文件的说明
GetEnhMetaFileHeader 取得增强型图元文件的图元文件头
GetEnhMetaFilePaletteEntries 取得增强型图元文件的全部或部分调色板
GetMetaFile 取得包含在一个磁盘文件中的图元文件的图元文件句柄
GetMetaFileBitsEx 将指定的图元文件复制到一个内存缓冲区
GetMiterLimit 取得设备场景的斜率限制(Miter)设置
GetNearestColor 根据设备的显示能力,取得与指定颜色最接近的一种纯色
GetObjectAPI 取得对指定对象进行说明的一个结构
GetObjectType 判断由指定句柄引用的GDI对象的类型
GetPath 取得对当前路径进行定义的一系列数据
GetPixel 在指定的设备场景中取得一个像素的RGB值
GetPolyFillMode 针对指定的设备场景,获得多边形填充模式
GetROP2 针对指定的设备场景,取得当前的绘图模式
GetStockObject 取得一个固有对象(Stock)
GetSysColorBrush 为任何一种标准系统颜色取得一个刷子
GetWinMetaFileBits 通过在一个缓冲区中填充用于标准图元文件的数据,将一个增强型图元文件转换成标准windows图元文件
InvertRect 通过反转每个像素的值,从而反转一个设备场景中指定的矩形
LineDDA 枚举指定线段中的所有点
LineTo 用当前画笔画一条线,从当前位置连到一个指定的点
MoveToEx 为指定的设备场景指定一个新的当前画笔位置
PaintDesk 在指定的设备场景中描绘桌面墙纸图案
PathToRegion 将当前选定的路径转换到一个区域里
Pie 画一个饼图
PlayEnhMetaFile 在指定的设备场景中画一个增强型图元文件
PlayEnhMetaFileRecord 回放单独一条增强型图元文件记录
PlayMetaFile 在指定的设备场景中回放一个图元文件
PlayMetaFileRecord 回放来自图元文件的单条记录
PolyBezier 描绘一条或多条贝塞尔(Bezier)曲线
PolyDraw 描绘一条复杂的曲线,由线段及贝塞尔曲线组成
Polygon 描绘一个多边形
Polyline 用当前画笔描绘一系列线段
PolyPolygon 用当前选定画笔描绘两个或多个多边形
PolyPolyline 用当前选定画笔描绘两个或多个多边形
Rectangle 用当前选定的画笔描绘矩形,并用当前选定的刷子填充
RoundRect 用当前选定的画笔画一个圆角矩形,并用当前选定的刷子在其中填充
SelectClipPath 将设备场景当前的路径合并到剪切区域里
SelectObject 为当前设备场景选择图形对象
SetArcDirection 设置圆弧的描绘方向
SetBkColor 为指定的设备场景设置背景颜色
SetBkMode 指定阴影刷子、虚线画笔以及字符中的空隙的填充方式
SetBrushOrgEx 为指定的设备场景设置当前选定刷子的起点
SetEnhMetaFileBits 用指定内存缓冲区内包含的数据创建一个增强型图元文件
SetMetaFileBitsEx 用包含在指定内存缓冲区内的数据结构创建一个图元文件
SetMiterLimit 设置设备场景当前的斜率限制
SetPixel 在指定的设备场景中设置一个像素的RGB值
SetPixelV 在指定的设备场景中设置一个像素的RGB值
SetPolyFillMode 设置多边形的填充模式
SetROP2 设置指定设备场景的绘图模式。与vb的DrawMode属性完全一致
SetWinMetaFileBits 将一个标准Windows图元文件转换成增强型图元文件
StrokeAndFillPath 针对指定的设备场景,关闭路径上打开的所有区域
StrokePath 用当前画笔描绘一个路径的轮廓。打开的图形不会被这个函数关闭
UnrealizeObject 将一个刷子对象选入设备场景之前,如刷子的起点准备用SetBrushOrgEx修改,则必须先调用本函数
WidenPath 根据选定画笔的宽度,重新定义当前选定的路径

9. API之设备场景函数

CombineRgn 将两个区域组合为一个新区域
CombineTransform 驱动世界转换。它相当于依顺序进行两次转换
CreateCompatibleDC 创建一个与特定设备场景一致的内存设备场景
CreateDC 为专门设备创建设备场景
CreateEllipticRgn 创建一个椭圆
CreateEllipticRgnIndirect 创建一个内切于特定矩形的椭圆区域
CreateIC 为专用设备创建一个信息场景
CreatePolygonRgn 创建一个由一系列点围成的区域
CreatePolyPolygonRgn 创建由多个多边形构成的区域。每个多边形都应是封闭的
CreateRectRgn 创建一个矩形区域
CreateRectRgnIndirect 创建一个矩形区域
CreateRoundRectRgn 创建一个圆角矩形
DeleteDC 删除专用设备场景或信息场景,释放所有相关窗口资源
DPtoLP 将点阵从设备坐标转换到专用设备场景逻辑坐标
EqualRgn 确定两个区域是否相等
ExcludeClipRect 从专用设备场景的剪裁区中去掉一个矩形区。矩形内不能进行绘图
ExcludeUpdateRgn 从专用设备场景剪裁区去掉指定窗口的刷新区域
ExtCreateRegion 根据世界转换修改区域
ExtSelectClipRgn 将指定区域组合到设备场景的当前剪裁区
FillRgn 用指定刷子填充指定区域
FrameRgn 用指定刷子围绕指定区域画一个外框
GetBoundsRect 获取指定设备场景的边界矩形
GetClipBox 获取完全包含指定设备场景剪裁区的最小矩形
GetClipRgn 获取设备场景当前剪裁区
GetDC 获取指定窗口的设备场景
GetDCEx 为指定窗口获取设备场景。相比GetDC,本函数提供了更多的选项
GetDCOrgEx 获取指定设备场景起点位置(以屏幕坐标表示)
GetDeviceCaps 根据指定设备场景代表的设备的功能返回信息
GetGraphicsMode 确定是否允许增强图形模式(世界转换)
GetMapMode 为特定设备场景调入映象模式
GetRegionData 装入描述一个区域信息的RgnData结构或缓冲区
GetRgnBox 获取完全包含指定区域的最小矩形
GetUpdateRgn 确定指定窗口的刷新区域。该区域当前无效,需要刷新
GetViewportExtEx 获取设备场景视口(viewport)范围
GetViewportOrgEx 获取设备场景视口起点
GetWindowDC 获取整个窗口(包括边框、滚动条、标题栏、菜单等)的设备场景
GetWindowExtEx 获取指定设备场景的窗口范围
GetWindowOrgEx 获取指定设备场景的逻辑窗口的起点
GetWindowRgn 获取窗口区域
GetWorldTransform 如果有世界转换,为设备场景获取当前世界转换
IntersectClipRect 为指定设备定义一个新的剪裁区
InvalidateRgn 使窗口指定区域不活动,并将它加入窗口刷新区,使之可随后被重画
InvertRgn 通过颠倒每个像素值反转设备场景指定区域
LPtoDP 将点阵从指定设备场景逻辑坐标转换为设备坐标
ModifyWorldTransform 根据指定的模式修改世界转换
OffsetClipRgn 按指定量平移设备场景剪裁区
OffsetRgn 按指定偏移量平移指定区域
OffsetViewportOrgEx 平移设备场景视口区域
OffsetWindowOrgEx 平移指定设备场景窗口起点
PaintRgn 用当前刷子背景色填充指定区域
PtInRegion 确定点是否在指定区域内
PtVisible 确定指定点是否可见(即,点是否在设备场景剪裁区内)
RectInRegion 确定矩形是否有部分在指定区域内
RectVisible 确定指定矩形是否有部分可见(是否在设备场景剪裁区内)
ReleaseDC 释放由调用GetDC或GetWindowDC函数获取的指定设备场景
RestoreDC 从设备场景堆栈恢复一个原先保存的设备场景
SaveDC 将指定设备场景状态保存到Windows设备场景堆栈
ScaleViewportExtEx 缩放设备场景视口的范围
ScaleWindowExtEx 缩放指定设备场景窗口范围
ScrollDC 在窗口(由设备场景代表)中水平和(或)垂直滚动矩形
SelectClipRgn 为指定设备场景选择新的剪裁区
SetBoundsRect 设置指定设备场景的边界矩形
SetGraphicsMode 允许或禁止增强图形模式,以提供某些支持(包括世界转换)
SetMapMode 设置指定设备场景的映射模式
SetRectRgn 设置区域为指定的矩形
SetViewportExtEx 设置设备场景视口范围
SetViewportOrgEx 设置设备场景视口起点
SetWindowExtEx 设置指定设备场景窗口范围
SetWindowOrgEx 设置指定设备场景窗口起点
SetWindowRgn 设置窗口区域
SetWorldTransform 设置世界转换
ValidateRgn 激活窗口中指定区域,把它从刷新区移走
WindowFromDC 取回与某一设备场景相关的窗口的句柄

10. API之硬件与系统函数
ActivateKeyboardLayout 激活一个新的键盘布局。键盘布局定义了按键在一种物理性键盘上的位置与含义
Beep 用于生成简单的声音
CharToOem 将一个字串从ANSI字符集转换到OEM字符集
ClipCursor 将指针限制到指定区域
ConvertDefaultLocale 将一个特殊的地方标识符转换成真实的地方ID
CreateCaret 根据指定的信息创建一个插入符(光标),并将它选定为指定窗口的默认插入符
DestroyCaret 清除(破坏)一个插入符
EnumCalendarInfo 枚举在指定“地方”环境中可用的日历信息
EnumDateFormats 列举指定的“当地”设置中可用的长、短日期格式
EnumSystemCodePages 枚举系统中已安装或支持的代码页

2005年04月29日

取得汉字的笔画的源码

作者:Chunhua Liu       来源:

// 取得汉字的笔画
/*
  gb2312_stkcnt.cpp
  Retrieve the stroke count of Chinese character.
  Support GB2312_80.
  Chunhua Liu
  Last updated: 2001-11-22/1500
*/

static int gb2312_stroke_count[] =
{
/* B0 */
10,  7, 10, 10,  8, 10,  9, 11,
17, 14, 13,  5, 13, 10, 12, 15,
10,  6, 10,  9, 13,  8, 10, 10,
  8,  8, 10,  5, 10, 14, 16,  9,
12, 12, 15, 15,  7, 10,  5,  5,
  7, 10,  2,  9,  4,  8, 12, 13,
  7, 10,  7, 21, 10,  8,  5,  9,
  6, 13,  8,  8,  9, 13, 12, 10,
13,  7, 10, 10,  8,  8,  7,  8,
  7, 19,  5,  4,  8,  5,  9, 10,
14, 14,  9, 12, 15, 10, 15, 12,
12,  8,  9,  5, 15, 10,
/* B1 */
16, 13,  9, 12,  8,  8,  8,  7,
15, 10, 13, 19,  8, 13, 12,  8,
  5, 12,  9,  4,  9, 10,  7,  8,
12, 12, 10,  8,  8,  5, 11, 11,
11,  9,  9, 18,  9, 12, 14,  4,
13, 10,  8, 14, 13, 14,  6, 10,
  9,  4,  7, 13,  6, 11, 14,  5,
13, 16, 17, 16,  9, 18,  5, 12,
  8,  9,  9,  8,  4, 16, 16, 17,
12,  9, 11, 15,  8, 19, 16,  7,
15, 11, 12, 16, 13, 10, 13,  7,
  6,  9,  5,  8,  9,  9,
/* B2 */
10,  6,  8, 11, 15,  8, 10,  8,
12,  9, 13, 10, 14,  7,  8, 11,
11, 14, 12,  8,  7, 10,  2, 10,
  7, 11,  4,  5,  7, 19, 10,  8,
17, 11, 12,  7,  3,  7, 12, 15,
  8, 11, 11, 14, 16,  8, 10,  9,
11, 11,  7,  7, 10,  4,  7, 17,
16, 16, 15, 11,  9,  8, 12,  8,
  5,  9,  7, 19, 12,  3,  9,  9,
  9, 14, 12, 14,  7,  9,  8,  8,
10, 10, 12, 11, 14, 12, 11, 13,
11,  6, 11, 19,  8, 11,
/* B3 */
  6,  9, 11,  4, 11,  7,  2, 12,
  8, 11, 10, 12,  7,  9, 12, 15,
15, 11,  7,  8,  4,  7, 15, 12,
  7, 15, 10,  6,  7,  6, 11,  7,
  7,  7, 12,  8, 15, 10,  9, 16,
  6,  7, 10, 12, 12, 15,  8,  8,
10, 10, 10,  6, 13,  9, 11,  6,
  7,  6,  6, 10,  8,  8,  4,  7,
10,  5,  9,  6,  6,  6, 11,  8,
  8, 13, 12, 14, 13, 13, 13,  4,
11, 14,  4, 10,  7,  5, 16, 12,
18, 12, 13, 12,  9, 13,
/* B4 */
10, 12, 24, 13, 13,  5, 12,  3,
  9, 13,  7, 11, 12,  7,  9, 12,
15,  7,  6,  6,  7,  8, 11, 13,
  8,  9, 13, 15, 10, 11,  7, 21,
18, 11, 11,  9, 14, 14, 13, 13,
10,  7,  6,  8, 12,  6, 15, 12,
  7,  5,  4,  5, 11, 11, 15, 17,
  9, 19, 16, 12, 14, 11, 13, 10,
13, 14, 11, 14,  7,  6,  3, 14,
15, 12, 11, 10, 13, 12,  6, 12,
14,  5,  3,  7,  4, 12, 17,  9,
  9,  5,  9, 11,  9, 11,
/* B5 */
  9, 10,  8,  4,  8, 10, 11,  9,
  5, 12,  7, 11, 11,  8, 11, 11,
  6,  9, 10,  9, 10,  2, 10, 17,
10,  7, 11,  6,  8, 15, 11, 12,
11, 15, 11,  8, 19,  6, 12, 12,
17, 14,  4, 12,  7, 14,  8, 10,
11,  7, 10, 14, 14,  8,  8,  6,
12, 11,  9,  7, 10, 12, 16, 11,
13, 13,  9,  8, 16,  9,  5,  7,
  7,  8, 11, 12, 11, 13, 13,  5,
16, 10,  2, 11,  6,  8, 10, 12,
10, 14, 15,  8, 11, 13,
/* B6 */
  2,  7,  5,  7,  8, 12, 13,  8,
  4,  6,  5,  5, 12, 15,  6,  9,
  8,  9,  7,  9, 11,  7,  4,  9,
  7, 10, 12, 10, 13,  9, 12,  9,
10, 11, 13, 12,  7, 14,  7,  9,
12,  7, 14, 12, 14,  9, 11, 12,
11,  7,  4,  5, 15,  7, 19, 12,
10,  7,  9,  9, 12, 11,  9,  6,
  6,  9, 13,  6, 13, 11,  8, 12,
11, 13, 10, 12,  9, 15,  6, 10,
10,  4,  7, 12, 11, 10, 10,  6,
  2,  6,  5,  9,  9,  2,
/* B7 */
  9,  5,  9, 12,  6,  4,  9,  8,
  9, 18,  6, 12, 18, 15,  8,  8,
17,  3, 10,  4,  7,  8,  8,  5,
  7,  7,  7,  7,  4,  8,  8,  6,
  7,  6,  6,  7,  8, 11,  8, 11,
  3,  8, 10, 10,  7,  8,  8,  8,
  9,  7, 11,  7,  8,  4,  7,  7,
12,  7, 10,  8,  6,  8, 12, 12,
  4,  9,  8, 13, 10, 12,  4,  9,
11, 10,  5, 13,  6,  8,  4,  7,
  7,  4, 15,  8, 14,  7,  8, 13,
12,  9, 11,  6,  9,  8,
/* B8 */
10, 11, 13, 11,  5,  7,  7, 11,
10, 10,  8, 11, 12,  8, 14,  9,
11, 18, 12,  9, 12,  5,  8,  4,
13,  6, 12,  4,  7,  6, 13,  8,
15, 14,  8,  7, 13,  9, 11, 12,
  3,  5,  7,  9,  9,  7, 10, 13,
  8, 11, 21,  4,  6,  9,  9,  7,
  7,  7, 12,  7, 16, 10, 10, 14,
10, 16, 13, 15, 15,  7, 10, 14,
12,  4, 11, 10,  8, 12,  9, 12,
10, 12,  9, 12, 11,  3,  6,  9,
10, 13, 10,  7,  8, 19,
/* B9 */
10, 10, 11,  3,  7,  5, 10, 11,
  8, 10,  4,  9,  3,  6,  7,  9,
  7,  6,  9,  4,  7,  8,  8,  9,
  8,  8, 11, 12, 11,  8, 14,  7,
  8,  8,  8, 13,  5, 11,  9,  7,
  8,  9, 10,  8, 12,  8,  5,  9,
14,  9, 13,  8,  8,  8, 12,  6,
  8,  9,  6, 14, 11, 23, 12, 20,
  8,  6,  3, 10, 13,  8,  6, 11,
  5,  7,  9,  6,  9,  8,  9, 10,
  8, 13,  9,  8, 12, 13, 12, 12,
10,  8,  8, 14,  6,  9,
15,  9, 10, 10,  6, 10,  9, 12,
14,  7, 12,  7, 11, 12,  8, 12,
  7, 16, 16, 10,  7, 16, 10, 11,
  6,  5,  5,  8, 10, 17, 17, 14,
11,  9,  6, 10,  5, 10,  8, 12,
10, 11, 10,  5,  8,  7,  6, 11,
13,  9,  8, 11, 14, 14, 15,  9,
15, 12, 11,  9,  9,  9, 10,  7,
15, 16,  9,  8,  9, 10,  9, 11,
  9,  7,  5,  6, 12,  9, 12,  7,
  9, 10,  6,  8,  5,  8, 13, 10,
12,  9, 15,  8, 15, 12,
/* BB */
  8,  8, 11,  7,  4,  7,  4,  7,
  9,  6, 12, 12,  8,  6,  4,  8,
13,  9,  7, 11,  7,  6,  8, 10,
  7, 12, 10, 11, 10, 12, 13, 11,
10,  9,  4,  9, 12, 11, 16, 15,
17,  9, 11, 12, 13, 10, 13,  9,
11,  6,  9, 12, 17,  9, 12,  6,
13, 10, 15,  5, 12, 11, 10, 11,
  6, 10,  5,  6,  9,  9,  9,  8,
11, 13,  9, 11, 17,  9,  6,  4,
10,  8, 12, 16,  8, 11,  5,  6,
11,  6, 13, 15, 10, 14,
/* BC */
  6,  5,  9, 16,  4,  7, 10, 11,
12,  6,  7, 12, 13, 20, 12,  3,
  9, 10,  6,  7, 13,  6,  9,  2,
10,  3, 13,  7, 16,  8,  6, 11,
  8, 11,  9, 11, 11,  4,  5,  9,
  7,  7,  7, 10,  6, 14,  9,  6,
  8, 10,  5,  9, 12, 10,  5, 10,
11, 15,  6,  9,  8, 13,  7, 10,
  7,  6, 11,  7, 13, 10,  8,  8,
  6, 12,  9, 11,  9, 14, 12,  8,
10, 13,  9, 11, 11,  9, 14, 13,
12,  9,  4, 13, 15,  6,
/* BD */
10, 10,  9,  8, 11, 12, 10,  8,
15,  9,  9, 10,  6, 19, 12, 10,
  9,  6,  6, 13,  8, 15, 12, 17,
12, 10,  6,  8,  9,  9,  9, 20,
12, 11, 11,  8, 11,  9,  7,  9,
16,  9, 13, 11, 14, 10, 10,  5,
12, 12, 11,  9, 11, 12,  6, 14,
  7,  5, 10,  8, 11, 13, 14,  9,
  9, 13,  8,  7, 17,  7,  9, 10,
  4,  9,  9,  8,  3, 12,  4,  8,
  4,  9, 18, 10, 13,  4, 13,  7,
13, 10, 13,  7, 10, 10,
/* BE */
  6,  7,  9, 14,  8, 13, 12, 16,
  8, 11, 14, 13,  8,  4, 19, 12,
11, 14, 14, 12, 16,  8, 10, 13,
11, 10,  8,  9, 12, 12,  7,  5,
  7,  9,  3,  7,  2, 10, 11, 11,
  5,  6, 13,  8, 12,  8, 17,  8,
  8, 10,  8,  8, 11,  7,  8,  9,
  9,  8, 14,  7, 11,  4,  8, 11,
15, 13, 10,  5, 11,  8, 10, 10,
12, 10, 10, 11,  8, 10, 15, 23,
  7, 11, 10, 17,  9,  6,  6,  9,
  7, 11,  9,  6,  7, 10,
/* BF */
  9, 12, 10,  9, 10, 12,  8,  5,
  9,  4, 12, 13,  8, 12,  5, 12,
11,  7,  9,  9, 11, 14, 17,  6,
  7,  4,  8,  6,  9, 10, 15,  8,
  8,  9, 12, 15, 14,  9,  7,  9,
  5, 12,  7,  8,  9, 10,  8, 11,
  9, 10,  7,  7,  8, 10,  4, 11,
  7,  3,  6, 11,  9, 10, 13,  8,
14,  7, 12,  6,  9,  9, 13, 10,
  7, 13,  8,  7, 10, 12,  6, 12,
  7, 10,  8, 11,  7,  7,  3, 11,
  8, 13, 12,  9, 13, 11,
/* C0 */
12, 12, 12,  8,  8, 10,  7,  9,
  6, 13, 12,  8,  8, 12, 14, 12,
14, 11, 10,  7, 13, 13, 11,  9,
  8, 16, 12,  5, 15, 14, 12,  9,
16, 12,  9, 13, 11, 12, 10, 11,
  8, 10, 10, 10,  7,  7,  6,  8,
  9, 13, 10, 10, 11,  5, 13, 18,
16, 15, 11, 17,  9, 16,  6,  9,
  8, 12, 13,  7,  9, 11, 11, 15,
16, 10, 10, 13, 11,  7,  7, 15,
  5, 10,  9,  6, 10,  7,  5,  7,
10,  4,  7, 12,  8,  9,
/* C1 */
12,  5, 11,  7,  8,  2, 14, 10,
  9, 12, 10,  7, 18, 13,  8, 10,
  8, 11, 11, 12, 10,  9,  8, 13,
10, 11, 13,  7,  7, 11, 12, 12,
  9, 10, 15, 11, 14,  7, 16, 14,
  5, 15,  2, 14, 17, 14, 10,  6,
12, 10,  6, 11, 12,  8, 17, 16,
  9,  7, 20, 11, 15, 10,  7,  8,
  9, 11, 13, 13, 10,  7, 11, 10,
  7, 10,  8, 11,  5,  5, 13, 11,
14, 12, 13, 10,  6, 15, 10,  9,
  4,  5, 11,  8, 11, 16,
/* C2 */
11,  8,  8,  7, 13,  9, 12, 15,
14,  8,  7,  5, 11,  7,  8, 11,
  7,  8, 12, 19, 13, 21, 13, 10,
11, 16, 12,  8,  7, 15,  7,  6,
11,  8, 10, 15, 12, 12, 10, 12,
  9, 11, 13, 11,  9, 10,  9, 13,
  7,  7, 11, 11,  7,  8,  6,  4,
  7,  7,  6, 11, 17,  8, 11, 13,
14, 14, 13, 12,  9,  9,  9,  6,
11,  7,  8,  9,  3,  9, 14,  6,
10,  6,  7,  8,  6,  9, 15, 14,
12, 13, 14, 11, 14, 14,
/* C3 */
13,  6,  9,  8,  8,  6, 10, 11,
  8, 13,  4,  5, 10,  5,  8,  9,
12, 14,  9,  3,  8,  8, 11, 14,
15, 13,  7,  9, 12, 14,  7,  9,
  9, 12,  8, 12,  3,  7,  5, 11,
13, 17, 13, 13, 11, 11,  8, 11,
15, 19, 17,  9, 11,  8,  6, 10,
  8,  8, 14, 11, 12, 12, 10, 11,
11,  7,  9, 10, 12,  9,  8, 11,
13, 17,  9, 12,  8,  7, 14,  5,
  5,  8,  5, 11, 10,  9,  8, 16,
  8, 11,  6,  8, 13, 13,
/* C4 */
14, 19, 14, 14, 16, 15, 20,  8,
  5, 10, 15, 16,  8, 13, 13,  8,
11,  6,  9,  8,  7,  7,  8,  5,
13, 14, 13, 12, 14,  4,  5, 13,
  8, 16, 10,  9,  7,  9,  6,  9,
  7,  6,  2,  5,  9,  8,  9,  7,
10, 22,  9, 10,  9,  8, 11,  8,
10,  4, 14, 10,  8, 16, 10,  8,
  5,  7,  7, 10, 13,  9, 13, 14,
  8,  6, 15, 15, 11,  8, 10, 14,
  5,  7, 10, 10, 19, 11, 15, 15,
10, 11,  9,  8, 16,  5,
/* C5 */
  8,  8,  4,  7,  9,  7, 10,  9,
  6,  7,  5,  7,  9,  3, 13,  9,
  8,  9, 17, 20, 10, 10,  8,  9,
  8, 18,  7, 11,  7, 11,  9,  8,
  8,  8, 12,  8, 11, 12, 11, 12,
  9, 19, 15, 11, 15,  9, 10,  7,
  9,  6,  8, 10, 16,  9,  7,  8,
  7,  9, 10, 12,  8,  8,  9, 11,
14, 12, 10, 10,  8,  7, 12,  9,
10,  8, 11, 15, 12, 13, 12, 13,
16, 16,  8, 13, 11, 13,  8,  9,
21,  7,  8, 15, 12,  9,
/* C6 */
11, 12, 10,  5,  4, 12, 15,  7,
20, 15, 11,  4, 12, 15, 14, 16,
11, 14, 16,  9, 13,  8,  9, 13,
  6,  8,  8, 11,  5,  8, 10,  7,
  9,  8,  8, 11, 11, 10, 14,  8,
11, 10,  5, 12,  4, 10, 12, 11,
13, 10,  6, 10, 12, 10, 14, 19,
18, 12, 12, 10, 11,  8,  2, 10,
14,  9,  7,  8, 12,  8,  8, 11,
11, 10,  6, 14,  8,  6, 11, 10,
  6,  3,  6,  7,  9,  9, 16,  4,
  6,  7,  7,  8,  5, 11,
/* C7 */
  9,  9,  9,  6,  8, 10,  3,  6,
13,  5, 12, 11, 16, 10, 10,  9,
15, 13,  8, 15, 11, 12,  4, 14,
  8,  7, 12,  7, 14, 14, 12,  7,
16, 14, 14, 10, 10, 17,  6,  8,
  5, 16, 15, 12, 10,  9, 10,  4,
  8,  5,  8,  9,  9,  9,  9, 10,
12, 13,  7, 15, 12, 13,  7,  8,
  9,  9, 10, 10, 11, 16, 12, 12,
11,  8, 10,  6, 12,  7,  9,  5,
  7, 11,  7,  5,  9,  8, 12,  4,
11,  6, 11,  8,  7, 11,
/* C8 */
  8, 11, 17, 15,  5, 11, 23,  6,
16, 10,  6, 11, 10,  4,  8,  4,
10,  8, 16,  7, 13, 14, 12, 11,
12, 13, 12, 16,  5,  9, 22, 20,
20, 20,  5,  9,  7,  9, 12, 10,
  4,  4,  2,  7,  7,  6,  4,  3,
  7,  6,  5,  4,  4,  6,  9, 13,
  9, 16, 14, 13, 10,  9,  4, 12,
  9,  6,  9, 20, 16, 17,  6, 10,
  8,  6,  2, 15,  8,  6, 15, 13,
12,  7, 10,  8, 10, 15,  9, 11,
13, 17, 13, 14,  3,  8,
/* C9 */
  6, 12, 10, 13,  8, 12, 12,  6,
12, 13,  6, 10, 12, 14, 10,  9,
  6,  8,  7,  7, 13, 11, 13, 12,
10,  9,  8,  7,  3,  7, 14,  8,
  5,  8, 16, 17, 16, 12,  6, 10,
15, 14,  6, 11, 12, 10,  3,  8,
14, 11, 10, 12, 10,  6,  3, 14,
  4, 10,  7,  8, 11, 11, 11,  6,
  8, 11, 13, 10, 13, 10,  7,  6,
10,  5,  8,  7,  7, 11, 10,  8,
  9,  7,  8, 11,  9,  8, 13, 11,
  7,  5, 12,  9,  4, 11,
/* CA */
  9, 11, 12,  9,  5,  6,  5,  9,
  9, 12,  8,  3,  8,  2,  5,  9,
  7,  4,  9,  9,  8,  7,  5,  5,
  8,  9,  8,  8,  6,  5,  3,  5,
  9,  8,  9, 14, 10,  8,  9, 13,
16,  9,  5,  8, 12,  8,  4,  5,
  9,  9,  8,  8,  6,  4,  9,  6,
  7, 11, 11,  8, 14, 11, 15,  8,
11, 10,  7, 13,  8, 12, 11, 12,
  4, 12, 11, 15, 16, 12, 17, 13,
13, 12, 13, 12,  5,  8,  9,  7,
  6,  9, 14, 11, 13, 14,
/* CB */
10,  8,  9, 14, 10,  5,  5, 10,
  9, 17,  4, 11, 10,  4, 13, 12,
  7, 17,  9, 12,  9, 11, 10,  9,
12, 15, 15,  9,  7,  5,  5,  6,
13,  6, 13,  5,  7,  6,  8,  3,
  8, 10,  8, 10,  9,  7,  6,  9,
12, 15, 16, 14,  7, 12,  9, 10,
10, 12, 14, 13, 13, 11,  7,  8,
14, 13, 14,  9, 11, 11, 10, 21,
13,  6, 17, 12, 14, 10,  6, 10,
10, 13, 11, 10, 14, 11, 10, 12,
  8, 13,  5,  5,  6, 12,
/* CC */
16,  9, 17, 15,  9,  8,  8,  5,
10, 11,  4,  8,  7,  7, 13,  8,
15, 13,  7, 17, 13, 15, 14, 10,
  8, 12, 10, 14, 11,  5,  9,  6,
13, 13, 11, 12, 15, 10, 16, 10,
15, 11, 15, 10, 11, 10, 13, 10,
11, 10,  9, 11, 10,  5, 10, 10,
18, 13, 10, 13, 11, 10, 15, 12,
12, 15, 16, 12,  7, 12, 17, 11,
10,  9,  8,  4, 11, 13,  5, 11,
  9, 14, 12,  9,  7,  8, 11, 13,
  9, 10,  8,  4,  7,  9,
/* CD */
  5,  6, 11,  9,  9,  9, 12, 10,
10, 13, 17,  6, 11,  7, 12, 11,
10, 12,  9, 12, 11,  7,  5, 10,
  5,  7,  9,  8, 10, 10, 10, 11,
  3,  6,  8, 12,  6, 11, 13, 13,
13, 14,  9,  7,  4, 17,  8,  6,
11, 10,  7,  6,  8, 12,  7,  8,
12,  9,  9, 12,  9,  9,  4, 10,
  9,  5, 15,  9, 12,  8, 10,  3,
11,  7, 13, 10, 11, 12, 11,  8,
11,  3, 12,  7,  4,  3,  8,  6,
  8,  8, 11,  7,  6,  9,
/* CE */
20, 13,  6,  4,  7, 10,  7, 11,
11,  4, 14, 11,  7, 11,  8,  6,
  6,  7,  7,  5, 14,  8,  9,  9,
12, 17,  7, 12, 11, 11, 15,  3,
14, 12, 10,  4,  9,  7,  7, 14,
10,  6, 13, 10,  8,  9, 13, 10,
12,  7, 14,  8, 12,  7,  7,  7,
  9,  4,  6,  9,  9,  4,  7, 11,
  7,  7,  4,  8,  4, 10,  4, 14,
  6,  9,  7,  5, 13, 11,  8,  4,
  5, 10,  9,  8, 14,  8,  6, 11,
  8, 12, 15,  6, 13, 10,
/* CF */
12, 10,  7, 11, 15,  3, 11, 14,
11, 13,  6, 12, 17, 11, 10,  3,
13, 12, 11,  9,  7, 12,  6,  8,
15,  9,  7, 17, 14, 13,  9,  8,
  9,  3, 12, 10,  6, 11, 13,  6,
  5, 14,  6,  9,  8, 11, 11,  7,
  9,  8, 13,  9,  9,  8, 13,  7,
13, 11, 12,  9, 10,  8,  8,  9,
11, 22,  9, 15, 17, 12,  3, 12,
10,  8, 13,  9,  8,  9,  9, 15,
13,  6, 11, 11, 12, 15,  9, 10,
18, 12, 10, 10, 11, 10,
/* D0 */
  3,  7, 10,  7, 11, 10, 10, 13,
  8, 13, 15, 15,  6,  9, 13,  6,
11,  8, 11,  5, 11,  9, 19, 16,
  8,  8, 12, 10, 16,  7, 12,  8,
  7, 13,  7,  4,  9, 11,  9, 13,
12, 12,  6,  6,  9,  7,  6,  6,
16,  8,  7,  8,  8,  5,  4, 10,
  6,  7, 12, 14,  6,  9, 10,  6,
13, 12,  7, 10, 10, 14,  6, 14,
11, 14,  9, 10,  6, 13, 11,  9,
  6,  7, 10,  9, 12, 12, 11, 11,
  7, 12,  9, 11, 11,  5,
/* D1 */
  9, 19, 10,  9, 13, 16,  8,  5,
11,  6,  9, 14, 12,  6,  8,  6,
  6,  6, 10,  6,  5,  5,  9,  6,
  6,  8,  9, 10,  7,  3,  7,  4,
10, 11, 13, 11, 12,  9,  6,  6,
11,  9, 11, 10, 11, 10,  7,  9,
12,  8,  7,  7, 15, 11,  8,  8,
  8, 11, 11,  9, 14, 10, 12, 16,
  6,  9, 12, 10,  9, 12, 10, 11,
10,  9,  5, 10, 10,  7,  6,  8,
  8,  6,  9,  6, 10,  6, 11,  9,
10, 14, 16, 13,  7, 14,
/* D2 */
13,  6, 13, 11, 12,  9,  9, 10,
  9,  9, 20, 12, 15,  8,  6, 11,
  7,  3,  6, 11,  5,  5,  6, 12,
  8, 11,  1, 12,  7, 12, 11,  8,
  6,  6, 13,  6, 12, 11,  5, 10,
14,  7,  8,  9, 18, 12,  9, 10,
  3,  1,  7,  4,  4,  7,  8,  7,
  6,  3,  7, 17, 11, 13,  9,  6,
13, 13, 15,  4,  3, 10, 13,  8,
  5, 10,  7,  6, 17, 11,  8,  9,
  9,  6, 10,  9,  6,  8,  7, 11,
11, 11,  7,  4,  4, 11,
/* D3 */
  5,  8, 15, 11, 18,  7, 14, 10,
11, 11,  9, 14,  7, 17,  9, 15,
13, 12,  9,  9,  8,  7, 17, 10,
11, 13, 14, 13,  8,  8, 10,  5,
11,  9,  5,  9,  6, 11,  7,  4,
  5,  7, 10,  7,  8, 12,  7,  6,
  4,  5,  7, 12,  9,  2,  5,  6,
11,  3,  8, 13, 13, 13, 14,  7,
  9, 12,  8, 12, 12, 11, 11,  4,
10,  8,  3,  6,  9,  6,  9,  6,
  5, 11,  6,  8,  6, 12, 12, 10,
12, 13, 11,  9,  8, 13,
/* D4 */
10, 12, 12, 10, 15,  5, 10, 11,
10,  4,  9, 10, 10, 12, 14,  7,
  7, 10, 13, 13, 12,  7,  8, 14,
  9,  9,  4,  6, 12, 11,  9,  8,
12,  4, 10, 10, 10,  4,  9,  4,
  9,  4,  7, 15, 11, 10, 13,  5,
  5, 10,  6, 10,  9,  7, 10, 10,
  6,  6,  9, 19, 12, 16, 10, 10,
12, 14, 17, 12, 19,  8,  6, 16,
  9, 20, 16, 10,  7,  7, 17,  8,
  8,  6,  8, 10,  9, 15, 15, 12,
16,  4, 12, 12,  5,  5,
/* D5 */
11,  8,  9,  9, 14,  8,  5,  9,
  7, 14, 10,  6, 10, 10, 14, 18,
  9, 13, 11,  8, 10,  8, 14, 11,
10, 22,  9,  5,  9, 10, 12, 11,
15, 11, 14, 14,  7, 12, 10,  7,
  3,  7,  8,  5,  8, 16, 13,  8,
  9,  7,  8,  9, 13, 13,  6, 14,
  5, 14,  7, 10, 12, 16,  8, 13,
14,  7, 10,  9, 13, 10, 13, 10,
16,  6,  7,  8,  8, 10,  7, 15,
10, 15,  6, 13,  9, 11,  8,  9,
  6,  8, 16,  9,  5,  9,
/* D6 */
  9, 10,  8,  7,  6,  8,  4,  7,
14,  8,  8, 10,  5,  3,  8, 11,
  8, 12, 12,  6, 10,  8,  7,  9,
  4, 11,  5,  6,  7,  7, 10, 11,
  6, 10, 13,  8,  9,  8, 12, 10,
13,  8,  8, 11, 12,  8, 11,  4,
  9,  8,  9, 10,  8,  9,  8,  9,
  6,  6,  6,  8,  6,  9,  7, 12,
  9,  7,  8,  8, 10,  8,  9, 17,
10, 10, 12,  6, 11, 10,  8, 10,
  6, 10, 12,  8, 17, 15,  5, 11,
  9,  7, 11,  8, 12, 12,
/* D7 */
  7,  8,  9,  8,  7,  4,  9,  4,
  9,  8, 15, 14, 15, 10,  6, 12,
  6, 15,  6,  7, 12, 13,  9, 14,
  7, 11, 10, 10, 10,  8,  8, 10,
12,  8, 10, 11, 11,  7,  9,  9,
  9, 10,  9, 12, 11,  7, 12,  5,
  9, 13,  3,  6, 11,  6, 18, 12,
15,  8, 11,  9,  7,  7,  7,  9,
12, 10,  7,  8, 11,  9,  7,  7,
  8, 10, 20, 16, 15, 12, 13, 12,
15,  9,  5,  7,  9, 11,  7,  7,
10,  0,  0,  0,  0,  0,
/* D8 */
  3,  3,  3,  4,  4,  4,  5,  6,
  6, 10, 10, 16,  1,  8,  1,  2,
  3,  4,  4,  5,  5,  6,  9, 11,
14, 14, 19,  1,  8, 14,  2,  6,
  4,  7,  7, 11, 14,  4,  6, 10,
11, 12, 14, 15, 16,  2,  5,  8,
11, 11, 15,  8,  7,  2,  4,  6,
  7,  8,  8,  8,  9, 10, 10, 10,
13, 13, 14, 14, 15, 16,  2,  8,
  2,  4,  4,  4,  5,  5,  5,  5,
  6,  6,  6,  6,  6,  6,  6,  6,
  6,  7,  7,  7,  7,  7,
/* D9 */
  7,  7,  7,  7,  8,  8,  8,  8,
  8,  8,  8,  8,  8,  8,  8,  8,
  9,  9,  9,  9,  9,  9,  9,  9,
  9, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 11, 11,
11, 11, 11, 11, 11, 12, 12, 12,
13, 14, 14, 14, 14, 14, 14, 15,
15,  5,  6,  7,  7,  9, 17,  6,
  8,  4, 12, 16, 17, 18, 21,  2,
  9,  9, 11,  6,  6,  7,  2,  8,
10, 10, 11, 12, 12, 12, 13, 16,
19, 19,  2,  6,  8,  8,
/* DA */
10,  2, 10, 10,  2,  5,  5,  5,
  6,  6,  6,  7,  7,  7,  7,  7,
  7,  8,  8,  8,  8,  8,  8,  8,
  8,  8,  8,  8,  9,  9,  9,  9,
10, 10, 10, 10, 10, 10, 10, 11,
11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 12, 12, 12, 12, 12, 13,
13, 14, 14, 14, 15, 15, 19,  2,
  8,  2,  5,  5,  6,  6,  7,  7,
  7,  7,  8,  9,  9, 10, 10, 10,
11, 11, 11, 16,  5,  5,  5,  5,
  6,  6,  7,  7,  7,  7,
/* DB */
  7,  7,  8,  8,  8,  8,  8,  8,
  8,  9,  9,  9,  9,  9, 10, 10,
11, 11, 13, 13, 13, 14, 14, 16,
19, 17,  5,  7,  5,  7,  7,  8,
10, 10, 11, 15,  9, 17, 20,  2,
  2,  6, 10,  2,  5, 10, 12,  7,
  9,  9, 14, 16, 16, 17,  6,  6,
  6,  6,  6,  6,  6,  7,  7,  7,
  8,  8,  8,  8,  8,  8,  8,  8,
  8,  8,  9,  9,  9,  9,  9,  9,
  9,  9,  9, 10, 10, 10, 10, 10,
10, 11, 11, 11, 11, 11,
/* DC */
11, 11, 11, 11, 11, 12, 12, 12,
12, 13, 13, 14, 14, 14, 15, 20,
21, 22,  3,  5,  5,  6,  6,  6,
  6,  6,  6,  6,  7,  7,  7,  7,
  7,  7,  7,  7,  7,  7,  7,  7,
  7,  7,  7,  7,  7,  7,  7,  7,
  7,  7,  7,  8,  8,  8,  8,  8,
  8,  8,  8,  8,  8,  8,  8,  8,
  8,  8,  8,  8,  8,  8,  9,  9,
  9,  9,  9,  9,  9,  9,  9,  9,
  9,  9,  9,  9,  9,  9,  9,  9,
  9,  9,  9,  9,  9,  9,
/* DD */
  9,  9,  9,  9,  9,  9,  9, 10,
10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 11, 11, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 11, 11, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 13,
13, 13, 13, 13, 13, 13, 13, 13,
13, 13, 13, 13, 13, 13, 13, 14,
14, 14, 14, 14, 14, 14,
/* DE */
14, 14, 14, 14, 15, 15, 15, 15,
15, 15, 15, 15, 15, 16, 16, 16,
16, 16, 16, 16, 16, 16, 17, 17,
17, 17, 17, 18, 19, 19, 19, 20,
20, 22,  3,  9,  6,  7,  9,  9,
10, 10, 11,  3,  5,  5, 12,  3,
  6,  7,  8,  8,  8,  8,  9,  9,
  9, 10, 10, 10, 11, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 11,
12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 13, 13, 13, 13, 13, 13,
13, 13, 14, 14, 14, 14,
/* DF */
14, 15, 15, 15, 15, 16, 16, 16,
17, 17, 19, 23, 25,  3,  7,  8,
12,  5,  5,  5,  5,  5,  5,  6,
  6,  6,  7,  7,  7,  7,  7,  7,
  7,  7,  7,  7,  7,  8,  8,  8,
  8,  8,  8,  8,  8,  8,  8,  8,
  9,  9,  9,  9,  9,  9,  9,  9,
  9,  9,  9,  9,  9,  9,  9,  9,
  9,  9,  9,  9,  9,  9,  9,  9,
10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 11, 11, 11, 11, 11,
11, 11, 11, 11, 11, 11,
/* E0 */
11, 11, 11, 11, 11, 11, 11, 11,
12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12,
12, 13, 13, 13, 13, 13, 13, 13,
13, 13, 13, 13, 13, 13, 13, 13,
13, 13, 13, 13, 13, 13, 14, 14,
14, 14, 14, 14, 14, 14, 14, 15,
15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 16, 16, 16, 16, 16, 16,
17, 17, 19, 25,  3,  6,  6,  7,
  7,  8,  9, 10, 11, 11, 16,  7,
  8,  8,  8, 10, 11, 11,
/* E1 */
11, 12, 14, 14, 15, 15,  6,  6,
  7,  7,  7,  7,  7,  7,  7,  7,
  7,  8,  8,  8,  8,  8,  8,  8,
  8,  8,  8,  9,  9,  9,  9, 10,
10, 11, 11, 11, 11, 11, 11, 11,
12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 13, 13, 13, 14, 15, 15,
17, 17, 19,  3,  7,  8,  9,  9,
  9, 10, 11, 11, 12, 13, 15, 16,
24,  3,  3,  5,  6,  6,  6,  7,
  7,  8,  8,  8,  9,  9,  9,  9,
10, 10, 10, 10, 10, 10,
/* E2 */
10, 11, 11, 11, 11, 11, 11, 11,
12, 12, 12, 12, 12, 12, 14, 14,
15, 15, 16, 17, 20,  6, 14, 12,
14,  3,  3,  6,  7,  7,  7,  7,
  7,  8,  9, 10, 10, 11, 12, 12,
13, 13, 14, 15, 15, 25,  5,  7,
  7,  8,  9,  9, 11, 11, 11, 11,
12, 13, 14, 15, 16, 16, 17,  3,
  5,  6,  6,  7,  7,  7,  7,  7,
  7,  7,  7,  7,  7,  7,  8,  8,
  8,  8,  8,  8,  8,  8,  8,  8,
  8,  9,  9,  9,  9,  9,
/* E3 */
  9,  9, 10, 10, 10, 10, 10, 10,
10, 10, 11, 11, 11, 11, 11, 11,
11, 11, 12, 12, 12, 12, 12, 12,
12, 13, 13, 14, 15, 15, 15, 16,
16, 18,  8, 17,  4,  6,  7,  7,
  7,  7,  9,  9, 10, 10, 10, 11,
11, 11, 11, 11, 11, 12, 12, 13,
13, 13, 14,  3,  4,  8,  3,  6,
  6,  6,  7,  7,  7,  7,  7,  7,
  7,  7,  7,  7,  7,  7,  8,  8,
  8,  8,  8,  8,  8,  8,  8,  8,
  8,  8,  8,  8,  8,  8,
/* E4 */
  9,  9,  9,  9,  9,  9,  9,  9,
  9,  9,  9,  9,  9,  9,  9,  9,
  9,  9, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 11, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12,
13, 13, 13, 13, 13, 13, 13, 13,
13, 13, 13, 13, 13, 13, 13, 13,
13, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 15,
15, 15, 15, 15, 15, 16,
/* E5 */
16, 16, 16, 16, 16, 17, 17, 17,
17, 17, 19, 19, 19, 20, 20, 21,
24,  3,  5,  8,  8,  9, 10, 12,
13, 14, 14, 15, 16, 16, 17, 17,
  3,  7,  7,  8,  8,  8,  8,  8,
  8,  8,  9,  9, 10, 10, 10, 10,
10, 10, 11, 11, 11, 11, 12, 12,
12, 12, 13, 13, 13, 13, 15, 15,
16, 16, 17, 17, 18,  3, 11,  9,
12,  5,  9, 10, 10, 12, 14, 15,
21,  8,  8,  9, 11, 12, 22,  3,
  6,  6,  7,  7,  7,  7,
/* E6 */
  7,  7,  7,  7,  7,  7,  8,  8,
  8,  8,  9,  9,  9,  9,  9,  9,
  9, 10, 10, 10, 10, 10, 10, 10,
10, 11, 11, 11, 11, 11, 11, 11,
12, 12, 12, 12, 13, 13, 13, 13,
13, 13, 14, 14, 14, 14, 14, 14,
14, 15, 16, 16, 17, 17, 20,  5,
  9,  7,  8, 12,  3,  3,  8,  8,
  8,  8,  8,  8,  8,  8,  9,  9,
  9, 10, 11, 11, 11, 11, 12, 12,
13, 13, 13, 14, 14, 15, 19, 20,
  3,  6,  6,  6,  6,  6,
/* E7 */
  7,  7,  7,  8,  8,  8,  8,  8,
  8,  8,  9,  9,  9, 10, 10, 10,
11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 13, 13, 13,
13, 13, 13, 13, 13, 14, 14, 14,
14, 14, 15, 15, 15, 16, 16, 16,
16, 19,  3, 15,  3,  8, 10,  6,
  6,  8,  8,  8,  9,  9,  9,  9,
  9,  9,  9,  9, 10, 10, 10, 10,
10, 10, 10, 10, 10, 11, 12, 12,
12, 12, 12, 12, 12, 12,
/* E8 */
12, 12, 13, 13, 13, 13, 13, 14,
14, 15, 15, 15, 15, 15, 15, 15,
16, 17, 17, 17, 18, 20, 20, 13,
13, 14,  7,  7,  7,  7,  7,  8,
  8,  8,  8,  8,  8,  8,  8,  8,
  8,  8,  8,  8,  9,  9,  9,  9,
  9,  9,  9,  9,  9,  9,  9,  9,
  9,  9,  9,  9,  9,  9,  9, 10,
10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 11, 11, 11, 11, 11, 11,
11, 12, 12, 12, 12, 12,
/* E9 */
12, 12, 12, 12, 12, 12, 12, 13,
13, 13, 13, 13, 13, 13, 13, 13,
13, 13, 13, 13, 13, 13, 13, 13,
13, 13, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 15,
15, 15, 15, 15, 15, 15, 15, 16,
16, 16, 16, 16, 16, 16, 16, 16,
16, 16, 17, 17, 17, 17, 18, 13,
14,  8,  9,  9,  9, 11, 11, 11,
12, 12, 14, 16,  7,  8,  9,  9,
  9,  9,  9,  9,  9,  9,  9, 10,
10, 10, 10, 11, 12, 12,
/* EA */
12, 12, 13, 15, 16, 10,  5,  8,
11, 12, 12, 13, 13, 13, 14, 14,
  8,  9, 12, 16, 16, 17,  4,  6,
  6,  7,  8,  8,  8,  8,  8,  8,
  8,  9,  9,  9,  9,  9,  9, 10,
10, 10, 10, 10, 10, 11, 11, 12,
13, 13, 14, 14, 16, 18, 18, 20,
21,  9,  9,  9,  9, 10, 10, 10,
10, 11, 11, 11, 12, 12, 14,  9,
10, 11, 12, 13, 14, 15, 15,  9,
13,  6,  8,  9, 11, 11, 12, 12,
12, 13, 14, 10, 11, 12,
/* EB */
14, 17, 10, 10, 12, 12, 12, 13,
15, 16, 16, 22,  5,  6,  7,  7,
  9, 10, 10, 11, 13,  4, 11, 13,
12, 13, 15,  9, 15,  6,  7,  7,
  7,  8,  8,  8,  8,  8,  8,  8,
  8,  9,  9,  9,  9,  9,  9,  9,
  9,  9,  9,  9,  9,  9, 10, 10,
10, 10, 10, 10, 10, 10, 10, 11,
11, 11, 11, 11, 11, 12, 12, 12,
12, 12, 12, 12, 13, 13, 13, 13,
13, 13, 13, 13, 14, 14, 14, 15,
15, 16, 17, 17, 17, 17,
/* EC */
17, 16,  7, 11, 12, 13, 13, 16,
  9,  9, 12, 13, 16, 16,  4, 13,
13, 17, 12, 15, 16,  8, 10, 10,
10, 11, 11, 13, 14,  7,  8,  8,
  8,  9,  9,  9,  9,  9, 10, 10,
11, 11, 11, 12, 12, 13, 13, 13,
13, 13, 13, 13, 13, 14, 15, 15,
15, 15, 16, 16, 16, 18, 21, 30,
  4, 11, 13, 16,  8,  8,  9, 11,
12,  4,  7,  8,  8,  9,  9,  9,
  9,  9,  9,  9, 10, 10, 12, 12,
13, 14, 16, 21,  7,  7,
/* ED */
  9, 10, 10, 10, 10, 10, 10, 11,
13, 13, 14, 16, 16, 17, 17, 24,
  4,  6,  8,  9, 12,  7,  8,  8,
  9,  9,  9,  9,  9,  9,  9, 10,
10, 10, 10, 10, 10, 10, 10, 10,
10, 11, 11, 11, 11, 11, 11, 11,
11, 12, 13, 13, 13, 13, 13, 14,
14, 14, 14, 14, 15, 15, 15, 16,
16, 17, 17, 18, 19, 18, 21, 11,
12, 17, 19,  8,  9,  9,  9,  9,
  9, 10, 10, 10, 11, 11, 11, 11,
12, 12, 12, 12, 13, 13,
/* EE */
13, 13, 14, 14, 14, 14, 15, 15,
16, 16, 16, 17, 18,  7,  8,  9,
  9,  9, 10, 12, 13, 17,  9, 10,
10, 12, 13, 14, 14, 16, 17, 17,
10, 16, 23,  5,  6,  6,  7,  7,
  7,  8,  8,  8,  8,  8,  8,  9,
  9,  9,  9,  9,  9,  9,  9,  9,
  9, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 11, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 11, 11, 11,
/* EF */
11, 11, 11, 11, 11, 11, 11, 11,
12, 12, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 12, 12,
12, 13, 13, 13, 13, 13, 13, 13,
13, 13, 13, 13, 13, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14,
14, 15, 15, 15, 15, 15, 15, 15,
15, 16, 16, 16, 16, 16, 16, 16,
16, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 18, 18, 18, 19, 20,
14,  9, 12, 13,  9,  9, 10, 10,
11, 12, 12, 12, 13, 13,
/* F0 */
15, 15, 16, 17, 18, 22,  9, 11,
12, 13, 17, 10, 11,  7,  7,  8,
  9,  9, 10, 10, 10, 10, 10, 10,
11, 11, 11, 11, 11, 12, 12, 12,
12, 12, 12, 13, 13, 13, 13, 13,
14, 14, 14, 14, 14, 15, 15, 16,
16, 16, 17, 17, 17, 17, 18, 18,
22,  5,  7,  7,  8,  8,  9,  9,
10, 10, 10, 10, 10, 10, 10, 10,
11, 11, 12, 12, 12, 12, 12, 12,
13, 13, 13, 13, 13, 13, 13, 14,
14, 14, 14, 14, 14, 14,
/* F1 */
15, 15, 15, 15, 16, 16, 16, 16,
16, 16, 16, 16, 17, 18, 18, 18,
18, 21, 23, 11, 12,  8,  8,  9,
  9, 10, 11, 13, 13, 14, 14, 14,
15,  5,  8,  9,  9,  9,  9, 10,
11, 11, 11, 11, 12, 12, 12, 12,
13, 13, 13, 13, 13, 13, 14, 14,
14, 14, 14, 15, 15, 16, 17, 19,
24,  5,  9, 11, 12,  9,  6,  9,
10, 12, 12, 13, 14, 15, 15, 16,
16, 22, 12,  8, 11, 11, 11, 12,
15, 16, 12,  9, 10, 10,
/* F2 */
12, 12, 12, 12, 13, 15, 15, 16,
16, 16, 18, 20, 21,  6, 10,  7,
  8,  9,  9,  9,  9, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 11,
11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 12, 12, 12, 12, 12, 12,
12, 12, 12, 12, 12, 12, 13, 13,
13, 13, 13, 13, 13, 13, 14, 14,
14, 14, 14, 14, 14, 14, 14, 14,
14, 14, 14, 14, 15, 15, 15, 15,
15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 16, 16, 16, 16,
/* F3 */
16, 16, 16, 16, 16, 16, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17,
17, 18, 18, 18, 18, 19, 19, 19,
19, 20, 21, 24, 26,  6, 14, 17,
17, 10,  8,  9,  9,  9, 10, 10,
10, 10, 10, 11, 11, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 12,
12, 12, 12, 12, 12, 13, 13, 13,
13, 13, 13, 14, 14, 14, 14, 14,
14, 14, 14, 14, 14, 14, 14, 15,
15, 15, 15, 16, 16, 16, 16, 16,
17, 17, 17, 17, 17, 17,
/* F4 */
18, 18, 18, 19, 19, 19,  8,  9,
11, 12, 10, 10,  9,  9,  9, 10,
10, 10, 10, 11, 11, 11, 11, 12,
13, 13, 14, 15, 17, 18, 19, 10,
10, 11, 13, 13, 19, 11, 11, 13,
15, 15, 16,  9, 10, 10, 11, 11,
12, 12, 13, 14, 14, 14, 15, 15,
15, 15, 15, 16, 18,  6, 15,  9,
11, 12, 14, 14, 15, 15, 16, 17,
  6, 12, 14, 14, 17, 25, 11, 19,
  9, 12, 13, 13, 23, 11, 15, 10,
11,  9, 10, 10, 10, 12,
/* F5 */
12, 12, 13, 13, 13, 14, 14, 14,
14, 14, 15, 15, 16, 16, 16, 17,
17, 18, 19, 19, 19, 20, 20, 21,
  7, 16, 10, 13, 14, 18, 18, 10,
10, 11, 11, 11, 12, 12, 12, 12,
12, 12, 12, 12, 13, 13, 13, 13,
13, 13, 13, 14, 14, 15, 15, 15,
15, 15, 15, 15, 15, 16, 16, 16,
16, 16, 16, 16, 16, 17, 17, 17,
19, 19, 19, 19, 19, 20, 21, 22,
22, 23, 24,  7, 12, 13, 13, 17,
17, 11, 11, 12, 12, 13,
/* F6 */
13, 14, 15, 13, 18, 12, 11, 12,
12, 14, 14, 16, 16, 16, 19, 19,
20, 22, 10, 13, 13, 13, 14, 14,
15, 15, 17,  8, 12, 20,  8, 10,
10, 13, 14, 18, 18, 14, 14, 15,
16, 17, 18, 18, 21, 24, 12, 12,
13, 13, 13, 13, 13, 13, 13, 13,
14, 14, 14, 14, 14, 14, 14, 14,
15, 15, 15, 15, 15, 15, 15, 15,
15, 15, 16, 16, 16, 16, 16, 16,
16, 16, 16, 16, 16, 16, 17, 17,
17, 17, 17, 17, 17, 17,
/* F7 */
18, 18, 18, 18, 18, 19, 19, 19,
19, 19, 19, 20, 20, 20, 21, 14,
14, 15, 15, 16, 18, 18, 18, 19,
19, 13, 13, 14, 14, 14, 15, 15,
17, 17, 18, 18, 19, 19, 22, 14,
14, 15, 16, 16, 17, 19, 12, 15,
18, 22, 22, 10, 13, 14, 15, 15,
16, 16, 16, 18, 19, 20, 23, 25,
14, 15, 17, 13, 16, 16, 17, 19,
19, 21, 23, 17, 17, 17, 18, 18,
19, 20, 20, 20, 20, 21, 17, 18,
20, 23, 23, 16, 17, 23,
/* F8 */
};

int GetGB2312StrokeCount(unsigned char c1, unsigned char c2)
{
    unsigned offset;

    if ( c1 < 0xB0 || c1 > 0xF7 || c2 < 0xA1 || c2 > 0xFE )
    {
        // not a valid gb2312 Chinese character
        return -1;
    }
    offset = ((unsigned)c1-0xB0) * (0xFE-0xA0) + ((unsigned)c2-0xA1);
    return gb2312_stroke_count[offset];
}

#include <stdio.h>
#include <string.h>

void __fastcall TMainForm::Button1Click(TObject *Sender)
{
    char *buf = "测试一二三四五六七八九十啊齄";
    Memo1->Lines->Add(buf);
    for ( unsigned i=0; i<strlen(buf); i+=2 )
    {
        String strTemp;
        strTemp.sprintf("%-2d", GetGB2312StrokeCount(buf[i], buf[i+1]));
        Memo1->Lines->Add(strTemp);
    }
}
//—————————————————————————

unsigned char bybits[16]={0×55,0×0,0xaa,0×0,0×55,0×0,0xaa,0×0,
                          0×55,0×0,0xaa,0×0,0×55,0×0,0xaa,0×0};
HANDLE hBitmap,hBrush;

//—————————————————————————
void __fastcall TForm1::Button1Click(TObject *Sender)
{
    /使屏幕暗下来
    HANDLE hdc5;
    hBitmap=CreateBitmap(8,8,1,1,&bybits[0]);
    hBrush=CreatePatternBrush(hBitmap);
    hdc5=GetDC(0);
    SelectObject(hdc5,hBrush);
    PatBlt(hdc5,0,0,Screen->Width,Screen->Height,0xa000c9);
    DeleteObject(hBrush);
    DeleteObject(hBitmap);
    ReleaseDC(0,hdc5);
}
//—————————————————————————
void __fastcall TForm1::Button2Click(TObject *Sender)
{
    //复原屏幕
    InvalidateRect(0,0,1);
}

typedef enum
{
    CFM_Superscript,
// 上标
    CFM_Subscript,   // 下标
    CFM_Normal      
// 普通文本
}TCharacterFormat;

void MySetCharFormat(TRichEdit *RichEdit, TCharacterFormat CharacterFormat)
{

    TCharFormat Format;
    Format.cbSize = sizeof(Format);
    Format.dwMask = CFM_OFFSET;
    // Character offset, in twips, from the baseline.
    // If the value of this member is positive,
    // the character is a superscript;
    // if it is negative, the character is a subscript.

    switch(CharacterFormat)
    {
        case CFM_Superscript:
            Format.yOffset = 60;
            break;
        case CFM_Subscript:
            Format.yOffset = -60;
            break;
        case CFM_Normal:
            Format.yOffset = 0;
            break;
        default:
            break;
    }
    // The EM_SETCHARFORMAT messa

ge sets character formatting in a rich edit control.
    // SCF_SELECTION: Applies the formatting to the current selection
    RichEdit->Perform(EM_SETCHARFORMAT, SCF_SELECTION, Longint(&Format));
}

//—————————————————————————
// 先选中Richedit中的部分文本,然后点击此按钮,选中文本将变成上标

void __fastcall TForm1::Button1Click(TObject *Sender)
{
    // 上标
    MySetCharFormat(RichEdit1, CFM_Superscript);
}
//—————————————————————————
// 先选中Richedit中的部分文本,然后点击此按钮,选中文本将变成下标

void __fastcall TForm1::Button2Click(TObject *Sender)
{
    // 下标
    MySetCharFormat(RichEdit1, CFM_Subscript);
}

首先  我们了解一下Windows的消息机制。Windows是一个消息驱动式系统,Windows消息提供应用程序与应用程序之间,应用程序与Windows系统之间进行通信的手段。 举个例子,打开记事本程序,该程序有一个文件菜单。 那么,在运行该程序的时候,如果用户单击文件菜单里的新建命令, 这个动作将被Windows所捕捉,Windows经过分析得知这个动作应该由我们打开的记事本程序所来处理,然后Windows就发送个消息 譬如我们编程的时候有时用到的 WM_COMMAND的消息给记事本,然后记事本就把这个消息处理掉。 这个过程就是消息处理。接下来,我们把SendMessage的完整形式讲一下
 SendMessage
            Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

别名:   SendMessageA
说明:   调用一个窗口的窗口函数,将一条消息发给那个窗口。除非消息处理完毕,否则该函数不会返回SendMessage所包含4个参数:

1.        hwnd    32位的窗口句柄窗口可以是任何类型的屏幕对象,因为Win32能够维护大多数可视对象的句柄

2.        wMsg    用于区别其他消息的常量值,这些常量可以是Windows单元中预定义的常量,也可以是自定义的常量

3.        wParam    通常是一个与消息有关的常量值,也可能是窗口或控件的句柄

4.        lParam      通常是一个指向内存中数据的指针。由于WParmlParamPointer都是32位的,因此,它们之间可以相互转换

wMsg函数 

l          WM_CREATE                       创建一个窗口

l          WM_DESTROY                      当一个窗口被破坏时发送

l          WM_MOVE                         移动一个窗口

l          WM_SIZE                         改变一个窗口的大小

l          WM_ACTIVATE                     一个窗口被激活或失去激活状态

l          WM_SETFOCUS                     一个窗口获得焦点

l          WM_KILLFOCUS                    一个窗口失去焦点

l          WM_ENABLE                       一个窗口改变成Enable状态

l          WM_SETREDRAW                    设置窗口是否能重画

l          WM_SETTEXT                      应用程序发送此消息来设置一个窗口的文本

l          WM_GETTEXT                      应用程序发送此消息来复制对应窗口的文本到缓冲区

l          WM_GETTEXTLENGTH                得到与一个窗口有关的文本的长度(不包含空字符)

l          WM_PAINT                        要求一个窗口重画自己

l          WM_CLOSE                        当一个窗口或应用程序要关闭时发送一个信号

l          WM_QUERYENDSESSION              用户选择结束对话框或程序自己调用ExitWindows函数

l          WM_QUIT                         用来结束程序运行
WM_QUERYOPEN                    
用户窗口恢复以前的大小位置时,把此消息发送给某个图标

l          WM_ERASEBKGND                   当窗口背景必须被擦除时(例在窗口改变大小时)

l          WM_SYSCOLORCHANGE               当系统颜色改变时,发送此消息给所有顶级窗口

l          WM_QUERYENDSESSION         消息后,此消息发送给应用程序,通知它对话是否结束

l          WM_SHOWWINDOW              当隐藏或显示窗口是发送此消息给这个窗口

l          WM_ACTIVATEAPP             发此消息给应用程序哪个窗口是激活的,哪个是非激活的

l          WM_FONTCHANGE              当系统的字体资源库变化时发送此消息给所有顶级窗口

l          WM_TIMECHANGE              当系统的时间变化时发送此消息给所有顶级窗口

l          WM_CANCELMODE              发送此消息来取消某种正在进行的摸态(操作)

l          WM_SETCURSOR               如果鼠标引起光标在某个窗口中移动

l          WM_ENDSESSION              当系统进程发出且鼠标输入没有被捕获时,就发消息给某个窗口

l          WM_MOUSEACTIVATE           当光标在某个非激活的窗口中而用户正按着鼠标的某个键发送
                           
此消息给当前窗口

l          WM_CHILDACTIVATE           送此消息给MDI子窗口当用户点击此窗口的标题栏,或当窗口
                           
被激活,移动,改变大小

l          WM_QUEUESYNC               此消息由基于计算机的训练程序发送,通过
                           WH_JOURNALPALYBACKhook程序分离出用户输入消息

l          WM_GETMINMAXINFO           此消息发送给窗口当它将要改变大小或位置

l          WM_PAINTICON               发送给最小化窗口当它图标将要被重画

l          WM_ICONERASEBKGND          此消息发送给某个最小化窗口,仅当它在画图标前它的背景必须
                          
被重画

l          WM_NEXTDLGCTL              发送此消息给一个对话框程序去更改焦点位置

l          WM_SPOOLERSTATUS           每当打印管理列队增加或减少一条作业时发出此消息

l          WM_DRAWITEM                buttoncomboboxlistboxmenu的可视外观改变时发送

l          WM_MEASUREITEM             button, combo box, list box, listview control, or menu
                           item
被创建时

l          WM_VKEYTOITEM              此消息有一个LBS_WANTKEYBOARDINPUT风格的发出给它的所有者
                          
来响应WM_KEYDOWN消息

l          WM_CHARTOITEM              此消息由一个LBS_WANTKEYBOARDINPUT风格的列表框发送给他的
                          
所有者来响应WM_CHAR消息

l          WM_SETFONT                 当绘制文本时程序发送此消息得到控件要用的颜色

l          WM_GETFONT                 应用程序发送此消息得到当前控件绘制文本的字体

l          WM_SETHOTKEY               应用程序发送此消息让一个窗口与一个热键相关连

l          WM_GETHOTKEY               应用程序发送此消息来判断热键与某个窗口是否有关联

l          WM_QUERYDRAGICON           此消息发送给最小化窗口,当此窗口将要被拖放而它的类中没有
                        
  定义图标,应用程序能返回一个图标或光标的句柄,当用户拖放
                          
图标时系统显示这个图标或光标

l          WM_COMPAREITEM             发送此消息来判定comboboxlistbox新增加的项的相对位置

l          WM_COMPACTING              显示内存已经很少了

l          WM_WINDOWPOSCHANGING       发送此消息给那个窗口的大小和位置将要被改变时,来调用
                          
setwindowpos函数或其它窗口管理函数

l          WM_WINDOWPOSCHANGED        发送此消息给那个窗口的大小和位置已经被改变时,来调用
                          
setwindowpos函数或其它窗口管理函数

l          WM_POWER                   当系统将要进入暂停状态时发送此消息

l          WM_COPYDATA                当一个应用程序传递数据给另一个应用程序时发送此消息

l          WM_CANCELJOURNA            当某个用户取消程序日志激活状态,提交此消息给程序

l          WM_NOTIFY               当某个控件的某个事件已经发生或这个控件需要得到一些信息时,发送此
                       
消息给它的父窗口

l          WM_INPUTLANGCHANGEREQUEST      当用户选择某种输入语言,或输入语言的热键改变

l          WM_INPUTLANGCHANGE      当平台现场已经被改变后发送此消息给受影响的最顶级窗口

l          WM_TCARD                当程序已经初始化windows帮助例程时发送此消息给应用程序

l          WM_HELP                 此消息显示用户按下了F1,如果某个菜单是激活的,就发送此消息个此窗口
                       
关联的菜单,否则就发送给有焦点的窗口,如果当前都没有焦点,就把此消
                       
息发送给当前激活的窗口

l          WM_USERCHANGED          当用户已经登入或退出后发送此消息给所有的窗口,当用户登入或退出时系
                       
统更新用户的具体设置信息,在用户更新设置时系统马上发送此消息

l          WM_NOTIFYFORMAT         公用控件,自定义控件和他们的父窗口通过此消息来判断控件是使用ANSI
                       
UNICODE结构

l          WM_CONTEXTMENU          当用户某个窗口中点击了一下右键就发送此消息给这个窗口

l          WM_STYLECHANGING        当调用SETWINDOWLONG函数将要改变一个或多个 窗口的风格时发送此消息给
                       
那个窗口

l          WM_STYLECHANGED         当调用SETWINDOWLONG函数一个或多个 窗口的风格后发送此消息给那个窗口

l          WM_DISPLAYCHANGE        当显示器的分辨率改变后发送此消息给所有的窗口

l          WM_GETICON              此消息发送给某个窗口来返回与某个窗口有关连的大图标或小图标的句柄

l          WM_SETICON              程序发送此消息让一个新的大图标或小图标与某个窗口关联

l          WM_NCCREATE             当某个窗口第一次被创建时,此消息在WM_CREATE消息发送前发送

l          WM_NCDESTROY            此消息通知某个窗口,非客户区正在销毁

l          WM_NCCALCSIZE           当某个窗口的客户区域必须被核算时发送此消息

l          WM_NCHITTEST            移动鼠标,按住或释放鼠标时发生

l          WM_NCPAINT              程序发送此消息给某个窗口当它(窗口)的框架必须被绘制时

l          WM_NCACTIVATE           此消息发送给某个窗口仅当它的非客户区需要被改变来显示是激活还是非激
                       
活状态

l          WM_GETDLGCODE           发送此消息给某个与对话框程序关联的控件,widdows控制方位键和TAB键使
                       
输入进入此控件通过应

l          WM_NCMOUSEMOVE          当光标在一个窗口的非客户区内移动时发送此消息给这个窗口非客户区为:
                       
窗体的标题栏及窗 的边框体

l          WM_NCLBUTTONDOWN        当光标在一个窗口的非客户区同时按下鼠标左键时提交此消息

l          WM_NCLBUTTONUP          当用户释放鼠标左键同时光标某个窗口在非客户区时发送此消息

l          WM_NCLBUTTONDBLCLK      当用户双击鼠标左键同时光标某个窗口在非客户区时发送此消息

l          WM_NCRBUTTONDOWN        当用户按下鼠标右键同时光标又在窗口的非客户区时发送此消息

l          WM_NCRBUTTONUP          当用户释放鼠标右键同时光标又在窗口的非客户区时发送此消息

l          WM_NCRBUTTONDBLCLK      当用户双击鼠标右键同时光标某个窗口在非客户区时发送此消息

l          WM_NCMBUTTONDOWN        当用户按下鼠标中键同时光标又在窗口的非客户区时发送此消息

l          WM_NCMBUTTONUP          当用户释放鼠标中键同时光标又在窗口的非客户区时发送此消息

l          WM_NCMBUTTONDBLCLK      当用户双击鼠标中键同时光标又在窗口的非客户区时发送此消息

l          WM_KEYFIRST             WM_KEYDOWN  按下一个键

l          WM_KEYUP                释放一个键

l          WM_CHAR                 按下某键,并已发出WM_KEYDOWN WM_KEYUP消息

l          WM_DEADCHAR             当用translatemessage函数翻译WM_KEYUP消息时发送此消息给拥有焦点的
                       
窗口

l          WM_SYSKEYDOWN           当用户按住ALT键同时按下其它键时提交此消息给拥有焦点的窗口

l          WM_SYSKEYUP             当用户释放一个键同时ALT 键还按着时提交此消息给拥有焦点的窗口

l          WM_SYSCHAR              WM_SYSKEYDOWN消息被TRANSLATEMESSAGE函数翻译后提交此消息给拥有焦
                       
点的窗口

l          WM_SYSDEADCHAR          WM_SYSKEYDOWN消息被TRANSLATEMESSAGE函数翻译后发送此消息给拥有焦
                       
点的窗口

l          WM_INITDIALOG           在一个对话框程序被显示前发送此消息给它,通常用此消息初始化控件和执
                       
行其它任务

l          WM_COMMAND              当用户选择一条菜单命令项或当某个控件发送一条消息给它的父窗口,一个
                       
快捷键被翻译

l          WM_SYSCOMMAND           当用户选择窗口菜单的一条命令或当用户选择最大化或最小化时那个窗口会
                       
收到此消息

l          WM_TIMER                发生了定时器事件

l          WM_HSCROLL              当一个窗口标准水平滚动条产生一个滚动事件时发送此消息给那个窗口,也
                       
发送给拥有它的控件

l          WM_VSCROLL              当一个窗口标准垂直滚动条产生一个滚动事件时发送此消息给那个窗口也,
                        
发送给拥有它的控件

l          WM_INITMENU             当一个菜单将要被激活时发送此消息,它发生在用户菜单条中的某项或按下
                       
某个菜单键,它允许程序在显示前更改菜单

l          WM_INITMENUPOPUP        当一个下拉菜单或子菜单将要被激活时发送此消息,它允许程序在它显示前
                       
更改菜单,而不要改变全部

l          WM_MENUSELECT           当用户选择一条菜单项时发送此消息给菜单的所有者(一般是窗口)

l          WM_MENUCHAR             当菜单已被激活用户按下了某个键(不同于加速键),发送此消息给菜单的
                       
所有者

l          WM_ENTERIDLE            当一个模态对话框或菜单进入空载状态时发送此消息给它的所有者,一个模
                       
态对话框或菜单进入空载状态就是在处理完一条或几条先前的消息后没有消
                       
息它的列队中等待

l          WM_CTLCOLORMSGBOX       windows绘制消息框前发送此消息给消息框的所有者窗口,通过响应这条
                       
消息,所有者窗口可以通过使用给定的相关显示设备的句柄来设置消息框的
                       
文本和背景颜色

l          WM_CTLCOLOREDIT         当一个编辑型控件将要被绘制时发送此消息给它的父窗口 通过响应这条消
                       
息,所有者窗口可以通过使用给定的相关显示设备的句柄来设置编辑框的文
                       
本和背景颜色

l          WM_CTLCOLORLISTBOX      当一个列表框控件将要被绘制前发送此消息给它的父窗口 通过响应这条消
                       
息,所有者窗口可以通过使用给定的相关显示设备的句柄来设置列表框的文
                       
本和背景颜色

l          WM_CTLCOLORBTN          当一个按钮控件将要被绘制时发送此消息给它的父窗口 通过响应这条消息,
                        
所有者窗口可以通过使用给定的相关显示设备的句柄来设置按纽的文本和背
                       
景颜色

l          WM_CTLCOLORDLG          当一个对话框控件将要被绘制前发送此消息给它的父窗口 通过响应这条消
                       
息,所有者窗口可以通过使用给定的相关显示设备的句柄来设置对话框的文
                       
本背景颜色

l          WM_CTLCOLORSCROLLBAR    当一个滚动条控件将要被绘制时发送此消息给它的父窗口 通过响应这条消
                       
息,所有者窗口可以通过使用给定的相关显示设备的句柄来设置滚动条的背
                       
景颜色

l          WM_CTLCOLORSTATIC       当一个静态控件将要被绘制时发送此消息给它的父窗口 通过响应这条消息,
                       
所有者窗口可以 通过使用给定的相关显示设备的句柄来设置静态控件的文
                       
本和背景颜色

l          WM_MOUSEFIRST WM_MOUSEMOVE          移动鼠标

l          WM_LBUTTONDOWN          按下鼠标左键

l          WM_LBUTTONUP            释放鼠标左键

l          WM_LBUTTONDBLCLK        双击鼠标左键

l          WM_RBUTTONDOWN          按下鼠标右键

l          WM_RBUTTONUP            释放鼠标右键

l          WM_RBUTTONDBLCLK        双击鼠标右键

l          WM_MBUTTONDOWN          按下鼠标中键

l          WM_MBUTTONUP            释放鼠标中键

l          WM_MBUTTONDBLCLK        双击鼠标中键

l          WM_MOUSEWHEEL           当鼠标轮子转动时发送此消息个当前有焦点的控件

l          WM_PARENTNOTIFY         MDI子窗口被创建或被销毁,或用户按了一下鼠标键而光标在子窗口上时
                       
发送此消息给它的父窗口

l          WM_ENTERMENULOOP        发送此消息通知应用程序的主窗口that已经进入了菜单循环模式

l          WM_EXITMENULOOP         发送此消息通知应用程序的主窗口that已退出了菜单循环模式

l          WM_SIZING               当用户正在调整窗口大小时发送此消息给窗口 通过此消息应用程序可以监
                       
视窗口大小和位置也可以修改他们

l          WM_CAPTURECHANGED       发送此消息 给窗口当它失去捕获的鼠标时

l          WM_MOVING               当用户在移动窗口时发送此消息,通过此消息应用程序可以监视窗口大小和
                       
位置也可以修改他们

l          WM_POWERBROADCAST       此消息发送给应用程序来通知它有关电源管理事件

l          WM_DEVICECHANGE         当设备的硬件配置改变时发送此消息给应用程序或设备驱动程序

l          WM_MDIDESTROY           应用程序发送此消息给多文档的客户窗口来关闭一个MDI 子窗口

l          WM_MDIACTIVATE          应用程序发送此消息给多文档的客户窗口通知客户窗口激活另一个MDI子窗
                        
口,当客户窗口收到此消息后,它发出WM_MDIACTIVE消息给MDI子窗口(未
                       
激活)激活它

l          WM_MDIRESTORE           程序 发送此消息给MDI客户窗口让子窗口从最大最小化恢复到原来大小

l          WM_MDINEXT              程序 发送此消息给MDI客户窗口激活下一个或前一个窗口

l          WM_MDIMAXIMIZE          程序发送此消息给MDI客户窗口来最大化一个MDI子窗口

l          WM_MDITILE              程序 发送此消息给MDI客户窗口以平铺方式重新排列所有MDI子窗口

l          WM_MDICASCADE           程序 发送此消息给MDI客户窗口以层叠方式重新排列所有MDI子窗口

l          WM_MDIICONARRANGE       程序 发送此消息给MDI客户窗口重新排列所有最小化的MDI子窗口

l          WM_MDIGETACTIVE         程序 发送此消息给MDI客户窗口来找到激活的子窗口的句柄

l          WM_MDISETMENU           程序 发送此消息给MDI客户窗口用MDI菜单代替子窗口的菜单

l          WM_CUT                  程序发送此消息给一个编辑框或combobox来删除当前选择的文本

l          WM_COPY                 程序发送此消息给一个编辑框或combobox来复制当前选择的文本到剪贴板

l          WM_PASTE                程序发送此消息给editcontrolcombobox从剪贴板中得到数据

l          WM_CLEAR                程序发送此消息给editcontrolcombobox清除当前选择的内容

l          WM_UNDO                程序发送此消息给editcontrolcombobox撤消最后一次操作

l          WM_DESTROYCLIPBOARD    当调用ENPTYCLIPBOARD函数时 发送此消息给剪贴板的所有者

l          WM_DRAWCLIPBOARD       当剪贴板的内容变化时发送此消息给剪贴板观察链的第一个窗口 它允许用剪
                      
贴板观察窗口来显示剪贴板的新内容

l          WM_PAINTCLIPBOARD      当剪贴板包含CF_OWNERDIPLAY格式的数据并且剪贴板观察窗口的客户区需要
                      
重画

l          WM_SIZECLIPBOARD       当剪贴板包含CF_OWNERDIPLAY格式的数据并且剪贴板观察窗口的客户区域的
                      
大小已经改变是此消息通过剪贴板观察窗口发送给剪贴板的所有者

l          WM_ASKCBFORMATNAME     通过剪贴板观察窗口发送此消息给剪贴板的所有者来请求一个
                       CF_OWNERDISPLAY
格式的剪贴板的名字

l          WM_CHANGECBCHAIN      当一个窗口从剪贴板观察链中移去时发送此消息给剪贴板观察链的第一个窗口

l          WM_HSCROLLCLIPBOARD    此消息通过一个剪贴板观察窗口发送给剪贴板的所有者  它发生在当剪贴板
                      
包含CFOWNERDISPALY格式的数据并且有个事件在剪贴板观察窗的水平滚动条
                      
上 所有者应滚动剪贴板图象并更新滚动条的值

l          WM_QUERYNEWPALETTE     此消息发送给将要收到焦点的窗口,此消息能使窗口在收到焦点时同时有机会
                      
实现他的逻辑调色板

l          WM_PALETTEISCHANGING   当一个应用程序正要实现它的逻辑调色板时发此消息通知所有的应用程序

l          WM_PALETTECHANGED      此消息在一个拥有焦点的窗口实现它的逻辑调色板后发送此消息给所有顶级
                      
并重叠的窗口,以此来改变系统调色板

l          WM_HOTKEY              当用户按下由REGISTERHOTKEY函数注册的热键时提交此消息

l          WM_PRINT               应用程序发送此消息仅当WINDOWS或其它应用程序发出一个请求要求绘制一个
                      
应用程序的一部分

 

l          WM_DDE_INITIATE = WM_DDE_FIRST + 0    一个DDE客户程序提交此消息开始一个与服务器程序
                                     
的会话来响应那个指定的程序和主题名

l          WM_DDE_TERMINATE = WM_DDE_FIRST + 1   一个DDE应用程序(无论是客户还是服务器)提交此
                                     
消息来终止一个会话

l          WM_DDE_ADVISE = WM_DDE_FIRST + 2      一个DDE客户程序提交此消息给一个DDE服务程序来
                                     
请求服务器每当数据项改变时更新它

l          WM_DDE_UNADVISE = WM_DDE_FIRST + 3    一个DDE客户程序通过此消息通知一个DDE服务程序
                                     
不更新指定的项或一个特殊的剪贴板格式的项

l          WM_DDE_ACK = WM_DDE_FIRST + 4         此消息通知一个DDE(动态数据交换)程序已收到并正
                                     
处理WM_DDE_POKE,WM_DDE_EXECUTE,WM_DDE_DATA,
                                      WM_DDE_ADVISE, WM_DDE_UNADVISE, or WM_DDE_INITIAT
消息

l          WM_DDE_DATA = WM_DDE_FIRST + 5        一个DDE服务程序提交此消息给DDE客户程序来传递个一数
                                     
据项给客户或通知客户的一条可用数据项

l          WM_DDE_REQUEST = WM_DDE_FIRST + 6     一个DDE客户程序提交此消息给一个DDE服务程序来请求一
                                     
个数据项的值

l          WM_DDE_POKE = WM_DDE_FIRST + 7        一个DDE客户程序提交此消息给一个DDE服务程序,客户使
                                     
用此消息来请求服务器接收一个未经同意的数据项服务器
                                     
通过答复WM_DDE_ACK消息提示是否它接收这个数据项

Windows消息大全1
版权所有 codesky.net 2003-2005
发表时间:2003-10-31    关键字:未知

消息,就是指Windows发出的一个通知,告诉应用程序某个事情发生了。例如,单击鼠标、改变窗口尺寸、按下键盘上的一个键都会使Windows发送一个消息给应用程序。消息本身是作为一个记录传递给应用程序的,这个记录中包含了消息的类型以及其他信息。例如,对于单击鼠标所产生的消息来说,这个记录中包含了单击鼠标时的坐标。这个记录类型叫做TMsg,

它在Windows单元中是这样声明的:
type
TMsg = packed record
hwnd: HWND; / /窗口句柄
message: UINT; / /消息常量标识符
wParam: WPARAM ; // 32位消息的特定附加信息
lParam: LPARAM ; // 32位消息的特定附加信息
time: DWORD; / /消息创建时的时间
pt: TPoint; / /消息创建时的鼠标位置
end;

消息中有什么?
是否觉得一个消息记录中的信息像希腊语一样?如果是这样,那么看一看下面的解释:
hwnd 32位的窗口句柄。窗口可以是任何类型的屏幕对象,因为Win32能够维护大多数可视对象的句柄(窗口、对话框、按钮、编辑框等)。
message 用于区别其他消息的常量值,这些常量可以是Windows单元中预定义的常量,也可以是自定义的常量。
wParam 通常是一个与消息有关的常量值,也可能是窗口或控件的句柄。
lParam 通常是一个指向内存中数据的指针。由于W P a r a m、l P a r a m和P o i n t e r都是3 2位的,
因此,它们之间可以相互转换。

WM_NULL = $0000;
WM_CREATE = $0001;
应用程序创建一个窗口
WM_DESTROY = $0002;
一个窗口被销毁
WM_MOVE = $0003;
移动一个窗口
WM_SIZE = $0005;
改变一个窗口的大小
WM_ACTIVATE = $0006;
一个窗口被激活或失去激活状态;
WM_SETFOCUS = $0007;
获得焦点后
WM_KILLFOCUS = $0008;
失去焦点
WM_ENABLE = $000A;
改变enable状态
WM_SETREDRAW = $000B;
设置窗口是否能重画
WM_SETTEXT = $000C;
应用程序发送此消息来设置一个窗口的文本
WM_GETTEXT = $000D;
应用程序发送此消息来复制对应窗口的文本到缓冲区
WM_GETTEXTLENGTH = $000E;
得到与一个窗口有关的文本的长度(不包含空字符)
WM_PAINT = $000F;
要求一个窗口重画自己
WM_CLOSE = $0010;
当一个窗口或应用程序要关闭时发送一个信号
WM_QUERYENDSESSION = $0011;
当用户选择结束对话框或程序自己调用ExitWindows函数
WM_QUIT = $0012;
用来结束程序运行或当程序调用postquitmessage函数
WM_QUERYOPEN = $0013;
当用户窗口恢复以前的大小位置时,把此消息发送给某个图标
WM_ERASEBKGND = $0014;
当窗口背景必须被擦除时(例在窗口改变大小时)
WM_SYSCOLORCHANGE = $0015;
当系统颜色改变时,发送此消息给所有顶级窗口
WM_ENDSESSION = $0016;
当系统进程发出WM_QUERYENDSESSION消息后,此消息发送给应用程序,
通知它对话是否结束
WM_SYSTEMERROR = $0017;
WM_SHOWWINDOW = $0018;
当隐藏或显示窗口是发送此消息给这个窗口
WM_ACTIVATEAPP = $001C;
发此消息给应用程序哪个窗口是激活的,哪个是非激活的;
WM_FONTCHANGE = $001D;
当系统的字体资源库变化时发送此消息给所有顶级窗口
WM_TIMECHANGE = $001E;
当系统的时间变化时发送此消息给所有顶级窗口
WM_CANCELMODE = $001F;
发送此消息来取消某种正在进行的摸态(操作)
WM_SETCURSOR = $0020;
如果鼠标引起光标在某个窗口中移动且鼠标输入没有被捕获时,就发消息给某个窗口
WM_MOUSEACTIVATE = $0021;
当光标在某个非激活的窗口中而用户正按着鼠标的某个键发送此消息给当前窗口
WM_CHILDACTIVATE = $0022;
发送此消息给MDI子窗口当用户点击此窗口的标题栏,或当窗口被激活,移动,改变大小
WM_QUEUESYNC = $0023;
此消息由基于计算机的训练程序发送,通过WH_JOURNALPALYBACK的hook程序
分离出用户输入消息
WM_GETMINMAXINFO = $0024;
此消息发送给窗口当它将要改变大小或位置;
WM_PAINTICON = $0026;
发送给最小化窗口当它图标将要被重画
WM_ICONERASEBKGND = $0027;
此消息发送给某个最小化窗口,仅当它在画图标前它的背景必须被重画
WM_NEXTDLGCTL = $0028;
发送此消息给一个对话框程序去更改焦点位置
WM_SPOOLERSTATUS = $002A;
每当打印管理列队增加或减少一条作业时发出此消息
WM_DRAWITEM = $002B;
当button,combobox,listbox,menu的可视外观改变时发送
此消息给这些空件的所有者
WM_MEASUREITEM = $002C;
当button, combo box, list box, list view control, or menu item 被创建时
发送此消息给控件的所有者
WM_DELETEITEM = $002D;
当the list box 或 combo box 被销毁 或 当 某些项被删除通过LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT 消息
WM_VKEYTOITEM = $002E;
此消息有一个LBS_WANTKEYBOARDINPUT风格的发出给它的所有者来响应WM_KEYDOWN消息
WM_CHARTOITEM = $002F;
此消息由一个LBS_WANTKEYBOARDINPUT风格的列表框发送给他的所有者来响应WM_CHAR消息
WM_SETFONT = $0030;
当绘制文本时程序发送此消息得到控件要用的颜色
WM_GETFONT = $0031;
应用程序发送此消息得到当前控件绘制文本的字体
WM_SETHOTKEY = $0032;
应用程序发送此消息让一个窗口与一个热键相关连
WM_GETHOTKEY = $0033;
应用程序发送此消息来判断热键与某个窗口是否有关联
WM_QUERYDRAGICON = $0037;
此消息发送给最小化窗口,当此窗口将要被拖放而它的类中没有定义图标,应用程序能返回一个图标或光标的句柄,当用户拖放图标时系统显示这个图标或光标
WM_COMPAREITEM = $0039;
发送此消息来判定combobox或listbox新增加的项的相对位置
WM_GETOBJECT = $003D;
WM_COMPACTING = $0041;
显示内存已经很少了
WM_WINDOWPOSCHANGING = $0046;
发送此消息给那个窗口的大小和位置将要被改变时,来调用setwindowpos函数或其它窗口管理函数
WM_WINDOWPOSCHANGED = $0047;
发送此消息给那个窗口的大小和位置已经被改变时,来调用setwindowpos函数或其它窗口管理函数
WM_POWER = $0048;(适用于16位的windows)
当系统将要进入暂停状态时发送此消息
WM_COPYDATA = $004A;
当一个应用程序传递数据给另一个应用程序时发送此消息
WM_CANCELJOURNAL = $004B;
当某个用户取消程序日志激活状态,提交此消息给程序
WM_NOTIFY = $004E;
当某个控件的某个事件已经发生或这个控件需要得到一些信息时,发送此消息给它的父窗口
WM_INPUTLANGCHANGEREQUEST = $0050;
当用户选择某种输入语言,或输入语言的热键改变
WM_INPUTLANGCHANGE = $0051;
当平台现场已经被改变后发送此消息给受影响的最顶级窗口
WM_TCARD = $0052;
当程序已经初始化windows帮助例程时发送此消息给应用程序
WM_HELP = $0053;
此消息显示用户按下了F1,如果某个菜单是激活的,就发送此消息个此窗口关联的菜单,否则就
发送给有焦点的窗口,如果当前都没有焦点,就把此消息发送给当前激活的窗口
WM_USERCHANGED = $0054;
当用户已经登入或退出后发送此消息给所有的窗口,当用户登入或退出时系统更新用户的具体
设置信息,在用户更新设置时系统马上发送此消息;
WM_NOTIFYFORMAT = $0055;
公用控件,自定义控件和他们的父窗口通过此消息来判断控件是使用ANSI还是UNICODE结构
在WM_NOTIFY消息,使用此控件能使某个控件与它的父控件之间进行相互通信
WM_CONTEXTMENU = $007B;
当用户某个窗口中点击了一下右键就发送此消息给这个窗口
WM_STYLECHANGING = $007C;
当调用SETWINDOWLONG函数将要改变一个或多个 窗口的风格时发送此消息给那个窗口
WM_STYLECHANGED = $007D;
当调用SETWINDOWLONG函数一个或多个 窗口的风格后发送此消息给那个窗口
WM_DISPLAYCHANGE = $007E;
当显示器的分辨率改变后发送此消息给所有的窗口
WM_GETICON = $007F;
此消息发送给某个窗口来返回与某个窗口有关连的大图标或小图标的句柄;
WM_SETICON = $0080;
程序发送此消息让一个新的大图标或小图标与某个窗口关联;
WM_NCCREATE = $0081;
当某个窗口第一次被创建时,此消息在WM_CREATE消息发送前发送;
WM_NCDESTROY = $0082;
此消息通知某个窗口,非客户区正在销毁
WM_NCCALCSIZE = $0083;
当某个窗口的客户区域必须被核算时发送此消息
WM_NCHITTEST = $0084;//移动鼠标,按住或释放鼠标时发生
WM_NCPAINT = $0085;
程序发送此消息给某个窗口当它(窗口)的框架必须被绘制时;
WM_NCACTIVATE = $0086;
此消息发送给某个窗口 仅当它的非客户区需要被改变来显示是激活还是非激活状态;
WM_GETDLGCODE = $0087;
发送此消息给某个与对话框程序关联的控件,widdows控制方位键和TAB键使输入进入此控件
通过响应WM_GETDLGCODE消息,应用程序可以把他当成一个特殊的输入控件并能处理它
WM_NCMOUSEMOVE = $00A0;
当光标在一个窗口的非客户区内移动时发送此消息给这个窗口 //非客户区为:窗体的标题栏及窗
的边框体
WM_NCLBUTTONDOWN = $00A1;
当光标在一个窗口的非客户区同时按下鼠标左键时提交此消息
WM_NCLBUTTONUP = $00A2;
当用户释放鼠标左键同时光标某个窗口在非客户区十发送此消息;
WM_NCLBUTTONDBLCLK = $00A3;
当用户双击鼠标左键同时光标某个窗口在非客户区十发送此消息
WM_NCRBUTTONDOWN = $00A4;
当用户按下鼠标右键同时光标又在窗口的非客户区时发送此消息
WM_NCRBUTTONUP = $00A5;
当用户释放鼠标右键同时光标又在窗口的非客户区时发送此消息
WM_NCRBUTTONDBLCLK = $00A6;
当用户双击鼠标右键同时光标某个窗口在非客户区十发送此消息
WM_NCMBUTTONDOWN = $00A7;
当用户按下鼠标中键同时光标又在窗口的非客户区时发送此消息
WM_NCMBUTTONUP = $00A8;
当用户释放鼠标中键同时光标又在窗口的非客户区时发送此消息
WM_NCMBUTTONDBLCLK = $00A9;
当用户双击鼠标中键同时光标又在窗口的非客户区时发送此消息
WM_KEYFIRST = $0100;
WM_KEYDOWN = $0100;
//按下一个键
WM_KEYUP = $0101;
//释放一个键
WM_CHAR = $0102;
//按下某键,并已发出WM_KEYDOWN, WM_KEYUP消息
WM_DEADCHAR = $0103;
当用translatemessage函数翻译WM_KEYUP消息时发送此消息给拥有焦点的窗口
WM_SYSKEYDOWN = $0104;
当用户按住ALT键同时按下其它键时提交此消息给拥有焦点的窗口;
WM_SYSKEYUP = $0105;
当用户释放一个键同时ALT 键还按着时提交此消息给拥有焦点的窗口
WM_SYSCHAR = $0106;
当WM_SYSKEYDOWN消息被TRANSLATEMESSAGE函数翻译后提交此消息给拥有焦点的窗口
WM_SYSDEADCHAR = $0107;
当WM_SYSKEYDOWN消息被TRANSLATEMESSAGE函数翻译后发送此消息给拥有焦点的窗口
WM_KEYLAST = $0108;
WM_INITDIALOG = $0110;
在一个对话框程序被显示前发送此消息给它,通常用此消息初始化控件和执行其它任务
WM_COMMAND = $0111;
当用户选择一条菜单命令项或当某个控件发送一条消息给它的父窗口,一个快捷键被翻译
WM_SYSCOMMAND = $0112;
当用户选择窗口菜单的一条命令或当用户选择最大化或最小化时那个窗口会收到此消息
WM_TIMER = $0113; //发生了定时器事件
WM_HSCROLL = $0114;
当一个窗口标准水平滚动条产生一个滚动事件时发送此消息给那个窗口,也发送给拥有它的控件
WM_VSCROLL = $0115;
当一个窗口标准垂直滚动条产生一个滚动事件时发送此消息给那个窗口也,发送给拥有它的控件 WM_INITMENU = $0116;
当一个菜单将要被激活时发送此消息,它发生在用户菜单条中的某项或按下某个菜单键,它允许程序在显示前更改菜单
WM_INITMENUPOPUP = $0117;
当一个下拉菜单或子菜单将要被激活时发送此消息,它允许程序在它显示前更改菜单,而不要改变全部
WM_MENUSELECT = $011F;
当用户选择一条菜单项时发送此消息给菜单的所有者(一般是窗口)
WM_MENUCHAR = $0120;
当菜单已被激活用户按下了某个键(不同于加速键),发送此消息给菜单的所有者;
WM_ENTERIDLE = $0121;
当一个模态对话框或菜单进入空载状态时发送此消息给它的所有者,一个模态对话框或菜单进入空载状态就是在处理完一条或几条先前的消息后没有消息它的列队中等待
WM_MENURBUTTONUP = $0122;
WM_MENUDRAG = $0123;
WM_MENUGETOBJECT = $0124;
WM_UNINITMENUPOPUP = $0125;
WM_MENUCOMMAND = $0126;
WM_CHANGEUISTATE = $0127;
WM_UPDATEUISTATE = $0128;
WM_QUERYUISTATE = $0129;
WM_CTLCOLORMSGBOX = $0132;
在windows绘制消息框前发送此消息给消息框的所有者窗口,通过响应这条消息,所有者窗口可以通过使用给定的相关显示设备的句柄来设置消息框的文本和背景颜色

Window 消息大全使用详解

消息,就是指Windows发出的一个通知,告诉应用程序某个事情发生了。例如,单击鼠标、改变窗口尺寸、按下键盘上的一个键都会使Windows发送一个消息给应用程序。消息本身是作为一个记录传递给应用程序的,这个记录中包含了消息的类型以及其他信息。例如,对于单击鼠标所产生的消息来说,这个记录中包含了单击鼠标时的坐标。这个记录类型叫做TMsg,

它在Windows单元中是这样声明的:
type
TMsg = packed record
hwnd: HWND; / /窗口句柄
message: UINT; / /消息常量标识符
wParam: WPARAM ; // 32位消息的特定附加信息
lParam: LPARAM ; // 32位消息的特定附加信息
time: DWORD; / /消息创建时的时间
pt: TPoint; / /消息创建时的鼠标位置
end;

消息中有什么?
是否觉得一个消息记录中的信息像希腊语一样?如果是这样,那么看一看下面的解释:
hwnd 32位的窗口句柄。窗口可以是任何类型的屏幕对象,因为Win32能够维护大多数可视对象的句柄(窗口、对话框、按钮、编辑框等)。
message 用于区别其他消息的常量值,这些常量可以是Windows单元中预定义的常量,也可以是自定义的常量。
wParam 通常是一个与消息有关的常量值,也可能是窗口或控件的句柄。
lParam 通常是一个指向内存中数据的指针。由于W P a r a m、l P a r a m和P o i n t e r都是3 2位的,
因此,它们之间可以相互转换。

WM_NULL = $0000;
WM_CREATE = $0001;
应用程序创建一个窗口
WM_DESTROY = $0002;
一个窗口被销毁
WM_MOVE = $0003;
移动一个窗口
WM_SIZE = $0005;
改变一个窗口的大小
WM_ACTIVATE = $0006;
一个窗口被激活或失去激活状态;
WM_SETFOCUS = $0007;
获得焦点后
WM_KILLFOCUS = $0008;
失去焦点
WM_ENABLE = $000A;
改变enable状态
WM_SETREDRAW = $000B;
设置窗口是否能重画
WM_SETTEXT = $000C;
应用程序发送此消息来设置一个窗口的文本
WM_GETTEXT = $000D;
应用程序发送此消息来复制对应窗口的文本到缓冲区
WM_GETTEXTLENGTH = $000E;
得到与一个窗口有关的文本的长度(不包含空字符)
WM_PAINT = $000F;
要求一个窗口重画自己
WM_CLOSE = $0010;
当一个窗口或应用程序要关闭时发送一个信号
WM_QUERYENDSESSION = $0011;
当用户选择结束对话框或程序自己调用ExitWindows函数
WM_QUIT = $0012;
用来结束程序运行或当程序调用postquitmessage函数
WM_QUERYOPEN = $0013;
当用户窗口恢复以前的大小位置时,把此消息发送给某个图标
WM_ERASEBKGND = $0014;
当窗口背景必须被擦除时(例在窗口改变大小时)
WM_SYSCOLORCHANGE = $0015;
当系统颜色改变时,发送此消息给所有顶级窗口
WM_ENDSESSION = $0016;
当系统进程发出WM_QUERYENDSESSION消息后,此消息发送给应用程序,
通知它对话是否结束
WM_SYSTEMERROR = $0017;
WM_SHOWWINDOW = $0018;
当隐藏或显示窗口是发送此消息给这个窗口
WM_ACTIVATEAPP = $001C;
发此消息给应用程序哪个窗口是激活的,哪个是非激活的;
WM_FONTCHANGE = $001D;
当系统的字体资源库变化时发送此消息给所有顶级窗口
WM_TIMECHANGE = $001E;
当系统的时间变化时发送此消息给所有顶级窗口
WM_CANCELMODE = $001F;
发送此消息来取消某种正在进行的摸态(操作)
WM_SETCURSOR = $0020;
如果鼠标引起光标在某个窗口中移动且鼠标输入没有被捕获时,就发消息给某个窗口
WM_MOUSEACTIVATE = $0021;
当光标在某个非激活的窗口中而用户正按着鼠标的某个键发送此消息给当前窗口
WM_CHILDACTIVATE = $0022;
发送此消息给MDI子窗口当用户点击此窗口的标题栏,或当窗口被激活,移动,改变大小
WM_QUEUESYNC = $0023;
此消息由基于计算机的训练程序发送,通过WH_JOURNALPALYBACK的hook程序
分离出用户输入消息
WM_GETMINMAXINFO = $0024;
此消息发送给窗口当它将要改变大小或位置;
WM_PAINTICON = $0026;
发送给最小化窗口当它图标将要被重画
WM_ICONERASEBKGND = $0027;
此消息发送给某个最小化窗口,仅当它在画图标前它的背景必须被重画
WM_NEXTDLGCTL = $0028;
发送此消息给一个对话框程序去更改焦点位置
WM_SPOOLERSTATUS = $002A;
每当打印管理列队增加或减少一条作业时发出此消息
WM_DRAWITEM = $002B;
当button,combobox,listbox,menu的可视外观改变时发送
此消息给这些空件的所有者
WM_MEASUREITEM = $002C;
当button, combo box, list box, list view control, or menu item 被创建时
发送此消息给控件的所有者
WM_DELETEITEM = $002D;
当the list box 或 combo box 被销毁 或 当 某些项被删除通过LB_DELETESTRING, LB_RESETCONTENT, CB_DELETESTRING, or CB_RESETCONTENT 消息
WM_VKEYTOITEM = $002E;
此消息有一个LBS_WANTKEYBOARDINPUT风格的发出给它的所有者来响应WM_KEYDOWN消息
WM_CHARTOITEM = $002F;
此消息由一个LBS_WANTKEYBOARDINPUT风格的列表框发送给他的所有者来响应WM_CHAR消息
WM_SETFONT = $0030;
当绘制文本时程序发送此消息得到控件要用的颜色
WM_GETFONT = $0031;
应用程序发送此消息得到当前控件绘制文本的字体
WM_SETHOTKEY = $0032;
应用程序发送此消息让一个窗口与一个热键相关连
WM_GETHOTKEY = $0033;
应用程序发送此消息来判断热键与某个窗口是否有关联
WM_QUERYDRAGICON = $0037;
此消息发送给最小化窗口,当此窗口将要被拖放而它的类中没有定义图标,应用程序能返回一个图标或光标的句柄,当用户拖放图标时系统显示这个图标或光标
WM_COMPAREITEM = $0039;
发送此消息来判定combobox或listbox新增加的项的相对位置
WM_GETOBJECT = $003D;
WM_COMPACTING = $0041;
显示内存已经很少了
WM_WINDOWPOSCHANGING = $0046;
发送此消息给那个窗口的大小和位置将要被改变时,来调用setwindowpos函数或其它窗口管理函数
WM_WINDOWPOSCHANGED = $0047;
发送此消息给那个窗口的大小和位置已经被改变时,来调用setwindowpos函数或其它窗口管理函数
WM_POWER = $0048;(适用于16位的windows)
当系统将要进入暂停状态时发送此消息
WM_COPYDATA = $004A;
当一个应用程序传递数据给另一个应用程序时发送此消息
WM_CANCELJOURNAL = $004B;
当某个用户取消程序日志激活状态,提交此消息给程序
WM_NOTIFY = $004E;
当某个控件的某个事件已经发生或这个控件需要得到一些信息时,发送此消息给它的父窗口
WM_INPUTLANGCHANGEREQUEST = $0050;
当用户选择某种输入语言,或输入语言的热键改变
WM_INPUTLANGCHANGE = $0051;
当平台现场已经被改变后发送此消息给受影响的最顶级窗口
WM_TCARD = $0052;
当程序已经初始化windows帮助例程时发送此消息给应用程序
WM_HELP = $0053;
此消息显示用户按下了F1,如果某个菜单是激活的,就发送此消息个此窗口关联的菜单,否则就
发送给有焦点的窗口,如果当前都没有焦点,就把此消息发送给当前激活的窗口
WM_USERCHANGED = $0054;
当用户已经登入或退出后发送此消息给所有的窗口,当用户登入或退出时系统更新用户的具体
设置信息,在用户更新设置时系统马上发送此消息;
WM_NOTIFYFORMAT = $0055;
公用控件,自定义控件和他们的父窗口通过此消息来判断控件是使用ANSI还是UNICODE结构
在WM_NOTIFY消息,使用此控件能使某个控件与它的父控件之间进行相互通信
WM_CONTEXTMENU = $007B;
当用户某个窗口中点击了一下右键就发送此消息给这个窗口
WM_STYLECHANGING = $007C;
当调用SETWINDOWLONG函数将要改变一个或多个 窗口的风格时发送此消息给那个窗口
WM_STYLECHANGED = $007D;
当调用SETWINDOWLONG函数一个或多个 窗口的风格后发送此消息给那个窗口
WM_DISPLAYCHANGE = $007E;
当显示器的分辨率改变后发送此消息给所有的窗口
WM_GETICON = $007F;
此消息发送给某个窗口来返回与某个窗口有关连的大图标或小图标的句柄;
WM_SETICON = $0080;
程序发送此消息让一个新的大图标或小图标与某个窗口关联;
WM_NCCREATE = $0081;
当某个窗口第一次被创建时,此消息在WM_CREATE消息发送前发送;
WM_NCDESTROY = $0082;
此消息通知某个窗口,非客户区正在销毁
WM_NCCALCSIZE = $0083;
当某个窗口的客户区域必须被核算时发送此消息
WM_NCHITTEST = $0084;//移动鼠标,按住或释放鼠标时发生
WM_NCPAINT = $0085;
程序发送此消息给某个窗口当它(窗口)的框架必须被绘制时;
WM_NCACTIVATE = $0086;
此消息发送给某个窗口 仅当它的非客户区需要被改变来显示是激活还是非激活状态;
WM_GETDLGCODE = $0087;
发送此消息给某个与对话框程序关联的控件,widdows控制方位键和TAB键使输入进入此控件
通过响应WM_GETDLGCODE消息,应用程序可以把他当成一个特殊的输入控件并能处理它
WM_NCMOUSEMOVE = $00A0;
当光标在一个窗口的非客户区内移动时发送此消息给这个窗口 //非客户区为:窗体的标题栏及窗
的边框体
WM_NCLBUTTONDOWN = $00A1;
当光标在一个窗口的非客户区同时按下鼠标左键时提交此消息
WM_NCLBUTTONUP = $00A2;
当用户释放鼠标左键同时光标某个窗口在非客户区十发送此消息;
WM_NCLBUTTONDBLCLK = $00A3;
当用户双击鼠标左键同时光标某个窗口在非客户区十发送此消息
WM_NCRBUTTONDOWN = $00A4;
当用户按下鼠标右键同时光标又在窗口的非客户区时发送此消息
WM_NCRBUTTONUP = $00A5;
当用户释放鼠标右键同时光标又在窗口的非客户区时发送此消息
WM_NCRBUTTONDBLCLK = $00A6;
当用户双击鼠标右键同时光标某个窗口在非客户区十发送此消息
WM_NCMBUTTONDOWN = $00A7;
当用户按下鼠标中键同时光标又在窗口的非客户区时发送此消息
WM_NCMBUTTONUP = $00A8;
当用户释放鼠标中键同时光标又在窗口的非客户区时发送此消息
WM_NCMBUTTONDBLCLK = $00A9;
当用户双击鼠标中键同时光标又在窗口的非客户区时发送此消息
WM_KEYFIRST = $0100;
WM_KEYDOWN = $0100;
//按下一个键
WM_KEYUP = $0101;
//释放一个键
WM_CHAR = $0102;
//按下某键,并已发出WM_KEYDOWN, WM_KEYUP消息
WM_DEADCHAR = $0103;
当用translatemessage函数翻译WM_KEYUP消息时发送此消息给拥有焦点的窗口
WM_SYSKEYDOWN = $0104;
当用户按住ALT键同时按下其它键时提交此消息给拥有焦点的窗口;
WM_SYSKEYUP = $0105;
当用户释放一个键同时ALT 键还按着时提交此消息给拥有焦点的窗口
WM_SYSCHAR = $0106;
当WM_SYSKEYDOWN消息被TRANSLATEMESSAGE函数翻译后提交此消息给拥有焦点的窗口
WM_SYSDEADCHAR = $0107;
当WM_SYSKEYDOWN消息被TRANSLATEMESSAGE函数翻译后发送此消息给拥有焦点的窗口
WM_KEYLAST = $0108;
WM_INITDIALOG = $0110;
在一个对话框程序被显示前发送此消息给它,通常用此消息初始化控件和执行其它任务
WM_COMMAND = $0111;
当用户选择一条菜单命令项或当某个控件发送一条消息给它的父窗口,一个快捷键被翻译
WM_SYSCOMMAND = $0112;
当用户选择窗口菜单的一条命令或当用户选择最大化或最小化时那个窗口会收到此消息
WM_TIMER = $0113; //发生了定时器事件
WM_HSCROLL = $0114;
当一个窗口标准水平滚动条产生一个滚动事件时发送此消息给那个窗口,也发送给拥有它的控件
WM_VSCROLL = $0115;
当一个窗口标准垂直滚动条产生一个滚动事件时发送此消息给那个窗口也,发送给拥有它的控件 WM_INITMENU = $0116;
当一个菜单将要被激活时发送此消息,它发生在用户菜单条中的某项或按下某个菜单键,它允许程序在显示前更改菜单
WM_INITMENUPOPUP = $0117;
当一个下拉菜单或子菜单将要被激活时发送此消息,它允许程序在它显示前更改菜单,而不要改变全部
WM_MENUSELECT = $011F;
当用户选择一条菜单项时发送此消息给菜单的所有者(一般是窗口)
WM_MENUCHAR = $0120;
当菜单已被激活用户按下了某个键(不同于加速键),发送此消息给菜单的所有者;
WM_ENTERIDLE = $0121;
当一个模态对话框或菜单进入空载状态时发送此消息给它的所有者,一个模态对话框或菜单进入空载状态就是在处理完一条或几条先前的消息后没有消息它的列队中等待
WM_MENURBUTTONUP = $0122;
WM_MENUDRAG = $0123;
WM_MENUGETOBJECT = $0124;
WM_UNINITMENUPOPUP = $0125;
WM_MENUCOMMAND = $0126;
WM_CHANGEUISTATE = $0127;
WM_UPDATEUISTATE = $0128;
WM_QUERYUISTATE = $0129;
WM_CTLCOLORMSGBOX = $0132;
在windows绘制消息框前发送此消息给消息框的所有者窗口,通过响应这条消息,所有者窗口可以通过使用给定的相关显示设备的句柄来设置消息框的文本和背景颜色
WM_CTLCOLOREDIT = $0133;
当一个编辑型控件将要被绘制时发送此消息给它的父窗口;通过响应这条消息,所有者窗口可以通过使用给定的相关显示设备的句柄来设置编辑框的文本和背景颜色
WM_CTLCOLORLISTBOX = $0134;
当一个列表框控件将要被绘制前发送此消息给它的父窗口;通过响应这条消息,所有者窗口可以通过使用给定的相关显示设备的句柄来设置列表框的文本和背景颜色
WM_CTLCOLORBTN = $0135;
当一个按钮控件将要被绘制时发送此消息给它的父窗口;通过响应这条消息,所有者窗口可以通过使用给定的相关显示设备的句柄来设置按纽的文本和背景颜色
WM_CTLCOLORDLG = $0136;
当一个对话框控件将要被绘制前发送此消息给它的父窗口;通过响应这条消息,所有者窗口可以通过使用给定的相关显示设备的句柄来设置对话框的文本背景颜色
WM_CTLCOLORSCROLLBAR= $0137;
当一个滚动条控件将要被绘制时发送此消息给它的父窗口;通过响应这条消息,所有者窗口可以通过使用给定的相关显示设备的句柄来设置滚动条的背景颜色
WM_CTLCOLORSTATIC = $0138;
当一个静态控件将要被绘制时发送此消息给它的父窗口;通过响应这条消息,所有者窗口可以通过使用给定的相关显示设备的句柄来设置静态控件的文本和背景颜色
WM_MOUSEFIRST = $0200;
WM_MOUSEMOVE = $0200;
// 移动鼠标
WM_LBUTTONDOWN = $0201;
//按下鼠标左键
WM_LBUTTONUP = $0202;
//释放鼠标左键
WM_LBUTTONDBLCLK = $0203;
//双击鼠标左键
WM_RBUTTONDOWN = $0204;
//按下鼠标右键
WM_RBUTTONUP = $0205;
//释放鼠标右键
WM_RBUTTONDBLCLK = $0206;
//双击鼠标右键
WM_MBUTTONDOWN = $0207;
//按下鼠标中键
WM_MBUTTONUP = $0208;
//释放鼠标中键
WM_MBUTTONDBLCLK = $0209;
//双击鼠标中键
WM_MOUSEWHEEL = $020A;
当鼠标轮子转动时发送此消息个当前有焦点的控件
WM_MOUSELAST = $020A;
WM_PARENTNOTIFY = $0210;
当MDI子窗口被创建或被销毁,或用户按了一下鼠标键而光标在子窗口上时发送此消息给它的父窗口
WM_ENTERMENULOOP = $0211;
发送此消息通知应用程序的主窗口that已经进入了菜单循环模式
WM_EXITMENULOOP = $0212;
发送此消息通知应用程序的主窗口that已退出了菜单循环模式
WM_NEXTMENU = $0213;
WM_SIZING = 532;
当用户正在调整窗口大小时发送此消息给窗口;通过此消息应用程序可以监视窗口大小和位置也可以修改他们
WM_CAPTURECHANGED = 533;
发送此消息 给窗口当它失去捕获的鼠标时;
WM_MOVING = 534;
当用户在移动窗口时发送此消息,通过此消息应用程序可以监视窗口大小和位置也可以修改他们;
WM_POWERBROADCAST = 536;
此消息发送给应用程序来通知它有关电源管理事件;
WM_DEVICECHANGE = 537;
当设备的硬件配置改变时发送此消息给应用程序或设备驱动程序
WM_IME_STARTCOMPOSITION = $010D;
WM_IME_ENDCOMPOSITION = $010E;
WM_IME_COMPOSITION = $010F;
WM_IME_KEYLAST = $010F;
WM_IME_SETCONTEXT = $0281;
WM_IME_NOTIFY = $0282;
WM_IME_CONTROL = $0283;
WM_IME_COMPOSITIONFULL = $0284;
WM_IME_SELECT = $0285;
WM_IME_CHAR = $0286;
WM_IME_REQUEST = $0288;
WM_IME_KEYDOWN = $0290;
WM_IME_KEYUP = $0291;
WM_MDICREATE = $0220;
应用程序发送此消息给多文档的客户窗口来创建一个MDI 子窗口
WM_MDIDESTROY = $0221;
应用程序发送此消息给多文档的客户窗口来关闭一个MDI 子窗口
WM_MDIACTIVATE = $0222;
应用程序发送此消息给多文档的客户窗口通知客户窗口激活另一个MDI子窗口,当客户窗口收到此消息后,它发出WM_MDIACTIVE消息给MDI子窗口(未激活)激活它;
WM_MDIRESTORE = $0223;
程序 发送此消息给MDI客户窗口让子窗口从最大最小化恢复到原来大小
WM_MDINEXT = $0224;
程序 发送此消息给MDI客户窗口激活下一个或前一个窗口
WM_MDIMAXIMIZE = $0225;
程序发送此消息给MDI客户窗口来最大化一个MDI子窗口;
WM_MDITILE = $0226;
程序 发送此消息给MDI客户窗口以平铺方式重新排列所有MDI子窗口
WM_MDICASCADE = $0227;
程序 发送此消息给MDI客户窗口以层叠方式重新排列所有MDI子窗口
WM_MDIICONARRANGE = $0228;
程序 发送此消息给MDI客户窗口重新排列所有最小化的MDI子窗口
WM_MDIGETACTIVE = $0229;
程序 发送此消息给MDI客户窗口来找到激活的子窗口的句柄
WM_MDISETMENU = $0230;
程序 发送此消息给MDI客户窗口用MDI菜单代替子窗口的菜单
WM_ENTERSIZEMOVE = $0231;
WM_EXITSIZEMOVE = $0232;
WM_DROPFILES = $0233;
WM_MDIREFRESHMENU = $0234;
WM_MOUSEHOVER = $02A1;
WM_MOUSELEAVE = $02A3;
WM_CUT = $0300;
程序发送此消息给一个编辑框或combobox来删除当前选择的文本
WM_COPY = $0301;
程序发送此消息给一个编辑框或combobox来复制当前选择的文本到剪贴板
WM_PASTE = $0302;
程序发送此消息给editcontrol或combobox从剪贴板中得到数据
WM_CLEAR = $0303;
程序发送此消息给editcontrol或combobox清除当前选择的内容;
WM_UNDO = $0304;
程序发送此消息给editcontrol或combobox撤消最后一次操作
WM_RENDERFORMAT = $0305;

WM_RENDERALLFORMATS = $0306;
WM_DESTROYCLIPBOARD = $0307;
当调用ENPTYCLIPBOARD函数时 发送此消息给剪贴板的所有者
WM_DRAWCLIPBOARD = $0308;
当剪贴板的内容变化时发送此消息给剪贴板观察链的第一个窗口;它允许用剪贴板观察窗口来
显示剪贴板的新内容;
WM_PAINTCLIPBOARD = $0309;
当剪贴板包含CF_OWNERDIPLAY格式的数据并且剪贴板观察窗口的客户区需要重画;
WM_VSCROLLCLIPBOARD = $030A;
WM_SIZECLIPBOARD = $030B;
当剪贴板包含CF_OWNERDIPLAY格式的数据并且剪贴板观察窗口的客户区域的大小已经改变是此消息通过剪贴板观察窗口发送给剪贴板的所有者;
WM_ASKCBFORMATNAME = $030C;
通过剪贴板观察窗口发送此消息给剪贴板的所有者来请求一个CF_OWNERDISPLAY格式的剪贴板的名字
WM_CHANGECBCHAIN = $030D;
当一个窗口从剪贴板观察链中移去时发送此消息给剪贴板观察链的第一个窗口;
WM_HSCROLLCLIPBOARD = $030E;
此消息通过一个剪贴板观察窗口发送给剪贴板的所有者 ;它发生在当剪贴板包含CFOWNERDISPALY格式的数据并且有个事件在剪贴板观察窗的水平滚动条上;所有者应滚动剪贴板图象并更新滚动条的值;
WM_QUERYNEWPALETTE = $030F;
此消息发送给将要收到焦点的窗口,此消息能使窗口在收到焦点时同时有机会实现他的逻辑调色板
WM_PALETTEISCHANGING= $0310;
当一个应用程序正要实现它的逻辑调色板时发此消息通知所有的应用程序
WM_PALETTECHANGED = $0311;
此消息在一个拥有焦点的窗口实现它的逻辑调色板后发送此消息给所有顶级并重叠的窗口,以此来改变系统调色板
WM_HOTKEY = $0312;
当用户按下由REGISTERHOTKEY函数注册的热键时提交此消息
WM_PRINT = 791;
应用程序发送此消息仅当WINDOWS或其它应用程序发出一个请求要求绘制一个应用程序的一部分;
WM_PRINTCLIENT = 792;
WM_HANDHELDFIRST = 856;
WM_HANDHELDLAST = 863;
WM_PENWINFIRST = $0380;
WM_PENWINLAST = $038F;
WM_COALESCE_FIRST = $0390;
WM_COALESCE_LAST = $039F;
WM_DDE_FIRST = $03E0;
WM_DDE_INITIATE = WM_DDE_FIRST + 0;
一个DDE客户程序提交此消息开始一个与服务器程序的会话来响应那个指定的程序和主题名;
WM_DDE_TERMINATE = WM_DDE_FIRST + 1;
一个DDE应用程序(无论是客户还是服务器)提交此消息来终止一个会话;
WM_DDE_ADVISE = WM_DDE_FIRST + 2;
一个DDE客户程序提交此消息给一个DDE服务程序来请求服务器每当数据项改变时更新它
WM_DDE_UNADVISE = WM_DDE_FIRST + 3;
一个DDE客户程序通过此消息通知一个DDE服务程序不更新指定的项或一个特殊的剪贴板格式的项
WM_DDE_ACK = WM_DDE_FIRST + 4;
此消息通知一个DDE(动态数据交换)程序已收到并正在处理WM_DDE_POKE, WM_DDE_EXECUTE, WM_DDE_DATA, WM_DDE_ADVISE, WM_DDE_UNADVISE, or WM_DDE_INITIAT消息
WM_DDE_DATA = WM_DDE_FIRST + 5;
一个DDE服务程序提交此消息给DDE客户程序来传递个一数据项给客户或通知客户的一条可用数据项
WM_DDE_REQUEST = WM_DDE_FIRST + 6;
一个DDE客户程序提交此消息给一个DDE服务程序来请求一个数据项的值;
WM_DDE_POKE = WM_DDE_FIRST + 7;
一个DDE客户程序提交此消息给一个DDE服务程序,客户使用此消息来请求服务器接收一个未经同意的数据项;服务器通过答复WM_DDE_ACK消息提示是否它接收这个数据项;
WM_DDE_EXECUTE = WM_DDE_FIRST + 8;
一个DDE客户程序提交此消息给一个DDE服务程序来发送一个字符串给服务器让它象串行命令一样被处理,服务器通过提交WM_DDE_ACK消息来作回应;
WM_DDE_LAST = WM_DDE_FIRST + 8;
WM_APP = $8000;
WM_USER = $0400;
此消息能帮助应用程序自定义私有消息;
/////////////////////////////////////////////////////////////////////
通知消息(Notification message)是指这样一种消息,一个窗口内的子控件发生了一些事情,需要通知父窗口。通知消息只适用于标准的窗口控件如按钮、列表框、组合框、编辑框,以及Windows 95公共控件如树状视图、列表视图等。例如,单击或双击一个控件、在控件中选择部分文本、操作控件的滚动条都会产生通知消息。
按扭
B N _ C L I C K E D //用户单击了按钮
B N _ D I S A B L E //按钮被禁止
B N _ D O U B L E C L I C K E D //用户双击了按钮
B N _ H I L I T E //用户加亮了按钮
B N _ PA I N T按钮应当重画
B N _ U N H I L I T E加亮应当去掉
组合框
C B N _ C L O S E U P组合框的列表框被关闭
C B N _ D B L C L K用户双击了一个字符串
C B N _ D R O P D O W N组合框的列表框被拉出
C B N _ E D I T C H A N G E用户修改了编辑框中的文本
C B N _ E D I T U P D AT E编辑框内的文本即将更新
C B N _ E R R S PA C E组合框内存不足
C B N _ K I L L F O C U S组合框失去输入焦点
C B N _ S E L C H A N G E在组合框中选择了一项
C B N _ S E L E N D C A N C E L用户的选择应当被取消
C B N _ S E L E N D O K用户的选择是合法的
C B N _ S E T F O C U S组合框获得输入焦点
编辑框
E N _ C H A N G E编辑框中的文本己更新
E N _ E R R S PA C E编辑框内存不足
E N _ H S C R O L L用户点击了水平滚动条
E N _ K I L L F O C U S编辑框正在失去输入焦点
E N _ M A X T E X T插入的内容被截断
E N _ S E T F O C U S编辑框获得输入焦点
E N _ U P D AT E编辑框中的文本将要更新
E N _ V S C R O L L用户点击了垂直滚动条消息含义
列表框
L B N _ D B L C L K用户双击了一项
L B N _ E R R S PA C E列表框内存不够
L B N _ K I L L F O C U S列表框正在失去输入焦点
L B N _ S E L C A N C E L选择被取消
L B N _ S E L C H A N G E选择了另一项
L B N _ S E T F O C U S列表框获得输入焦点

本栏文章均来自于互联网,版权归原作者和各发布网站所有,本站收集这些文章仅供学习参考之用。任何人都不能将这些文章用于商业或者其他目的。( ProgramFan.Com )

2005年04月27日

See this in the MSDN LibrarySee This in the MSDN Library

Page Options

Microsoft Win32 to Microsoft .NET Framework API Map

 

Microsoft .NET Framework and Microsoft Visual Studio User Education Teams
Microsoft Corporation

January 2004

Applies to:
    Microsoft® .NET Framework version 1.0 or 1.1
    Microsoft Visual Studio® .NET
    Microsoft Win32® functions

Summary: This article identifies the Microsoft .NET Framework version 1.0 or 1.1 APIs that provide similar functionality to Microsoft Win32 functions. One or more relevant .NET Framework APIs are shown for each Win32 function listed. The intended audience for this article is experienced Win32 developers who are creating applications or libraries based on the Microsoft .NET Framework, but anyone looking for a managed counterpart for a Win32 function could find this document useful. (85 printed pages)

In this article, the Microsoft® Win32® functions are organized by category. Each Win32 function that is listed belongs to only one category, and each category is presented in its own table. An alphabetical list of the Win32 categories is provided, as well as a hierarchical list. To locate a Win32 function, select the appropriate category from one of the category lists or search the article for the name of the function. If you do not find the Win32 function that you are seeking, it means that no equivalent .NET Framework API exists in the .NET Framework version 1.0 or 1.1 or that the Win32 function and the relevant .NET Framework API were inadvertently omitted from the list.

If you believe that a Win32 function and the relevant .NET Framework API have been omitted from this article, please let us know by using the feedback link. For more information on the APIs listed in this article, see the Platform SDK documentation or the .NET Framework SDK documentation in the MSDN® library.

Alphabetical Win32 Category List

A-C

Atom functions Color functions
Bitmap functions Combo box functions
Brush functions Common dialog box functions
Button functions Console functions
Clipboard functions Coordinate functions
Clipping functons Cursor functions

D-I

Debugging functions File I/O functions
Device context functions File system functions
Dialog box functions Filled shape functions
Dynamic-link library functions Font and text functions
Error handling functions Icon functions
Event logging functions Input Method Editor functions

J-N

Keyboard accelerator functions Message and message queue functions
Keyboard input functions Metafile functions
Line and curve functions Mouse input functons
List box functions Multiple display monitor functions
Memory management functions Multiple-document interface functions
Menu functions National language functions

O-R

Painting and drawing functions PSAPI functions
Path functions Rectangle functions
Pen functions Region functions
Performance monitoring functions Registry functions
Printing functions Resource functions
Process and thread functions Rich edit control functions

S-T

Scroll bar functions Tape backup functions
Service functions Text object model functions
String functions Time functions
Structured exception-handling functions Timer functions
Synchronization functions Tool Help functions
System information functions  

U-Z

Unicode and character set functions Window functions
User profile functions Window class functions
Version information functions Window procedure functions
  Window property functions

Hierarchical Win32 Category List

Base Services

Debugging and Error Handling Miscellaneous
Debugging Memory management
Error handling User profile
Event logging Performance
Structured exception-handling Performance monitoring
DLLs, Processes, and Threads PSAPI
Console applications Tool Help
Dynamic-link library Windows System Information
Process and thread Registry
Service System information
Synchronization Time
Files and I/O  
File I/O  
File system  
Tape backup  

Graphics Device Interface

Bitmap Metafile
Brush Multiple display monitor
Clipping National language
Color Painting and drawing
Coordinate Path
Device context Pen
Filled shape Printing and print spooler
Font and text Rectangle
Input Method Editor Region
Line and curve Unicode and character set

User Interface

Controls User Input
Button Common dialog box
Combo box Keyboard accelerator
List box Keyboard input
Rich edit control Mouse input
Scroll bar Windowing
Text object model Dialog box
Data Exchange Message and message queue
Atom Multiple-document interface
Clipboard Timer
Resources Window
Cursor Window class
Icon Window procedure
Menu Window property
Resource  
String  
Version information  

Atom Functions

Win32 function Description .NET Framework API
AddAtom Adds a character string to the local atom table. System.String.Intern

Note   String is not exactly an atom.

FindAtom Searches the local atom table for the specified character string. System.String.IsInterned

Note   String is not exactly an atom.

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Bitmap Functions

Win32 function Description .NET Framework API
AlphaBlend Displays a bitmap with transparent or semitransparent pixels. System.Drawing.Graphics.DrawImage
BitBlt Performs a bit-block transfer. System.Drawing.Graphics.DrawImage
CreateBitmap Creates a bitmap. System.Drawing.Bitmap constructor

Note   Creates a DIB, not a DDB.

GetBitmapDimensionEx Gets the dimensions of a bitmap. System.Drawing.Bitmap.Size
GetDIBColorTable Retrieves RGB color values from a DIB section bitmap. System.Drawing.Bitmap.Palette
GetDIBits Copies a bitmap into a buffer. System.Drawing.Bitmap.LockBits
GetPixel Gets the RGB color value of the pixel at a given coordinate. System.Drawing.Bitmap.GetPixel
GradientFill Fills rectangle and triangle structures. System.Drawing.Graphics.FillRectangle(Drawing2D.LinearGradiantBrush, Rectangle)
LoadBitmap Loads a bitmap from a module’s executable file. System.Drawing.Bitmap.Bitmap(Type, String)
SetPixel Sets the color for a pixel. System.Drawing.Bitmap.SetPixel
SetPixelV Sets a pixel to the best approximation of a color. System.Drawing.Bitmap.SetPixel(, Graphics.GetNearestColor(Color))
StretchBlt Copies a bitmap and stretches or compresses it. System.Drawing.Graphics.DrawImage

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Brush Functions

Win32 function Description .NET Framework API
CreateBrushIndirect Creates a brush with a specified style, color, and pattern. Any of the following:
System.Drawing.Brushes
System.Drawing.SolidBrush
System.Drawing.TextureBrush
System.Drawing.Drawing2D.HatchBrush
System.Drawing.Drawing2D.LinearGradientBrush
System.Drawing.Drawing2D.PathGradientBrush
CreateHatchBrush Creates a brush with a hatch pattern and color. System.Drawing.Drawing2D.HatchBrush constructor
CreatePatternBrush Creates a brush with a bitmap pattern. System.Drawing.TextureBrush constructor
CreateSolidBrush Creates a brush with a solid color. System.Drawing.SolidBrush constructor
GetSysColorBrush Gets a handle for a brush that corresponds to a color index. System.Drawing.Brushes class

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Button Functions

Win32 function Description .NET Framework API
CheckDlgButton Changes the check state of a button control. System.Windows.Forms.CheckBox.Checked
CheckRadioButton Adds a check mark to a specified radio button in a group and removes a check mark from all other radio buttons in the group. System.Windows.Forms.RadioButton.Checked
IsDlgButtonChecked Determines whether a button control has a check mark next to it or whether a three-state button control is grayed, checked, or neither. System.Windows.Forms.CheckBox.CheckState

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Clipboard Functions

Win32 function Description .NET Framework API
CountClipboardFormats Retrieves the number of different data formats currently on the clipboard. System.Windows.Forms.DataObject.GetFormats
EnumClipboardFormats Enumerates the data formats currently available on the clipboard. System.Windows.Forms.DataObject.GetFormats
GetClipboardData Retrieves data from the clipboard in a specified format. System.Windows.Forms.ClipBoard.GetDataObject
IsClipboardFormatAvailable Determines whether the clipboard contains data in the specified format. System.Windows.Forms.DataObject.GetDataPresent
RegisterClipboardFormat Registers a new clipboard format. System.Windows.Forms.DataFormats.GetFormat
SetClipboardData Places data on the clipboard in a specified clipboard format. System.Windows.Forms.ClipBoard.SetDataObject

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Clipping Functions

Win32 function Description .NET Framework API
ExcludeClipRect Creates a new clipping region that consists of the existing clipping region minus the specified rectangle. System.Drawing.Graphics.ExcludeClip
ExtSelectClipRgn Combines the specified region with the current clipping region using the specified mode. System.Drawing.Graphics.SetClip
GetClipBox Retrieves the dimensions of the tightest bounding rectangle that can be drawn around the current visible area on the device. System.Drawing.Graphics.VisibleClipBounds
GetClipRgn Retrieves a handle identifying the current application-defined clipping region for the specified device context. System.Drawing.Graphics.Clip
IntersectClipRect Creates a new clipping region from the intersection of the current clipping region and the specified rectangle. System.Drawing.Graphics.IntersectClip
OffsetClipRgn Moves the clipping region of a device context by the specified offsets. System.Drawing.Graphics.TranslateClip
PtVisible Determines whether the specified point is within the clipping region of a device context. System.Drawing.Graphics.IsVisible
RectVisible Determines whether any part of the specified rectangle lies within the clipping region of a device context. System.Drawing.Graphics.IsVisible
SelectClipPath Selects the current path as a clipping region for a device context, combining the new region with any existing clipping region by using the specified mode. System.Drawing.Graphics.SetClip
SelectClipRgn Selects a region as the current clipping region for the specified device context. System.Drawing.Graphics.Clip

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Color Functions

Win32 function Description .NET Framework API
CreateHalftonePalette Creates a halftone palette for the specified device context. System.Drawing.Graphics.GetHalftonePalette
CreatePalette Creates a logical palette. System.Drawing.Image.Palette
GetNearestColor Retrieves a color value identifying a color from the system palette that will be displayed when the specified color value is used. System.Drawing.Graphics.GetNearestColor
GetPaletteEntries Retrieves a specified range of palette entries from the given logical palette. System.Drawing.Image.Palette.Entries

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Combo Box Functions

Win32 function Description .NET Framework API
DlgDirListComboBox Replaces the contents of a combo box with the names of specified subdirectories and files. System.Windows.Forms.ComboBox.Items.AddRange(System.IO.Directory.GetFileSystemEntries)
DlgDirSelectComboBoxEx Retrieves the current selection from a combo box filled by using DlgDirListComboBox. System.Windows.Forms.ComboBox.SelectedItem
GetComboBoxInfo Retrieves information about a specified combo box. System.Windows.Forms.ComboBox properties

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Common Dialog Box Functions

Win32 function Description .NET Framework API
ChooseColor Creates a Color dialog box that enables the user to select a color. System.Windows.Forms.ColorDialog constructor

Note   Dialog cannot be modified through a hook.

ChooseFont Creates a Font dialog box that enables the user to choose attributes for a logical font. System.Windows.Forms.FontDialog constructor

Note   Dialog cannot be modified through a hook.

GetFileTitle Retrieves the name of the specified file. System.IO.FileInfo.Name

Note   Does not take user preferences into account.

GetOpenFileName Creates an Open dialog box that lets the user specify the drive, directory, and name of a file or set of files to open. System.Windows.Forms.OpenFileDialog.ShowDialog

Note   Dialog cannot be modified through a hook.

GetSaveFileName Creates a Save dialog box that lets the user specify the drive, directory, and name of a file to save. System.Windows.Forms.SaveFileDialog.ShowDialog

Note   Dialog cannot be modified through a hook.

PageSetupDlg Creates a Page Setup dialog box that enables the user to specify the attributes of a printed page. System.Windows.Forms.PageSetupDialog.ShowDialog

Note   Dialog cannot be modified through a hook.

PrintDlg Displays a Print dialog box. System.Windows.Forms.PrintDialog.ShowDialog

Note   Dialog cannot be modified through a hook.

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Console Functions

Win32 function Description .NET Framework API
GetStdHandle Retrieves a handle for the standard input, standard output, or standard error device. System.Console.OpenStandardIn
System.Console.OpenStandardOut
System.Console.OpenStandardError
ReadConsole Reads character input from the console input buffer and removes it from the buffer. System.Console.Read
SetStdHandle Sets the handle for the standard input, standard output, or standard error device. System.Console.SetIn
System.Console.SetOut
System.Console.SetError
WriteConsole Writes a character string to a console screen buffer beginning at the current cursor location. System.Console.Write

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Coordinate Functions

Win32 function Description .NET Framework API
ClientToScreen Converts the client-area coordinates of a specified point to screen coordinates. System.Windows.Forms.Form.PointToScreen
CombineTransform Concatenates two world-space to page-space transformations. System.Drawing.Drawing2D.Matrix.Multiply
DPtoLP Converts device coordinates into logical coordinates. System.Drawing.Graphics.TransformPoints
GetMapMode Retrieves the current mapping mode. System.Drawing.Graphics.PageUnit
GetWindowExtEx Retrieves the x-extent and y-extent of the window for the specified device context. System.Drawing.Graphics.PageScale
GetWindowOrgEx Retrieves the x-coordinates and y-coordinates of the window origin for the specified device context. System.Drawing.Graphics.Transform.OffsetX
System.Drawing.Graphics.Transform.OffsetY
GetWorldTransform Retrieves the current world-space to page-space transformation. System.Drawing.Graphics.Transform
LPtoDP Converts logical coordinates into device coordinates. System.Drawing.Graphics.TransformPoints
ModifyWorldTransform Changes the world transformation for a device context using the specified mode. System.Drawing.Graphics.Transform
OffsetViewportOrgEx Modifies the viewport origin for a device context using the specified horizontal and vertical offsets. System.Drawing.Graphics.TranslateTransform
OffsetWindowOrgEx Modifies the window origin for a device context using the specified horizontal and vertical offsets. System.Drawing.Graphics.TranslateTransform
ScreenToClient Converts the screen coordinates of a specified point on the screen-to-client coordinates. System.Windows.Forms.Form.PointToClient
SetMapMode Sets the mapping mode of the specified device context. System.Drawing.Graphics.PageUnit
SetWindowExtEx Sets the horizontal and vertical extents of the window for a device context by using the specified values. System.Drawing.Graphics.PageScale
Drawing.Graphics.ScaleTransform
SetWindowOrgEx Specifies which window point maps to the viewport origin (0,0). System.Drawing.Graphics.TranslateTransform
SetWorldTransform Sets a two-dimensional linear transformation between world space and page space for the specified device context. System.Drawing.Graphics.Transform

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Cursor Functions

Win32 function Description .NET Framework API
ClipCursor Confines the cursor to a rectangular area on the screen. System.Windows.Forms.Cursor.Clip
CopyCursor Copies the specified cursor. System.Windows.Forms.Cursor.CopyHandle
CreateCursor Creates a cursor having the specified size, bit patterns, and hot spot. System.Windows.Forms.Cursor constructor
System.Windows.Forms.Cursor.Size
System.Windows.Forms.Cursor.Position
DestroyCursor Destroys a cursor. System.Windows.Forms.Cursor.Dispose
GetClipCursor Retrieves the screen coordinates of the rectangular area to which the cursor is confined. System.Windows.Forms.Cursor.Clip
GetCursor Retrieves a handle to the current cursor. System.Windows.Forms.Cursor.Handle
GetCursorInfo Retrieves information about the global cursor. System.Windows.Forms.Cursor.Position
System.Windows.Forms.SystemInformation.CursorSize
GetCursorPos Retrieves the cursor’s position. System.Windows.Forms.Control.MousePosition
System.Windows.Forms.Cursor.Position
LoadCursor Loads a cursor resource from an executable file. System.Windows.Forms.Cursor constructor
LoadCursorFromFile Creates a cursor based on data contained in a file. System.Windows.Forms.Cursor constructor
SetCursor Sets the cursor shape. System.Windows.Forms.Cursor.Current
SetCursorPos Moves the cursor to the specified screen coordinates. System.Windows.Forms.Cursor.Position
ShowCursor Displays or hides the cursor. System.Windows.Forms.Cursor.Show
Windows.Forms.Cursor.Hide

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Debugging Functions

Win32 function Description .NET Framework API
DebugActiveProcess Enables a debugger to attach to an active process and debug it. System.Diagnostics.Debugger.Launch
DebugBreak Causes a breakpoint exception to occur in the current process. System.Diagnostics.Debugger.Break
IsDebuggerPresent Determines whether the calling process is running under the context of a debugger. System.Diagnostics.Debugger.IsAttached
OutputDebugString Sends a string to the debugger for display. System.Diagnostics.Debugger.Log

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Device Context Functions

Win32 function Description .NET Framework API
ChangeDisplaySettings Changes the settings of the default display device to the specified graphics mode. System.Management.ManagementClass("Win32_VideoController")
ChangeDisplaySettingsEx Changes the settings of the specified display device to the specified graphics mode. System.Management.ManagementClass("Win32_VideoController")
DeviceCapabilities Retrieves the capabilities of a printer device driver. System.Drawing.Printing.PageSettings
System.Drawing.Printing.PrinterSettings
EnumDisplayDevices Retrieves information about the display devices in a system. System.Management.ManagementClass("Win32_DesktopMonitor")
EnumDisplaySettings Retrieves information about one of the graphics modes for a display device. System.Management.ManagementClass("CIM_VideoControllerResolution")
GetDC Retrieves a handle to a display device context for the client area of a specified window or for the entire screen. To retrieve a Graphics object, use any of the following:
System.Drawing.Graphics.FromHwnd(Windows.Forms.Control.Handle)
System.Drawing.Printing.PrintPageEventArgs.Graphics
System.Windows.Forms.PaintEventArgs.Graphics

To explicitly retrieve a handle, use the following:
System.Drawing.Graphics.GetHdc

GetDCEx Retrieves a handle to a display device context for the client area of a specified window or for the entire screen. To retrieve a Graphics object, use any of the following:
System.Drawing.Graphics.FromHwnd(Windows.Forms.Control.Handle)
System.Drawing.Printing.PrintPageEventArgs.Graphics
System.Windows.Forms.PaintEventArgs.Graphics

To explicitly retrieve a handle, use the following:
System.Drawing.Graphics.GetHdc

GetDeviceCaps Retrieves device-specific information for the specified device. System.Drawing.Graphics properties
System.Drawing.Printing.PrinterSettings
System.Management
classes
GetLayout Retrieves the layout of a device context. System.Windows.Forms.Control.RightToLeft
GetObject Retrieves information for the specified graphics object. System.Drawing.Bitmap properties
System.Drawing.Brush
properties
System.Drawing.Font
properties
System.Drawing.Pen
properties
GetObjectType Retrieves the type of the specified object. System.Object.GetType
GetStockObject Retrieves a handle to one of the stock pens, brushes, fonts, or palettes. System.Drawing.Brushes
System.Drawing.Pens
ReleaseDC Releases a device context, freeing it for use by other applications. System.Drawing.Graphics.ReleaseHdc
SetLayout Sets the layout for a device context. System.Windows.Forms.Control.RightToLeft = System.Windows.Forms.RightToLeft.Yes

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Dialog Box Functions

Win32 function Description .NET Framework API
CreateDialog Creates a modeless dialog box from a dialog box template resource. System.Windows.Forms.Form constructor
System.Windows.Forms.Form
properties
CreateDialogIndirect Creates a modeless dialog box from a dialog box template in memory. System.Windows.Forms.Form constructor
System.Windows.Forms.Form
properties
DefDlgProc Calls the default dialog box window procedure to provide default processing for any window messages that a dialog box with a private window class does not process. System.Windows.Forms.Form.DefWndProc
DialogBox Creates a modal dialog box from a dialog box template resource. System.Windows.Forms.Form constructor
System.Windows.Forms.Form.ShowDialog
DialogBoxIndirect Creates a modal dialog box from a dialog box template in memory. System.Windows.Forms.Form constructor
System.Windows.Forms.Form.ShowDialog
DialogProc An application-defined callback function used with the CreateDialog and DialogBox families of functions. System.Windows.Forms.Form.WndProc
EndDialog Destroys a modal dialog box. System.Windows.Forms.Form.Close
GetDlgCtrlID Retrieves the identifier of the specified control. System.Windows.Forms.Form.Controls.IndexOf
GetDlgItem Retrieves a handle to a control in the specified dialog box. System.Windows.Forms.Form.Controls.Item
GetDlgItemInt Translates the text of a specified control in a dialog box into an integer value. System.Int32.Parse(Form.Text)
System.UInt32.Parse(Form.Text)
GetDlgItemText Retrieves the title or text associated with a control in a dialog box. System.Windows.Forms.Form.Controls.Item[].Text
GetNextDlgGroupItem Retrieves a handle to the first control in a group of controls that precedes (or follows) the specified control. Iterate through the controls:
System.Windows.Forms.Form.Controls.Item

Remember to determine whether the control is active by referencing the Enabled and Visible properties of the control.

Note   The order that the controls are presented in might not be the same order in which GetNextDlgGroupItem presents the controls.

GetNextDlgTabItem Retrieves a handle to the first control that has the WS_TABSTOP style that precedes (or follows) the specified control. Iterate through the controls:
System.Windows.Forms.Form.Controls.Item

Remember to determine whether the control is active by referencing the Enabled, Visible, and TabStop properties of the control.

Note   The order that the controls are presented in might not be the same order in which GetNextDlgGroupItem presents the controls.

MessageBox Creates, displays, and operates a message box. System.Windows.Forms.MessageBox.Show
MessageBoxEx Creates, displays, and operates a message box. System.Windows.Forms.MessageBox.Show
MessageBoxIndirect Creates, displays, and operates a message box. System.Windows.Forms.MessageBox.Show
SendDlgItemMessage Sends a message to the specified control in a dialog box. System.Windows.Forms.Form.WndProc(System.Windows.Forms.Message)
SetDlgItemInt Sets the text of a control in a dialog box to the string representation of a specified integer value. System.Windows.Forms.Control.Text = System.Int32.ToString
SetDlgItemText Sets the title or text of a control in a dialog box. System.Windows.Forms.Control.Text

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Dynamic-Link Library Functions

Win32 function Description .NET Framework API
GetModuleFileName Retrieves the full path and file name for the file containing the specified module. System.Reflection.Module.FullyQualifiedName
GetModuleHandle Retrieves a module handle for the specified module. System.Runtime.InteropServices.Marshal.GetHINSTANCE
LoadLibrary Maps the specified executable module into the address space of the calling process. Any of the following:
System.Reflection.Assembly.Load
System.Reflection.Assembly.LoadFrom
System.Reflection.Assembly.LoadWithPartialName
LoadLibraryEx Maps the specified executable module into the address space of the calling process. Any of the following:
System.Reflection.Assembly.Load
System.Reflection.Assembly.LoadFrom
System.Reflection.Assembly.LoadWithPartialName

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Error Handling Functions

Win32 function Description .NET Framework API
FatalAppExit Displays a message box and terminates the application when the message box is closed. System.Windows.Forms.MessageBox.Show
System.Diagnostics.Process.Kill
GetLastError Retrieves the calling thread’s last-error code value. System.Runtime.InteropServices.Marshall.GetLastWin32Error

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Event Logging Functions

Win32 function Description .NET Framework API
ClearEventLog Clears the specified event log, and optionally saves the current copy of the log file to a backup file. System.Diagnostics.EventLog.Clear
CloseEventLog Closes a read handle to the specified event log. System.Diagnostics.EventLog.Close
DeregisterEventSource Closes a write handle to the specified event log. System.Diagnostics.EventLog.DeleteEventSource
GetNumberOfEventLogRecords Retrieves the number of records in the specified event log. System.Diagnostics.EventLog.Entries.Count
GetOldestEventLogRecord Retrieves the absolute record number of the oldest record in the specified event log. System.Diagnostics.EventLogEntryCollection[0]
System.Diagnostics.EventLogEntry.TimeWritten
NotifyChangeEventLog Enables an application to receive notification when an event is written to the specified event log file. System.Diagnostics.EventLog.EnableRaisingEvents
OpenBackupEventLog Opens a handle to a backup event log. System.Diagnostics.EventLog constructor
OpenEventLog Opens a handle to an event log. System.Diagnostics.EventLog constructor
ReadEventLog Reads a whole number of entries from the specified event log. System.Diagnostics.EventLogEntryCollection.CopyTo
RegisterEventSource Retrieves a registered handle to an event log. System.Diagnostics.EventLog.CreateEventSource
ReportEvent Writes an entry at the end of the specified event log. System.Diagnostics.EventLog.WriteEntry

Alphabetical Win32 Category List
Hierarchical Win32 Category List

File I/O Functions

Win32 function Description .NET Framework API
CopyFile Copies an existing file to a new file. Either of the following:
System.IO.File.Copy
IO.FileInfo.CopyTo
CreateDirectory Creates a new directory. Any of the following:
System.IO.Directory.CreateDirectory
System.IO.Directory.CreateSubdirectory
System.IO.DirectoryInfo.Create
CreateFile Creates or opens a file object. System.IO.File class and System.IO.FileInfo class
DeleteFile Deletes an existing file. Any of the following:
System.IO.Directory.Delete
System.IO.DirectoryInfo.Delete
System.IO.File.Delete
System.IO.FileInfo.Delete
FileIOCompletionRoutine An application-defined callback function used with ReadFileEx and WriteFileEx. User defined.
FindClose Closes the specified search handle. See FindFirstFile and FindNextFile
FindCloseChangeNotification Stops change notification handle monitoring. System.IO.FileSystemWatcher.EnableRaisingEvents
FindFirstChangeNotification Creates a change notification handle. System.IO.FileSystemWatcher class
FindFirstFile Searches a directory for a file whose name matches the specified file name. Any of the following:
System.IO.Directory.Exists
System.IO.Directory.GetDirectories
System.IO.Directory.GetFileSystemEntries
System.IO.Directory.GetFiles
System.IO.DirectoryInfo.Exists
System.IO.DirectoryInfo.GetDirectories
System.IO.DirectoryInfo.GetFileSystemInfos
System.IO.DirectoryInfo.GetFiles
System.IO.File.Exists
System.IO.FileInfo.Exists
FindFirstFileEx Searches a directory for a file whose name and attributes match the specified file name. Same as FindFirstFile
FindNextChangeNotification Requests that the operating system signal a change notification handle the next time it detects an appropriate change. System.IO.FileSystemWatcher class
FindNextFile Continues a file search. Any of the following:
System.IO.Directory.GetDirectories
System.IO.Directory.GetFileSystemEntries
System.IO.Directory.GetFiles
System.IO.DirectoryInfo.GetDirectories
System.IO.DirectoryInfo.GetFileSystemInfos
System.IO.DirectoryInfo.GetFiles
FlushFileBuffers Clears the buffers for the specified file and causes all buffered data to be written to the file. System.IO.FileStream.Flush
GetBinaryType Determines whether a file is executable. System.IO.FileSystemInfo.Extension

Note   Only manipulates strings; does not do a file-system check.

GetCurrentDirectory Retrieves the current directory for the current process. System.IO.Directory.GetCurrentDirectory
GetDriveType Determines whether a disk drive is a removable, fixed, CD-ROM, RAM disk, or network drive. System.Management.ManagementObject("Win32_LogicalDisk.DeviceID=\"C:\"").Get
System.Management.ManagementObject.Properties
System.IO.DriveInfo.DriveType
GetFileAttributes Retrieves attributes for a specified file or directory. Any of the following:
System.IO.Directory.GetAttributes
System.IO.File.GetAttributes
System.IO.FileSystemInfo.Attributes
GetFileAttributesEx Retrieves attributes for a specified file or directory. Any of the following:
System.IO.Directory.GetAttributes
System.IO.File.GetAttributes
System.IO.FileSystemInfo.Attributes
GetFileInformationByHandle Retrieves file information for a specified file. System.IO.FileInfo properties
GetFileSize Retrieves the size of a specified file. Either of the following:
System.IO.FileInfo.Length
System.IO.FileStream.Length
GetFileSizeEx Retrieves the size of a specified file. Either of the following:
System.IO.FileInfo.Length
System.IO.FileStream.Length
GetFullPathName Retrieves the full path and file name of a specified file. Either of the following:
System.IO.FileSystemInfo.FullName
System.IO.Path.GetFullPath
GetTempFileName Creates a name for a temporary file. System.IO.Path.GetTempFileName
GetTempPath Retrieves the path of the directory designated for temporary files. System.IO.Path.GetTempPath
LockFile Locks a region in an open file. System.IO.FileStream.Lock
LockFileEx Locks a region in an open file for shared or exclusive access. System.IO.FileStream.Lock
MoveFile Moves an existing file or a directory. Any of the following:
System.IO.Directory.Move
System.IO.DirectoryInfo.MoveTo
System.IO.File.Move
System.IO.FileInfo.MoveTo
ReadDirectoryChangesW Retrieves information describing the changes occurring within a directory. System.IO.FileSystemWatcher class
ReadFile Reads data from a file, starting at the specified position. Any of the following:
System.IO.FileStream.BeginRead/EndRead
System.IO.FileStream.Read
System.IO.FileStream.ReadByte
ReadFileEx Reads data from a file asynchronously. System.IO.FileStream.BeginRead/EndRead
RemoveDirectory Deletes an existing empty directory. Either of the following:
System.IO.Directory.Delete
System.IO.DirectoryInfo.Delete
SearchPath Searches for the specified file. Any of the following:
System.IO.Directory.Exists
System.IO.Directory.GetDirectories
System.IO.Directory.GetFileSystemEntries
System.IO.Directory.GetFiles
System.IO.DirectoryInfo.Exists
System.IO.DirectoryInfo.GetDirectories
System.IO.DirectoryInfo.GetFileSystemInfos
System.IO.DirectoryInfo.GetFiles
System.IO.File.Exists
System.IO.FileInfo.Exists
SetCurrentDirectory Changes the current directory for the current process. System.IO.Directory.SetCurrentDirectory
SetEndOfFile Moves the end-of-file position for the specified file. System.IO.FileStream.SetLength
SetFileAttributes Sets the attributes for a file. System.IO.File.SetAttributes
SetFilePointer Moves the file pointer of an open file. Either of the following:
System.IO.FileStream.Position
System.IO.FileStream.Seek
SetFilePointerEx Moves the file pointer of an open file. Either of the following:
System.IO.FileStream.Position
System.IO.FileStream.Seek
UnlockFile Unlocks a previously locked region in an open file. System.IO.FileStream.Unlock
UnlockFileEx Unlocks a previously locked region in an open file. System.IO.FileStream.Unlock
WriteFile Writes data to a file. Any of the following:
System.IO.FileStream.BeginWrite
and EndWrite
System.IO.FileStream.Write
System.IO.FileStream.WriteByte
System.IO.BinaryWriter.Write
WriteFileEx Writes data to a file asynchronously. System.IO.FileStream.BeginWrite and EndWrite

Alphabetical Win32 Category List
Hierarchical Win32 Category List

File System Functions

Used with file systems:

Win32 function Description .NET Framework API
GetDiskFreeSpace Retrieves information about the specified disk, including the amount of free space on the disk. System.Management.ManagementObject("Win32_LogicalDisk.DeviceID=\"C:\"").Get
System.Management.ManagementObject.Properties
GetDiskFreeSpaceEx Retrieves information about the specified disk, including the amount of free space on the disk. System.Management.ManagementObject("Win32_LogicalDisk.DeviceID=\"C:\"").Get
System.Management.ManagementObject.Properties
GetLogicalDriveStrings Fills a buffer with strings that specify valid drives in the system. Either of the following:
System.Environment.GetLogicalDrives
System.IO.Directory.GetLogicalDrives

Used with an encrypted file system:

Win32 function Description .NET Framework API
DecryptFile Decrypts an encrypted file or directory. System.Security.Cryptography.CryptoStream.Read
EncryptFile Encrypts a file or directory. System.Security.Cryptography.CryptoStream.Write
FileEncryptionStatus Retrieves the encryption status of the specified file. System.IO.FileSystemInfo.Attributes

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Filled Shape Functions

Win32 function Description .NET Framework API
Chord Draws an area bounded by an ellipse and a line segment. System.Drawing.Graphics.DrawArc
System.Drawing.Graphics.DrawLine
Ellipse Draws an ellipse. System.Drawing.Graphics.DrawEllipse
System.Drawing.Graphics.FillEllipse
FillRect Fills a rectangle using a brush. System.Drawing.Graphics.FillRectangle
InvertRect Inverts the color values of the pixels in a rectangle. System.Windows.Forms.ControlPaint.DrawReversibleFrame
System.Windows.Forms.ControlPaint.DrawReversibleLine
Pie Draws a pie-shaped wedge bounded by an ellipse and two radials. System.Drawing.Graphics.DrawPie
System.Drawing.Graphics.FillPie
Polygon Draws a polygon. System.Drawing.Graphics.DrawPolygon
System.Drawing.Graphics.FillPolygon
Rectangle Draws a rectangle. System.Drawing.Graphics.DrawRectangle
System.Drawing.Graphics.FillRectangle
RoundRect Draws a rectangle with rounded corners. System.Drawing.Drawing2D.GraphicsPath.AddLines
System.Drawing.Pen.LineJoin = System.Drawing.Pen.LineJoin.Round
System.Drawing.Graphics.DrawPath
System.Drawing.Graphics.FillPath

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Font and Text Functions

Win32 function Description .NET Framework API
AddFontMemResourceEx Adds an embedded font to the system font table. System.Drawing.Text.PrivateFontCollection.AddMemoryFont
AddFontResourceEx Adds a private or non-enumerable font to the system font table. System.Drawing.Text.PrivateFontCollection.AddFontFile
CreateFont Creates a logical font. System.Drawing.Font constructor
DrawText Draws formatted text in a rectangle. System.Drawing.Graphics.DrawString
DrawTextEx Draws formatted text in a rectangle. System.Drawing.Graphics.DrawString
EnumFontFamExProc An application-defined callback function used with EnumFontFamiliesEx to process fonts. System.Drawing.Text.InstalledFontCollection.Families
EnumFontFamiliesEx Enumerates all fonts in the system with certain characteristics. System.Drawing.Text.InstalledFontCollection.Families
ExtTextOut Draws a character string. System.Drawing.Graphics.DrawString
GetCharABCWidths Gets the widths of consecutive characters from the TrueType font. Get a Region[] for the characters:
System.Drawing.Graphics.MeasureCharacterRanges;

Determine the width of each Region:
System.Drawing.Rectangle.Round(Region.GetBounds).Width

GetCharABCWidthsFloat Gets the widths of consecutive characters from the current font. Get a Region[] for the characters:
System.Drawing.Graphics.MeasureCharacterRanges;

Determine the width of each Region:
System.Drawing.Region.GetBounds.Width

GetCharWidth32 Gets the widths of consecutive characters from the current font. Get a Region[] for the characters:
System.Drawing.Graphics.MeasureCharacterRanges;

Determine the width of each Region:
System.Drawing.Rectangle.Round(Region.GetBounds).Width

GetCharWidthFloat Gets the fractional widths of consecutive characters from the current font. Get a Region[] for the characters:
System.Drawing.Graphics.MeasureCharacterRanges;

Determine the width of each Region:
System.Drawing.Region.GetBounds.Width

GetOutlineTextMetrics Gets text metrics for TrueType fonts. System.Drawing.Font properties
GetTabbedTextExtent Computes the width and height of a character string, including tabs. System.Drawing.Graphics.MeasureString
GetTextAlign Gets the text-alignment setting for a device context. System.Drawing.StringFormat.Alignment
System.Drawing.StringFormat.LineAlignment
GetTextColor Gets the text color for a device context. System.Drawing.SolidBrush.Color
GetTextExtentPoint32 Computes the width and height of a string of text. System.Drawing.Graphics.MeasureString
GetTextFace Gets the name of the font that is selected into a device context. System.Drawing.Font.Name
GetTextMetrics Fills a buffer with the metrics for a font. System.Drawing.Font properties
RemoveFontMemResourceEx Removes a font whose source was embedded in a document from the system font table. System.Drawing.Text.PrivateFontCollection.Dispose
RemoveFontResourceEx Removes a private or non-enumerable font from the system font table. System.Drawing.Text.PrivateFontCollection.Dispose
SetTextAlign Sets the text-alignment flags for a device context. System.Drawing.StringFormat.Alignment
System.Drawing.StringFormat.LineAlignment
SetTextColor Sets the text color for a device context. Either of the following:
System.Drawing.Brushes
System.Drawing.SolidBrush.SolidBrush(Color)
TabbedTextOut Writes a character string at a location, expanding tabs to specified values. System.Drawing.Graphics.DrawString using System.Drawing.StringFormat.SetTabStops
TextOut Writes a character string at a location. System.Drawing.Graphics.DrawString

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Icon Functions

Win32 function Description .NET Framework API
CopyIcon Copies an icon from another module. System.Drawing.Icon.FromHandle
CreateIcon Creates an icon with a specified size, color, and bit pattern. System.Drawing.Icon constructor
DestroyIcon Destroys an icon. System.Drawing.Icon.Dispose
DrawIcon Draws an icon. System.Drawing.Graphics.DrawIcon
DuplicateIcon Creates a duplicate of a specified icon. System.Drawing.Icon.Clone
LoadIcon Loads an icon from the executable file associated with an application. System.Drawing.Icon constructor

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Input Method Editor Functions

Win32 function Description .NET Framework API
ImmAssociateContext Associates the specified input context with the specified window. Either of the following:
System.Windows.Forms.Control.DefaultImeMode
System.Windows.Forms.Control.ImeMode
ImmAssociateContextEx Changes the association between the input method context and the specified window or its children. Any of the following:
System.Windows.Forms.Control.DefaultImeMode
System.Windows.Forms.Control.ImeMode
System.Windows.Forms.Control.ResetImeMode
ImmDisableIME Disables the Input Method Editor. System.Windows.Forms.Control.ImeMode = System.Windows.Forms.ImeMode.Disable
ImmGetContext Retrieves the input context associated with the specified window. System.Windows.Forms.Control.ImeMode

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Keyboard Accelerator Functions

Win32 function Description .NET Framework API
TranslateAccelerator Processes accelerator keys for menu commands. System.Windows.Forms.MenuItem.Shortcut

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Keyboard Input Functions

Win32 function Description .NET Framework API
ActivateKeyboardLayout Sets the input locale identifier for the calling thread or the current process. System.Windows.Forms.InputLanguage.CurrentInputLanguage
EnableWindow Enables or disables mouse and keyboard input to the specified window or control. System.Windows.Forms.Control.Enabled
GetActiveWindow Retrieves the window handle to the active window attached to the calling thread’s message queue. System.Windows.Forms.Form.ActiveForm
GetFocus Retrieves the handle to the window that has the keyboard focus. System.Windows.Forms.Control.Controls[].Focused
GetKeyboardLayout Retrieves the active input locale identifier for the specified thread. System.Windows.Forms.InputLanguage.CurrentInputLanguage
GetKeyboardLayoutList Retrieves the input locale identifiers corresponding to the current set of input locales in the system. System.Windows.Forms.InputLanguage.InstalledInputLanguages
GetKeyboardLayoutName Retrieves the name of the active input locale identifier. System.Windows.Forms.InputLanguage.LayoutName
GetKeyNameText Retrieves a string that represents the name of a key. System.Windows.Forms.KeyEventArgs.KeyCode.ToString
IsWindowEnabled Determines whether the specified window is enabled for mouse and keyboard input. System.Windows.Forms.Form.Enabled
SetActiveWindow Activates a window. System.Windows.Forms.Activate
SetFocus Sets the keyboard focus to the specified window. System.Windows.Forms.Form.Focus
ToAscii Translates the specified virtual-key code and keyboard state to the corresponding character or characters. System.Windows.Forms.KeyPressEventArgs.KeyChar
ToUnicode Translates the specified virtual-key code and keyboard state to the corresponding Unicode character or characters. System.Windows.Forms.KeyPressEventArgs.KeyChar

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Line and Curve Functions

Win32 function Description .NET Framework API
AngleArc Draws a line segment and an arc. System.Drawing.Graphics.DrawLine
System.Drawing.Graphics.DrawArc
Arc Draws an elliptical arc. System.Drawing.Graphics.DrawArc
ArcTo Draws an elliptical arc. System.Drawing.Graphics.DrawArc
LineTo Draws a line from the current position up to, but not including, the specified point. System.Drawing.Graphics.DrawLine
PolyBezier Draws one or more B&x00E9;zier curves. System.Drawing.Graphics.DrawBeziers
Polyline Draws a series of line segments by connecting the points in the specified array. System.Drawing.Graphics.DrawLines

Alphabetical Win32 Category List
Hierarchical Win32 Category List

List Box Functions

Win32 function Description .NET Framework API
DlgDirList Replaces the contents of a list box with the names of the subdirectories and files in a specified directory. System.Windows.Forms.ListBox.Items.AddRange(System.IO.Directory.GetFileSystemEntries)
DlgDirSelectEx Retrieves the current selection from a single-selection list box. System.Windows.Forms.ListBox.SelectedItem
GetListBoxInfo Retrieves information about the specified list box. System.Windows.Forms.ListBox properties

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Memory Management Functions

Memory management functions:

Win32 function Description .NET Framework API
GlobalMemoryStatus Obtains information about the system’s current usage of both physical and virtual memory. System.Management.ManagementClass("Win32_OperatingSystem")
System.Management.ManagementClass.GetInstances
System.Management.ManagementObject.Properties
GlobalMemoryStatusEx Obtains information about the system’s current usage of both physical and virtual memory. System.Management.ManagementClass("Win32_OperatingSystem")
System.Management.ManagementClass.GetInstances
System.Management.ManagementObject.Properties

Global and local functions:

Win32 function Description .NET Framework API
GlobalAlloc Allocates the specified number of bytes from the heap. System.Runtime.InteropServices.Marshall.AllocHGlobal
GlobalFree Frees the specified global memory object. System.Runtime.InteropServices.Marshall.FreeHGlobal
GlobalReAlloc Changes the size or attributes of a specified global memory object. System.Runtime.InteropServices.Marshall.ReAllocHGlobal
LocalAlloc Allocates the specified number of bytes from the heap. System.Runtime.InteropServices.Marshall.AllocHGlobal
LocalFree Frees the specified local memory object. System.Runtime.InteropServices.Marshall.FreeHGlobal
LocalReAlloc Changes the size or the attributes of a specified local memory object. System.Runtime.InteropServices.Marshall.ReAllocHGlobal

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Menu Functions

Win32 function Descriptions .NET Framework API
AppendMenu Appends an item to various menus and submenus. System.Windows.Forms.Menu.MenuItemCollection.Add
CheckMenuItem Checks or clears a menu item. System.Windows.Forms.MenuItem.Checked
CheckMenuRadioItem Checks a specified menu item and makes it a radio item. System.Windows.Forms.MenuItem.RadioCheck
CreateMenu Creates a menu. Any of the following:
System.Windows.Forms.ContextMenu
constructor
System.Windows.Forms.MainMenu
constructor
System.Windows.Forms.Menu.MenuItemCollection
constructor
CreatePopupMenu Creates a drop-down menu, submenu, or shortcut menu. Either of the following:
System.Windows.Forms.ContextMenu
constructor
System.Windows.Forms.Menu.MenuItemCollection
constructor
DeleteMenu Deletes a menu item. System.Windows.Forms.Menu.MenuItemCollection.Remove
DestroyMenu Deletes a menu. System.Windows.Forms.Menu.Dispose
EnableMenuItem Enables, disables, or grays a menu item. System.Windows.Forms.MenuItem.Enabled
GetMenu Gets a handle to the menu. System.Windows.Forms.Form.Menu.Handle
GetMenuBarInfo Gets information about a menu bar. System.Windows.Forms.Form.Menu
GetMenuCheckMarkDimensions Returns the dimensions of the default check-mark bitmap. System.Windows.Forms.SystemInformation.MenuCheckSize
GetMenuDefaultItem Gets the default menu item on a menu. System.Windows.Forms.MenuItem.DefaultItem
GetMenuInfo Gets information about a menu. System.Windows.Forms.MenuItem properties
GetMenuItemCount Gets the number of items in a menu. System.Windows.Forms.Menu.MenuItemCollection.Count
GetMenuItemID Gets the identifier of a menu item. System.Windows.Forms.MenuItem.MenuID
GetMenuItemInfo Gets information about a menu item. System.Windows.Forms.MenuItem properties
GetMenuItemRect Gets the bounding rectangle for a menu item. System.Windows.Forms.MenuItem.DrawItem
System.Windows.Forms.DrawItemEventArgs.Bounds
GetMenuState Gets the menu flags associated with a menu item. System.Windows.Forms.MenuItem.Break
System.Windows.Forms.MenuItem.BarBreak
System.Windows.Forms.MenuItem.Checked
System.Windows.Forms.MenuItem.Enabled
System.Windows.Forms.MenuItem.OwnerDraw
GetMenuString Copies the text string of a menu item into a buffer. System.Windows.Forms.MenuItem.Text
GetSubMenu Gets a handle to the drop-down menu or submenu activated by a menu item. System.Windows.Forms.Menu.MenuItems[].Handle
InsertMenu Inserts a new menu item into a menu. System.Windows.Forms.Menu.MenuItemCollection.Add
InsertMenuItem Inserts a new menu item in a menu. System.Windows.Forms.Menu.MenuItemCollection.Add
ModifyMenu Changes an existing menu item. System.Windows.Forms.MenuItem.Break
System.Windows.Forms.MenuItem.BarBreak
System.Windows.Forms.MenuItem.Checked
System.Windows.Forms.MenuItem.Enabled
System.Windows.Forms.MenuItem.OwnerDraw
System.Windows.Forms.MenuItem.Text
RemoveMenu Deletes a menu item or detaches a submenu from a menu. System.Windows.Forms.Menu.MenuItemCollection.Remove
SetMenu Assigns a new menu to a window. System.Windows.Forms.Form.Menu
SetMenuDefaultItem Sets the default menu item for a menu. System.Windows.Forms.MenuItem.DefaultItem
SetMenuInfo Sets information for a menu. System.Windows.Forms.MenuItem properties
SetMenuItemBitmaps Associates a bitmap with a menu item. System.Windows.Forms.MenuItem.DrawItem
SetMenuItemInfo Changes information about a menu item. System.Windows.Forms.MenuItem properties
TrackPopupMenu Displays a shortcut menu at a location and tracks item selection on a menu. System.Windows.Forms.ContextMenu.Show

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Message and Message Queue Functions

Win32 function Description .NET Framework API
GetMessagePos Retrieves the position of the cursor for the last message retrieved by GetMessage. Inside an event handler:
System.Windows.Forms.Windows.Forms.Control.MousePosition
PostQuitMessage Indicates to the system that a thread has made a request to terminate (quit). System.Windows.Forms.Application.ExitThread
SendMessage Sends the specified message to a window or windows. Any of the following:
System.Windows.Forms.Control.DefWndProc
System.Windows.Forms.Control.WndProc
System.Windows.Forms.Form.DefWndProc
System.Windows.Forms.Form.WndProc

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Metafile Functions

Win32 function Description .NET Framework API
CopyEnhMetaFile Copies the contents of an enhanced-format metafile to a specified file. System.Drawing.Imaging.Metafile.Save
CreateEnhMetaFile Creates a device context for an enhanced-format metafile. System.Drawing.Imaging.Metafile constructor
DeleteEnhMetaFile Deletes an enhanced-format metafile or an enhanced-format metafile handle. System.Drawing.Imaging.Metafile.Dispose
EnhMetaFileProc An application-defined callback function used with EnumEnhMetaFile. System.Drawing.Graphics.EnumerateMetafileProc
EnumEnhMetaFile Enumerates the records within an enhanced-format metafile. System.Drawing.Graphics.EnumerateMetafile
GdiComment Copies a comment from a buffer into a specified enhanced-format metafile. System.Drawing.Graphics.AddMetafileComment
GetEnhMetaFile Creates a handle that identifies the enhanced-format metafile stored in the specified file. System.Drawing.Imaging.Metafile constructor
GetEnhMetaFileBits Retrieves the contents of the specified enhanced-format metafile and copies it into a buffer. System.Drawing.Imaging.Metafile.Save
GetEnhMetaFileHeader Retrieves the record containing the header for the specified enhanced-format metafile. System.Drawing.Imaging.Metafile.GetMetafileHeader
GetEnhMetaFilePaletteEntries Retrieves optional palette entries from the specified enhanced metafile. System.Drawing.Imaging.Metafile.Palette.Entries
GetWinMetaFileBits Converts the enhanced-format records from a metafile into Windows-format records. System.Drawing.Imaging.Metafile.Save
PlayEnhMetaFile Displays the picture stored in the specified enhanced-format metafile. System.Drawing.Graphics.DrawImage
PlayEnhMetaFileRecord Plays an enhanced-metafile record by executing the graphics device interface functions identified by the record. System.Drawing.Imaging.Metafile.PlayRecord
System.Drawing.Imaging.PlayRecordCallback
SetEnhMetaFileBits Creates a memory-based enhanced-format metafile from the specified data. System.Drawing.Imaging.Metafile.Save
SetWinMetaFileBits Converts a metafile from the older Windows format to the new enhanced format. System.Drawing.Imaging.Metafile.Save

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Mouse Input Functions

Win32 function Description .NET Framework API
GetDoubleClickTime Gets the double-click time for the mouse. System.Windows.Forms.SystemInformation.DoubleClickTime
mouse_event Synthesizes mouse motion and button clicks. System.Windows.Forms.MouseEventArgs
ReleaseCapture Releases the mouse capture and restores mouse input processing. System.Windows.Forms.Control.Capture
SetCapture Sets the mouse capture to a window. System.Windows.Forms.Control.Capture
TrackMouseEvent
–or–
_TrackMouseEvent
Posts messages when a mouse leaves a window or hovers over a window. System.Windows.Forms.Control.OnMouseLeave
System.Windows.Forms.Control.OnMouseHover

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Multiple Display Monitor Functions

Win32 function Description .NET Framework API
GetMonitorInfo Retrieves information about a display monitor. System.Windows.Forms.Screen.Bounds
System.Windows.Forms.Screen.Primary
System.Windows.Forms.Screen.WorkingArea
MonitorFromPoint Retrieves a handle to the display monitor that contains a specified point. System.Windows.Forms.Screen.FromPoint
MonitorFromRect Retrieves a handle to the display monitor that has the largest area of intersection with a specified rectangle. System.Windows.Forms.Screen.FromRectangle
MonitorFromWindow Retrieves a handle to the display monitor that has the largest area of intersection with the bounding rectangle of a specified window. System.Windows.Forms.Screen.FromHandle

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Multiple-Document Interface Functions

Win32 function Description .NET Framework API
CreateMDIWindow Creates a multiple-document interface (MDI) child window. System.Windows.Forms.Form constructor
System.Windows.Forms.Form.AutoScroll
System.Windows.Forms.Form.DesktopBounds
System.Windows.Forms.Form.MdiParent
System.Windows.Forms.Form.WindowState
TranslateMDISysAccel Processes accelerator keystrokes for window menu commands of the MDI child windows associated with the specified MDI client window. Keyboard events for MDI children are automatically translated.

Alphabetical Win32 Category List
Hierarchical Win32 Category List

National Language Functions

Win32 function Description .NET Framework API
ConvertDefaultLocale Converts a default locale value to an actual locale identifier. System.Globalization.CultureInfo.CurrentCulture
System.Globalization.CultureInfo.InstalledUICulture
EnumCalendarInfo Enumerates calendar information for a specified locale. Access the System.Globalization.CultureInfo.DateTimeFormat property to get a System.Globalization.DateTimeFormatInfo object, and then access its properties:
System.Globalization.DateTimeFormatInfo.AbbreviatedDayNames
System.Globalization.DateTimeFormatInfo.AbbreviatedMonthNames
System.Globalization.DateTimeFormatInfo.DayNames
System.Globalization.DateTimeFormatInfo.LongDatePattern
System.Globalization.DateTimeFormatInfo.MonthNames
System.Globalization.DateTimeFormatInfo.ShortDatePattern
EnumCalendarInfoEx Enumerates calendar information for a specified locale. Iterate through the calendars:
System.Globalization.CultureInfo.DateTimeFormat.Calendar = System.Globalization.CultureInfo.OptionalCalendars[i]
EnumCalendarInfoProc An application-defined function used with EnumCalendarInfo. Same as EnumCalendarInfo
EnumCalendarInfoProcEx An application-defined function used with EnumCalendarInfoEx. Same as EnumCalendarInfoEx
EnumCodePagesProc An application-defined function used with EnumSystemCodePages. Same as EnumSystemCodePages
EnumDateFormats Enumerates the long or short date formats that are available for a specified locale. System.DateTime.GetDateTimeFormats(System.Globalization.CultureInfo)
EnumDateFormatsEx Enumerates the long or short date formats that are available for a specified locale, including date formats for any alternate calendars. Iterate through the calendars:
System.Globalization.CultureInfo.DateTimeFormat.Calendar = System.Globalization.CultureInfo.OptionalCalendars[i];
System.DateTime.GetDateTimeFormats(System.Globalization.CultureInfo)
EnumDateFormatsProc An application-defined function used with EnumDateFormats. Same as EnumDateFormats
EnumDateFormatsProcEx An application-defined function used with EnumDateFormatsEx. Same as EnumDateFormatsEx
EnumGeoInfoProc A callback function used with EnumSystemGeoID. Same as EnumSystemGeoID
EnumLocalesProc An application-defined function used with EnumSystemLocales. Same as EnumSystemLocales
EnumSystemCodePages Enumerates the code pages that are either installed on or supported by a system. System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.AllCultures) returns an array of CultureInfo

The various code page properties of System.Globalization.CultureInfo.TextInfo

EnumSystemGeoID Enumerates all GeoIDs on the system. Retrieve an array of CultureInfo by calling System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.AllCultures), and then access the following CultureInfo properties:
System.Globalization.CultureInfo.ThreeLetterISOLanguageName
System.Globalization.CultureInfo.ThreeLetterWindowsLanguageName
System.Globalization.CultureInfo.TwoLetterISOLanguageName
EnumSystemLocales Enumerates the locales that are either installed on or supported by a system. System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.SpecificCultures)
System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.InstalledWin32Cultures)
EnumTimeFormats Enumerates the time formats that are available for a specified locale. System.DateTime.GetDateTimeFormats
EnumTimeFormatsProc An application-defined function used with EnumTimeFormats. Same as EnumTimeFormats
GetACP Retrieves the current ANSI code-page identifier for the system. System.Globalization.CultureInfo.InstalledUICulture.TextInfo.ANSICodePage
GetCalendarInfo Retrieves information about a calendar. System.Globalization.CultureInfo.DateTimeFormat
GetCurrencyFormat Formats a number string as a currency string for a specified locale. Create a System.Globalization.CultureInfo object using the constructor, specifying either the culture name or identifier (or use the current culture of the application available on System.Threading.Thread.CurrentCulture);
call System.Convert.ToDouble(str) where str is the numeric string you want to format;
and then call System.Double.ToString("C", ci) (or System.Double.ToString("C") to use the current culture), where C is the standard currency format specifier and ci is the CultureInfo object you created

Note    For more information on the variety of formatting options available in the .NET Framework, see System.String.Format.

GetDateFormat Formats a date as a date string for a specified locale. System.DateTime(, CultureInfo(LCID).Calendar).ToString
GetLocaleInfo Retrieves information about a locale. System.Globalization.CultureInfo.DateTimeFormat
System.Globalization.CultureInfo.NumberFormat
System.Globalization.CultureInfo.TextInfo
GetNumberFormat Formats a number string as a number string customized for a specified locale. Create a System.Globalization.CultureInfo object using the constructor, specifying either the culture name or identifier (or use the current culture of the application available on System.Threading.Thread.CurrentCulture);
call System.Convert.ToDouble(str). where str is the numeric string you want to format;
and then call System.Double.ToString("N", ci) (or System.Double.ToString("N") to use the current culture), where N is the standard number format specifier and ci is the CultureInfo object you created

Note    For more information on the variety of formatting options available in the .NET Framework, see System.String.Format.

GetOEMCP Retrieves the current original equipment manufacturer (OEM) code-page identifier for the system. System.Globalization.CultureInfo.InstalledUICulture.TextInfo.OEMCodePage
GetSystemDefaultLangID Retrieves the language identifier of the system locale. System.Globalization.CultureInfo.InstalledUICulture
GetSystemDefaultLCID Retrieves the system default locale identifier. System.Globalization.CultureInfo.InstalledUICulture
GetSystemDefaultUILanguage Retrieves the language identifier for the default language of the system. System.Globalization.CultureInfo.InstalledUICulture
GetThreadLocale Retrieves the current locale for the calling thread. Either of the following:
System.Globalization.CultureInfo.CurrentCulture
System.Threading.Thread.CurrentCulture
GetTimeFormat Formats time as a time string for a specified locale. System.DateTime(, CultureInfo(LCID).Calendar).ToString
GetUserDefaultLangID Retrieves the language identifier of the current user locale. System.Globalization.CultureInfo.CurrentCulture
GetUserDefaultLCID Retrieves the user default–locale identifier. System.Globalization.CultureInfo.CurrentCulture
GetUserDefaultUILanguage Retrieves the language identifier for the current user language. System.Globalization.CultureInfo.CurrentUICulture
GetUserGeoID Gets information about the user’s location. System.Globalization.RegionInfo
IsValidCodePage Determines whether a specified code page is valid. Use an array of CultureInfo objects returned by:
System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.AllCultures)

Compare to the code page properties of System.Globalization.CultureInfo.TextInfo

IsValidLocale Determines whether a specified locale identifier is valid. try{ System.Globalization.CultureInfo(LCID) }
LCMapString Maps one character string to another, performing a specified locale-dependent transformation. System.Globalization.SortKey
SetCalendarInfo Sets an item of locale information for a calendar. System.Globalization.CultureInfo.DateTimeFormat
SetLocaleInfo Sets an item of locale information. System.Globalization.CultureInfo.DateTimeFormat
System.Globalization.CultureInfo.NumberFormat
SetThreadLocale Sets the current locale for the calling thread. System.Threading.Thread.CurrentCulture

Note   Sets langid only.

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Painting and Drawing Functions

Win32 function Description .NET Framework API
BeginPaint Prepares a window for painting. System.Windows.Forms.Form.OnPaint
DrawFrameControl Draws a frame control. System.Window.Forms.ControlPaint
GetBkColor Returns the background color for a device context. System.Windows.Forms.Form.BackColor
GetBkMode Returns the background mix mode for a device context. System.Windows.Forms.Form.GetStyle(ControlStyles.Opaque)
GetUpdateRect Gets the coordinates of the smallest rectangle that encloses the update region of a window. System.Windows.Forms.PaintEventArgs.ClipRectangle
GetWindowDC Gets the device context for a window, including title bar, menus, and scroll bars. Any of the following:
System.Drawing.Graphics.FromHwnd(Windows.Forms.Control.Handle)
System.Windows.Forms.Control.CreateGraphics.GetHdc
System.Windows.Forms.PaintEventArgs.Graphics.GetHdc
GetWindowRgn Gets a copy of the window region of a window. System.Windows.Forms.Control.Region
GrayString Draws gray text at a location. System.Drawing.Graphics.DrawString(, Drawing.Brushes.Gray, )
InvalidateRect Adds a rectangle to the update region of a window. System.Windows.Forms.Control.Invalidate
InvalidateRgn Invalidates the client area within a region. System.Windows.Forms.Control.Invalidate(System.Windows.Forms.Form.ClientRectangle)
RedrawWindow Updates a region in the client area of a window. System.Windows.Forms.Control.Update
SetBkColor Sets the background to a color value. System.Windows.Forms.Form.BackColor
SetBkMode Sets the background mix mode of a device context. System.Windows.Forms.Form.SetStyle(System.Windows.Forms.ControlStyles.Opaque, System.Boolean)
SetWindowRgn Sets the window region of a window. System.Windows.Forms.Control.Region
UpdateWindow Updates the client area of a window. System.Windows.Forms.Control.Update

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Path Functions

Win32 function Description .NET Framework API
CloseFigure Closes an open figure in a path. System.Drawing.Drawing2D.GraphicsPath.CloseFigure
FillPath Closes any open figures in the current path and fills the interior of the path by using the current brush and polygon-filling mode. System.Drawing.Graphics.FillPath
System.Drawing.Drawing2D.GraphicsPath.CloseFigures
FlattenPath Transforms any curves in the path that is selected into the current device context, turning each curve into a sequence of lines. System.Drawing.Drawing2D.GraphicsPath.Flatten
GetMiterLimit Retrieves the miter limit for the specified device context. System.Drawing.Pen.MiterLimit
GetPath Retrieves the coordinates defining the endpoints of lines and the control points of curves found in the path that is selected into the specified device context. System.Drawing.Drawing2D.GraphicsPath.PathData
PathToRegion Creates a region from the path that is selected into the specified device context. System.Drawing.Region.Region(System.Drawing.Drawing2D.GraphicsPath)
SetMiterLimit Sets the limit for the length of miter joins for the specified device context. System.Drawing.Pen.MiterLimit
StrokeAndFillPath Closes any open figures in a path, strokes the outline of the path by using the current pen, and fills its interior by using the current brush. System.Drawing.Graphics.DrawPath
System.Drawing.Graphics.FillPath
System.Drawing.Drawing2D.GraphicsPath.CloseFigures
StrokePath Renders the specified path by using the current pen. System.Drawing.Graphics.DrawPath
WidenPath Redefines the current path as the area that would be painted if the path were stroked using the pen currently selected into the given device context. System.Drawing.Drawing2D.GraphicsPath.Widen

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Pen Functions

Win32 function Description .NET Framework API
CreatePen Creates a logical pen that has the specified style, width, and color. System.Drawing.Pen constructor
ExtCreatePen Creates a logical cosmetic or geometric pen that has the specified style, width, and brush attributes. System.Drawing.Pen constructor

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Performance Monitoring Functions

Win32 function Description .NET Framework API
PdhAddCounter Initializes a counter structure for the specified counter in the specified query. System.Diagnostics.PerformanceCounter constructor
PdhCalculateCounterFromRawValue Computes the current value of a counter using the raw counter data passed in the parameter list. System.Diagnostics.CounterSample.Calculate
PdhCloseLog Closes the specified log file. System.Diagnostics.EventLog.Close
PdhCloseQuery Closes all counters contained in the specified query, closes all handles related to the query, and frees all memory associated with the query. System.Diagnostics.PerformanceCounterCategory.Delete
PdhCollectQueryData Collects the current raw data value for all counters in the specified query and updates the status code of each counter. System.Diagnostics.PerformanceCounterCategory.ReadCategory
PdhEnumObjectItems Returns the available counters and instances provided by the specified object on the specified computer. System.Diagnostics.PerformanceCounterCategory.GetCounters
System.Diagnostics.PerformanceCounterCategory.GetInstanceNames
PdhEnumObjects Returns a list of objects available on the specified computer. System.Diagnostics.PerformanceCounterCategory.GetCategories
PdhFormatFromRawValue Converts one raw performance data value to the specified format or two raw performance data values if the format conversion is time-based. System.Diagnostics.CounterSample.Calculate
PdhGetCounterInfo Retrieves information about a counter, such as data size, counter type, path, and user-supplied data values. System.Diagnostics.PerformanceCounter properties
PdhGetCounterTimeBase Returns the time base of the specified counter. System.Diagnostics.CounterSample.CounterFrequency
PdhGetFormattedCounterValue Returns the current value of a specified counter in the format requested by the caller. System.Diagnostics.PerformanceCounter.NextValue
PdhGetRawCounterArray Returns an array of raw values from the specified counter. System.Diagnostics.PerformanceCounterCategory.ReadCategory
PdhGetRawCounterValue Returns the current raw value of the counter. System.Diagnostics.PerformanceCounter.NextSample

Note   System.Diagnostics.InstanceData holds the raw data.

PdhMakeCounterPath Creates a full counter path using the members specified in the structure passed in the parameter list. All of the following:

System.Diagnostics.PerformanceCounter.MachineName
System.Diagnostics.PerformanceCounter.CategoryName
System.Diagnostics.PerformanceCounter.InstanceName
System.Diagnostics.PerformanceCounter.CounterName

PdhOpenLog Opens the specified log file. System.Diagnotics.EventLog constructor

Note   Must explicitly handle writing to the log file.

PdhOpenQuery Creates and initializes a unique query structure that is used to manage the collection of performance data. System.Diagnostics.PerformanceCounterCategory constructor
PdhValidatePath Validates that the specified counter is present on the computer that is specified in the counter path. Either of the following:
System.Diagnostics.PerformanceCounterCategory.Exists
System.Diagnostics.PerformanceCounterCategory.InstanceExists

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Printing Functions

Functions used to print:

Win32 function Description .NET Framework API
AbortDoc Stops the current print job and erases everything drawn since the last call to StartDoc. System.Drawing.Printing.PrintPageEventArgs.Cancel
DeviceCapabilities Retrieves the capabilities of a printer device driver. System.Drawing.Printing.PrinterSettings.PrinterName
System.Drawing.Printing.PrinterSettings
properties
EndDoc Ends a print job. Either of the following:
System.Drawing.Printing.PrintDocument.OnEndPrint
System.Drawing.Printing.PrintController.OnEndPrint
EndPage Notifies the device that the application has finished writing to a page. System.Drawing.Printing.PrintController.OnEndPage
StartDoc Starts a print job. System.Drawing.Printing.PrintDocument.Print
System.Drawing.Printing.PrintDocument.OnBeginPrint
System.Drawing.Printing.PrintController.OnStartPrint
StartPage Prepares the printer driver to accept data. System.Drawing.Printing.PrintDocument.OnQueryPageSettings
System.Drawing.Printing.PrintController.OnStartPage
System.Drawing.Printing.PrintDocument.OnPrintPage

Functions used to access the print spooler:

Win32 function Description .NET Framework API
DocumentProperties Retrieves or modifies printer initialization information or displays a printer-configuration property sheet for the specified printer. System.Windows.Forms.PageSetupDialog
System.Windows.Forms.PrintDialog
EndPagePrinter Notifies the print spooler that the application is at the end of a page in a print job. System.Drawing.Printing.PrintPageEventArgs.HasMorePages
EnumForms Enumerates the forms supported by the specified printer. System.Drawing.Printing.PrinterSettings.PaperSizes
EnumPrinters Enumerates available printers, print servers, domains, or print providers. System.Drawing.Printing.PrinterSettings.InstalledPrinters
GetDefaultPrinter Retrieves the printer name of the default printer for the current user on the local computer. System.Drawing.Printing.PrinterSettings constructor
System.Drawing.Printing.PrinterSettings.PrinterName
GetForm Retrieves information about a specified form. System.Drawing.Printing.PrinterSettings.PaperSizes[]
GetPrinter Retrieves information about a specified printer. System.Drawing.Printing.PrinterSettings.PrinterName
System.Drawing.Printing.PrinterSettings
properties
PrinterProperties Displays a printer-properties property sheet for the specified printer. System.Windows.Forms.PageSetupDialog
System.Windows.Forms.PrintDialog
SetPrinter Sets the data for a specified printer or sets the state of the specified printer by pausing printing, resuming printing, or clearing all print jobs. System.Drawing.Printing.PrinterSettings.PrinterName
System.Drawing.Printing.PrinterSettings
properties

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Process and Thread Functions

Functions used with processes:

Win32 function Description .NET Framework API
CreateProcess Creates a new process and its primary thread. System.Diagnostics.Process constructor
System.Diagnostics.Process.Start
ExitProcess Ends a process and all its threads. System.Diagnostics.Process.CloseMainWindow
GetCommandLine Retrieves the command-line string for the current process. Either of the following:
System.Environment.CommandLine
System.Diagnostics.ProcessStartInfo.Arguments
GetCurrentProcess Retrieves a pseudo handle for the current process. System.Diagnostics.Process.Handle
GetCurrentProcessId Retrieves the process identifier of the calling process. System.Diagnostics.Process.Id
GetEnvironmentStrings Retrieves the environment block for the current process. System.Diagnostics.ProcessStartInfo.EnvironmentVariables
GetEnvironmentVariable Retrieves the value of the specified variable from the environment block of the calling process. System.Diagnostics.ProcessStartInfo.EnvironmentVariables[]
GetExitCodeProcess Retrieves the termination status of the specified process. System.Diagnostics.Process.ExitCode
GetPriorityClass Retrieves the priority class for the specified process. System.Diagnostics.Process.PriorityClass
GetProcessAffinityMask Retrieves a process affinity mask for the specified process and the system affinity mask for the system. System.Diagnostics.Process.ProcessorAffinity
GetProcessPriorityBoost Retrieves the priority boost control state of the specified process. System.Diagnostics.Process.PriorityBoostEnabled
GetProcessTimes Retrieves timing information for the specified process. System.Diagnostics.Process.ExitTime
System.Diagnostics.Process.PrivilegedProcessorTime
System.Diagnostics.Process.StartTime
System.Diagnostics.Process.TotalProcessorTime
System.Diagnostics.Process.UserProcessorTime
GetProcessWorkingSetSize Retrieves the minimum and maximum working set sizes of the specified process. System.Diagnostics.Process.MinWorkingSet
System.Diagnostics.Process.MaxWorkingSet
GetStartupInfo Retrieves the contents of the STARTUPINFO structure that was specified when the calling process was created. System.Diagnostics.Process.StandardError
System.Diagnostics.Process.StandardInput
System.Diagnostics.Process.StandardOutput
System.Diagnostics.Process.StartInfo.WindowStyle
OpenProcess Opens an existing process object. System.Diagnostics.Process.GetProcessById
SetEnvironmentVariable Sets the value of an environment variable for the current process. System.Diagnostics.ProcessStartInfo.EnvironmentVariables[]
SetPriorityClass Sets the priority class for the specified process. System.Diagnostics.Process.PriorityClass
SetProcessAffinityMask Sets a processor affinity mask for the threads of a specified process. System.Diagnostics.Process.ProcessorAffinity
SetProcessPriorityBoost Disables the ability of the system to temporarily boost the priority of the threads of the specified process. System.Diagnostics.Process.PriorityBoostEnabled
SetProcessWorkingSetSize Sets the minimum and maximum working set sizes for the specified process. System.Diagnostics.Process.MaxWorkingSet
System.Diagnostics.Process.MinWorkingSet
TerminateProcess Terminates the specified process and all of its threads. System.Diagnostics.Process.Kill

Functions used with threads:

Win32 function Description .NET Framework API
CreateThread Creates a thread to execute within the virtual address space of the calling process. System.Threading.Thread constructor
System.Threading.Thread.Start
GetCurrentThread Retrieves a pseudo handle for the current thread. System.Threading.Thread.CurrentThread
GetCurrentThreadId Retrieves the thread identifier of the calling thread. Either of the following:
System.AppDomain.GetCurrentThreadId
System.Diagnostics.ProcessThread.Id
GetThreadPriority Retrieves the priority value for the specified thread. Either of the following:
System.Diagnostics.ProcessThread.PriorityLevel
System.Threading.Thread.Priority
GetThreadPriorityBoost Retrieves the priority boost control state of the specified thread. System.Diagnostics.ProcessThread.PriorityBoostEnabled
GetThreadTimes Retrieves timing information for the specified thread. System.Diagnostics.ProcessThread.PrivilegedProcessorTime
System.Diagnostics.ProcessThread.StartTime
System.Diagnostics.ProcessThread.TotalProcessorTime
System.Diagnostics.ProcessThread.UserProcessorTime
ResumeThread Decrements the suspend count for a thread. System.Threading.Thread.Resume
SetThreadAffinityMask Sets a processor affinity mask for the specified thread. System.Diagnostics.ProcessThread.ProcessorAffinity
SetThreadIdealProcessor Specifies a preferred processor for a thread. System.Diagnostics.ProcessThread.IdealProcessor
SetThreadPriority Sets the priority value for the specified thread. Either of the following:
System.Diagnostics.ProcessThread.PriorityLevel
System.Threading.Thread.Priority
SetThreadPriorityBoost Enables or disables the ability of the system to temporarily boost the priority of a thread. System.Diagnostics.ProcessThread.PriorityBoostEnabled
Sleep Suspends the execution of the current thread for a specified interval. System.Threading.Thread.Sleep
SuspendThread Suspends the specified thread. System.Threading.Thread.Suspend
SwitchToThread Causes the calling thread to yield execution to another thread that is ready to run on the current processor. System.Threading.Thread.Sleep(0)
TerminateThread Terminates a thread. System.Threading.Thread.Abort
ThreadProc An application-defined function that serves as the starting address for a thread. See System.Threading.ThreadStart delegate
TlsAlloc Allocates a thread local storage (TLS) index. System.Threading.Thread.AllocateNamedDataSlot
TlsFree Releases a TLS index. System.Threading.Thread.FreeNamedDataSlot
TlsGetValue Retrieves the value in the calling thread’s TLS slot for a specified TLS index. System.Threading.Thread.GetData
TlsSetValue Stores a value in the calling thread’s TLS slot for a specified TLS index. System.Threading.Thread.SetData
WaitForInputIdle Waits until the specified process is waiting for user input with no input pending or until the time-out interval has elapsed. System.Diagnostics.Process.WaitForInputIdle

Functions used in thread pooling:

Win32 function Description .NET Framework API
BindIoCompletionCallback Binds the specified file handle to the I/O completion port for the thread pool. System.Threading.ThreadPool.BindHandle
QueueUserWorkItem Queues a work item to a worker thread in the thread pool. System.Threading.ThreadPool.QueueUserWorkItem
System.Threading.ThreadPool.UnsafeQueueUserWorkItem

Alphabetical Win32 Category List
Hierarchical Win32 Category List

PSAPI Functions

Win32 function Description .NET Framework API
EnumProcesses Retrieves the process identifier for each process object in the system. System.Diagnostics.Process.GetProcesses
EnumProcessModules Retrieves a handle for each module in the specified process. System.Diagnostics.Process.Modules
GetModuleBaseName Retrieves the base name for the specified module. System.Diagnostics.ProcessModule.ModuleName
GetModuleFileNameEx Retrieves the fully qualified path for the specified module. Either of the following:
System.Diagnostics.ProcessModule.FileName
System.Reflection.Module.FullyQualifiedName
GetModuleInformation Retrieves information about the specified module. System.Diagnostics.ProcessModule
GetProcessMemoryInfo Retrieves information about the memory usage of the specified process. System.Diagnostics.Process.PagedMemorySize
System.Diagnostics.Process.PeakPagedMemorySize
System.Diagnostics.Process.PeakWorkingSet
System.Diagnostics.Process.WorkingSet

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Rectangle Functions

Win32 function Description .NET Framework API
EqualRect Determines whether the two specified rectangles are equal by comparing the coordinates of their upper-left and lower-right corners. System.Drawing.Rectangle.Equals
InflateRect Increases or decreases the width and height of the specified rectangle. System.Drawing.Rectangle.Inflate
IntersectRect Calculates the intersection of two source rectangles and places the coordinates of the intersection rectangle into the destination rectangle. System.Drawing.Rectangle.Intersect
IsRectEmpty Determines whether the specified rectangle is empty. System.Drawing.Rectangle.IsEmpty
OffsetRect Moves the specified rectangle by the specified offsets. System.Drawing.Rectangle.Offset
PtInRect Determines whether the specified point lies within the specified rectangle. System.Drawing.Rectangle.Contains
SetRect Sets the coordinates of the specified rectangle. System.Drawing.Rectangle.FromLTRB
SetRectEmpty Creates an empty rectangle in which all coordinates are set to zero. System.Drawing.Rectangle.FromLTRB
UnionRect Creates the union of two rectangles. System.Drawing.Rectangle.Union

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Region Functions

Win32 function Description .NET Framework API
CombineRgn Combines two regions and stores the result in a third region. System.Drawing.Region.Clone
System.Drawing.Region.Exclude
System.Drawing.Region.Intersect
System.Drawing.Region.Union
System.Drawing.Region.Xor
CreateEllipticRgn Creates an elliptical region. System.Drawing.Drawing2D.GraphicsPath constructor
System.Drawing.Drawing2D.GraphicsPath.AddEllipse
System.Drawing.Region.Region(System.Drawing.Drawing2D.GraphicsPath)
CreateEllipticRgnIndirect Creates an elliptical region. System.Drawing.Drawing2D.GraphicsPath constructor
System.Drawing.Drawing2D.GraphicsPath.AddEllipse
System.Drawing.Region.Region(System.Drawing.Drawing2D.GraphicsPath)
CreatePolygonRgn Creates a polygonal region. System.Drawing.Drawing2D.GraphicsPath constructor
System.Drawing.Drawing2D.GraphicsPath.AddPolygon
System.Drawing.Region.Region(System.Drawing.Drawing2D.GraphicsPath)
CreatePolyPolygonRgn Creates a region consisting of a series of polygons. System.Drawing.Drawing2D.GraphicsPath constructor
System.Drawing.Drawing2D.GraphicsPath.AddPolygon
System.Drawing.Region.Region(System.Drawing.Drawing2D.GraphicsPath)
CreateRectRgnIndirect Creates a rectangular region. System.Drawing.Region.Region(System.Drawing.Rectangle)
CreateRoundRectRgn Creates a rectangular region with rounded corners. System.Drawing.Drawing2D.GraphicsPath.AddLines
System.Drawing.Pen.LineJoin = System.Drawing.Drawing2D.LineJoin.Round
EqualRgn Checks the two specified regions to determine whether they are identical. System.Drawing.Region.Equals
ExtCreateRegion Creates a region from the specified region and transformation data. System.Drawing.Region.Transform
FillRgn Fills a region by using the specified brush. System.Drawing.Graphics.FillRegion
GetPolyFillMode Retrieves the current polygon fill mode. System.Drawing.Drawing2D.GraphicsPath.FillMode
GetRegionData Fills the specified buffer with data describing a region. System.Drawing.Region.GetRegionData
GetRgnBox Retrieves the bounding rectangle of the specified region. System.Drawing.Region.GetBounds
OffsetRgn Moves a region by the specified offsets. System.Drawing.Region.Translate
PtInRegion Determines whether the specified point is inside the specified region. System.Drawing.Region.IsVisible
RectInRegion Determines whether any part of the specified rectangle is within the boundaries of a region. System.Drawing.Region.IsVisible
SetPolyFillMode Sets the polygon fill mode for functions that fill polygons. System.Drawing.Drawing2D.GraphicsPath.FillMode

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Registry Functions

Win32 function Description .NET Framework API
RegCloseKey Releases a handle to the specified registry key. Microsoft.Win32.RegistryKey.Close
RegConnectRegistry Establishes a connection to a predefined registry handle on another computer. Microsoft.Win32.RegistryKey.OpenRemoteBaseKey
RegCreateKeyEx Creates the specified registry key. Microsoft.Win32.RegistryKey.CreateSubKey
RegDeleteKey Deletes a subkey. Microsoft.Win32.RegistryKey.DeleteSubKeyTree
RegDeleteValue Removes a named value from the specified registry key. Microsoft.Win32.RegistryKey.DeleteValue
RegEnumKeyEx Enumerates subkeys of the specified open registry key. Microsoft.Win32.RegistryKey.GetSubKeyNames
RegEnumValue Enumerates the values for the specified open registry key. Microsoft.Win32.RegistryKey.GetValueNames
Microsoft.Win32.RegistryKey.GetValue
RegFlushKey Writes all the attributes of the specified open registry key into the registry. Microsoft.Win32.RegistryKey.Flush
RegOpenCurrentUser Retrieves a handle to the HKEY_CURRENT_USER key for the user that the current thread is impersonating. Microsoft.Win32.Registry.CurrentUser
RegOpenKeyEx Opens the specified registry key. Microsoft.Win32.RegistryKey.OpenSubKey
RegOpenUserClassesRoot Retrieves a handle to the HKEY_CLASSES_ROOT key for the specified user. Microsoft.Win32.Registry.ClassesRoot
RegQueryInfoKey Retrieves information about the specified registry key. Microsoft.Win32.RegistryKey.SubKeyCount
Microsoft.Win32.RegistryKey.ValueCount
RegQueryValueEx Retrieves the type and data for a specified value name associated with an open registry key. Microsoft.Win32.RegistryKey.GetValue
RegSetValueEx Sets the data and type of a specified value under a registry key. Microsoft.Win32.RegistryKey.SetValue

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Resource Functions

Win32 function Description .NET Framework API
CopyImage Creates a new icon, cursor, or bitmap and copies the attributes of the old one to the new one. System.Drawing.Image.Clone
EnumResNameProc An application-defined callback function used with EnumResourceNames. System.Resources.ResourceReader.GetEnumerator
EnumResourceNames Searches for resources of a specified type and passes the name or the ID to a callback function. System.Resources.ResourceReader.GetEnumerator
LoadImage Loads an icon, cursor, or bitmap. System.Drawing.Bitmap.Bitmap(System.Type, System.String)
System.Drawing.Icon.Icon(System.Type, System.String)
System.Windows.Forms.Cursor.Cursor(System.Type, System.String)
System.Resources.ResourceManager.GetObject
System.Resources.ResourceSet.GetObject

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Rich Edit Control Functions

Win32 Funtion Description .NET Framework API
EditStreamCallback An application-defined callback function used with the EM_STREAMIN and EM_STREAMOUT messages. System.Windows.Forms.RichTextBox.LoadFile
System.Windows.Forms.RichTextBox.RichTextBox.SaveFile

Note   Not a callback function.

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Scroll Bar Functions

Win32 function Description .NET Framework API
EnableScrollBar Enables or disables one or both scroll bar arrows. System.Windows.Forms.ScrollBar.Enabled

Note   Cannot enable/disable built-in scrollbars (auto-scrolling).

GetScrollBarInfo Retrieves information about the specified scroll bar. System.Windows.Forms.ScrollBar.Value
System.Windows.Forms.ScrollEventArgs.Type
GetScrollInfo Retrieves the parameters of a scroll bar. System.Windows.Forms.ScrollBar.Maximum
System.Windows.Forms.ScrollBar.Minimum
System.Windows.Forms.ScrollBar.Value
GetScrollPos Retrieves the current position of the scroll box. System.Windows.Forms.ScrollBar.Value
GetScrollRange Retrieves the current minimum and maximum scroll box positions. System.Windows.Forms.ScrollBar.Minimum
System.Windows.Forms.ScrollBar.Maximum
SetScrollInfo Sets the parameters of a scroll bar. System.Windows.Forms.ScrollBar.Maximum
System.Windows.Forms.ScrollBar.Minimum
System.Windows.Forms.ScrollBar.Value
SetScrollPos Sets the position of the scroll box. System.Windows.Forms.ScrollBar.Value
SetScrollRange Sets the minimum and maximum scroll box position. System.Windows.Forms.ScrollBar.Minimum
System.Windows.Forms.ScrollBar.Maximum
ShowScrollBar Shows or hides the specified scroll bar. Any of the following:
System.Windows.Forms.Form.AutoScroll
System.Windows.Forms.HScrollBar
constructor
System.Windows.Forms.ListBox.HorizontalScrollBar
System.Windows.Forms.ListBox.ScrollAlwaysVisible
System.Windows.Forms.RichTextBox.ScrollBars
System.Windows.Forms.ScrollableControl.HScroll
System.Windows.Forms.ScrollableControl.VScroll
System.Windows.Forms.TextBox.ScrollBars
System.Windows.Forms.VScrollBar
constructor

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Service Functions

Functions implemented by services:

Win32 function Description .NET Framework API
Handler An application-defined callback function used with RegisterServiceCtrlHandler. All of the following:
System.ServiceProcess.ServiceBase.OnContinue
System.ServiceProcess.ServiceBase.OnCustomCommand
ServiceProcess.ServiceBase.OnPause
System.ServiceProcess.ServiceBase.OnShutdown
System.ServiceProcess.ServiceBase.OnStop
HandlerEx An application-defined callback function used with RegisterServiceCtrlHandlerEx. All of the following:
System.ServiceProcess.ServiceBase.OnContinue
System.ServiceProcess.ServiceBase.OnCustomCommand
System.ServiceProcess.ServiceBase.OnPause
System.ServiceProcess.ServiceBase.OnPowerEvent
System.ServiceProcess.ServiceBase.OnShutdown
System.ServiceProcess.ServiceBase.OnStop
ServiceMain An application-defined function that serves as the entry point for a service. System.ServiceProcess.ServiceBase.Run

Functions used by programs that control or configure services:

Win32 function Description .NET Framework API
ChangeServiceConfig Changes the configuration parameters of a service. System.ServiceProcess.ServiceController.DisplayName
CloseServiceHandle Closes the specified handle to a service control manager object or a service object. System.ServiceProcess.ServiceController.Close
ControlService Sends a control code to a service. System.ServiceProcess.ServiceController.Continue
System.ServiceProcess.ServiceController.Pause
System.ServiceProcess.ServiceController.Stop
CreateService Creates a service object and adds it to the specified service control manager database. System.ServiceProcess.ServiceBase.ServiceName
System.ServiceProcess.ServiceInstaller.Install
DeleteService Marks the specified service for deletion from the service control manager database. System.ServiceProcess.ServiceInstaller.Uninstall
EnumDependentServices Retrieves the name and status of each service that depends on the specified service. System.ServiceProcess.ServiceController.DependentServices
EnumServicesStatus Enumerates services in the specified service control manager database. System.ServiceProcess.ServiceController.GetServices
GetServiceDisplayName Retrieves the display name of the specified service. System.ServiceProcess.ServiceController.DisplayName
GetServiceKeyName Retrieves the name of the specified service. System.ServiceProcess.ServiceBase.ServiceName
System.ServiceProcess.ServiceController.ServiceName
OpenService Opens an existing service. System.ServiceProcess.ServiceController constructor
QueryServiceConfig Retrieves the configuration parameters of the specified service. System.ServiceProcess.ServiceController.DisplayName
System.ServiceProcess.ServiceController.ServicesDependedOn
System.ServiceProcess.ServiceController.ServiceName
System.ServiceProcess.ServiceController.ServiceType
QueryServiceStatus Retrieves the current status of the specified service. System.ServiceProcess.ServiceController.Status
StartService Starts a service. System.ServiceProcess.ServiceController.Start

Alphabetical Win32 Category List
Hierarchical Win32 Category List

String Functions

Win32 function Description .NET Framework API
CharLower Converts a character string or a single character to lowercase. System.String.ToLower
CharNext Retrieves a pointer to the next character in a string. System.String.GetEnumerator.MoveNext
CharUpper Converts a character string or a single character to uppercase. System.String.ToUpper
CompareString Compares two character strings, using the specified locale. System.String.Compare
IsCharAlpha Determines whether a character is an alphabetical character. System.Char.IsLetter
IsCharAlphaNumeric Determines whether a character is either an alphabetical or a numeric character. System.Char.IsLetterOrDigit
IsCharLower Determines whether a character is lowercase. System.Char.IsLower
IsCharUpper Determines whether a character is uppercase. System.Char.IsUpper
LoadString Loads a string resource from the executable file associated with a specified module. System.Resources.ResourceManager.GetString
lstrcat Appends one string to another. System.String.Concat

Note   Strings are immutable in the .NET Framework. Methods that appear to modify a string actually return a new string.

lstrcmp Compares two character strings. System.String.Compare
lstrcmpi Compares two character strings. System.String.Compare
lstrcpy Copies a string to a buffer. System.String.ToCharArray
lstrcpyn Copies a specified number of characters from a source string into a buffer. System.String.CopyTo
System.String.ToCharArray
lstrlen Retrieves the length of the specified string (not including the terminating null character). System.String.Length
wsprintf Formats and stores a series of characters and values in a buffer. System.String.Format
wvsprintf Formats and stores a series of characters and values in a buffer. System.String.Format

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Structured Exception-Handling Functions

Win32 function Description .NET Framework API
GetExceptionCode Retrieves a code that identifies the type of exception that occurred. System.Exception.GetType
GetExceptionInformation Retrieves a machine-independent description of an exception and information about the machine state that existed for the thread when the exception occurred. System.Exception class
RaiseException Raises an exception in the calling thread. Throw an instance of a System.Exception

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Synchronization Functions

CriticalSection functions:

Win32 function Description .NET Framework API
EnterCriticalSection Waits for ownership of the specified critical section object. System.Threading.Monitor.Enter
LeaveCriticalSection Releases ownership of the specified critical section object. System.Threading.Monitor.Exit
TryEnterCriticalSection Attempts to enter a critical section without blocking. System.Threading.Monitor.TryEnter

Event functions:

Win32 function Description .NET Framework API
CreateEvent Creates or opens a named or an unnamed event object. Either of the following:
System.Threading.AutoResetEvent
constructor
System.Threading.ManualResetEvent
constructor
ResetEvent Sets the specified event object to the nonsignaled state. Either of the following:
System.Threading.AutoResetEvent.Reset
System.Threading.ManualResetEvent.Reset
SetEvent Sets the specified event object to the signaled state. Either of the following:
System.Threading.AutoResetEvent.Set
System.Threading.ManualResetEvent.Set

Interlocked functions:

Win32 function Description .NET Framework API
InterlockedCompareExchange Performs an atomic comparison of the specified values and exchanges the values, based on the outcome of the comparison. System.Threading.Interlocked.CompareExchange
InterlockedCompareExchangePointer Performs an atomic comparison of the specified values and exchange of the values, based on the outcome of the comparison. System.Threading.Interlocked.CompareExchange
InterlockedDecrement Decrements (decreases by one) the value of the specified variable and checks the resulting value. System.Threading.Interlocked.Decrement
InterlockedExchange Atomically exchanges a pair of values. System.Threading.Interlocked.Exchange
InterlockedIncrement Increments (increases by one) the value of the specified variable and checks the resulting value. System.Threading.Interlocked.Increment

Mutex functions:

Win32 function Description .NET Framework API
CreateMutex Creates or opens a named or an unnamed mutex object. System.Threading.Mutex constructor
OpenMutex Opens an existing named mutex object. System.Threading.Mutex(false, string, name) constructor
ReleaseMutex Releases ownership of the specified mutex object. System.Threading.Mutex.ReleaseMutex

Wait functions:

Win32 function Description .NET Framework API
RegisterWaitForSingleObject Directs a wait thread in the thread pool to wait on the object. System.Threading.ThreadPool.RegisterWaitForSingleObject
System.Threading.ThreadPool.UnsafeRegisterWaitForSingleObject
UnregisterWait Cancels a registered wait operation. System.Threading.RegisteredWaitHandle.Unregister
WaitForMultipleObjects Returns when the specified criteria for the specified objects is met. Either of the following:
System.Threading.WaitHandle.WaitAll
System.Threading.WaitHandle.WaitAny
WaitForSingleObject Returns when the specified criteria for the specified object is met. System.Threading.WaitHandle.WaitOne
WaitOrTimerCallback Returns when the specified criteria is met. See System.Threading.WaitOrTimerCallback delegate

WaitableTimer functions:

Win32 function Description .NET Framework API
CancelWaitableTimer Sets the specified waitable timer to the inactive state. System.Threading.Timer.Change(System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite)
CreateWaitableTimer Creates or opens a waitable timer object. System.Threading.Timer constructor
SetWaitableTimer Activates the specified waitable timer. System.Threading.Timer constructor
TimerAPCProc Application-defined timer completion routine used with SetWaitableTimer. See System.Threading.TimerCallback delegate

Alphabetical Win32 Category List
Hierarchical Win32 Category List

System Information Functions

Win32 function Description .NET Framework API
ExpandEnvironmentStrings Replaces environment-variable strings with their defined values. System.Environment.ExpandEnvironmentVariables
GetComputerName Retrieves the NetBIOS name of the local computer. System.Environment.MachineName
System.Windows.Forms.SystemInformation.ComputerName
GetCurrentHwProfile Retrieves the current hardware profile for the local computer. Use System.Management and Microsoft.Win32.RegistryKey
GetKeyboardType Retrieves information about the current keyboard. System.Management.ManagementClass("Win32_Keyboard")
System.Management.ManagementClass.GetInstances
System.Management.ManagementObject.Properties
GetNativeSystemInfo Retrieves information about the current system for an application running under WOW64. System.Management.ManagementClass("Win32_Processor")
System.Management.ManagementClass.GetInstances
System.Management.ManagementObject.Properties
GetSysColor Retrieves the current color of a display element. System.Drawing.SystemColors
GetSystemDirectory Retrieves the path of the system directory. System.Environment.SystemDirectory
GetSystemInfo Retrieves information about the current system. System.Management.ManagementClass("Win32_Processor")
System.Management.ManagementClass.GetInstances
System.Management.ManagementObject.Properties
GetSystemMetrics Retrieves system metrics and configuration settings. System.Windows.Forms.SystemInformation properties
GetUserName Retrieves the user name of the current thread. System.Environment.UserName
GetVersion Retrieves the version number of the operating system. System.Environment.OSVersion
GetVersionEx Retrieves the version number of the current operating system. System.Environment.OSVersion
GetWindowsDirectory Retrieves the path of the Windows directory. System.Management.ManagementClass("Win32_OperatingSystem")
System.Management.ManagementClass.GetInstances
System.Management.ManagementObject["WindowsDirectory"].ToString

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Tape Backup Functions

Win32 function Description .NET Framework API
GetTapeParameters Retrieves information that describes the tape or the tape drive. System.Management.ManagementClass("MSTapeMediaCapacity")
System.Management.ManagementClass("Win32_TapeDrive")
System.Management.ManagementClass.GetInstances
System.Management.ManagementObject.Properties

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Text Object Model Functions

Win32 function Description .NET Framework API
ITextDocument Retrieves the active selection and range objects for any story in the document. System.Windows.Forms.RichTextBox
ITextFont Encapsulates the functionality of the Microsoft Word Font dialog box. System.Windows.Forms.RichTextBox
ITextPara Encapsulates the functionality of the Microsoft Word Paragraph dialog box. System.Windows.Forms.RichTextBox
ITextRange Enables an application to select text in a story, and then examine or change that text. System.Windows.Forms.RichTextBox

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Time Functions

Win32 function Description .NET Framework API
GetSystemTime Retrieves the current system date and time in UTC format. System.DateTime.UtcNow
GetTimeFormat Formats a system time as a time string for a specified locale. System.DateTime.ToString
SystemTimeToFileTime Converts a system time to a file time. System.DateTime.ToFileTime
FileTimeToLocalFileTime Converts a UTC file time to a local file time. System.DateTime.ToFileTime
GetLocalTime Retrieves the current local date and time. System.DateTime.Now
GetTimeZoneInformation Retrieves the current time-zone parameters. System.TimeZone.CurrentTimeZone
CompareFileTime Compares two file times. System.DateTime.Compare
FileTimeToLocalFileTime Converts a UTC file time to a local file time. System.DateTime.ToLocalTime
FileTimeToSystemTime Converts a file time to system time format. System.DateTime.ToUniversalTime
GetFileTime Retrieves the date and time that a file was created, last accessed, and last modified. Any of the following:
System.IO.Directory.GetCreationTime
System.IO.Directory.GetLastAccessTime
System.IO.Directory.GetLastWriteTime
System.IO.DirectoryInfo.CreationTime
System.IO.DirectoryInfo.LastAccessTime
System.IO.DirectoryInfo.LastWriteTime
System.IO.File.GetCreationTime
System.IO.File.GetLastAccessTime
System.IO.File.GetLastWriteTime
System.IO.FileInfo.CreationTime
System.IO.FileInfo.LastAccessTime
System.IO.FileInfo.LastWriteTime
GetSystemTimeAsFileTime Retrieves the current system date and time in UTC format. System.DateTime.UtcNow.ToFileTimeUtc
LocalFileTimeToFileTime Converts a local file time to a file time based on UTC. System.DateTime.ToFileTimeUtc
SetFileTime Sets the date and time that a file was created, last accessed, or last modified. Any of the following:
System.IO.Directory.SetCreationTime
System.IO.Directory.SetLastAccessTime
System.IO.Directory.SetLastWriteTime
System.IO.DirectoryInfo.CreationTime
System.IO.DirectoryInfo.LastAccessTime
System.IO.DirectoryInfo.LastWriteTime
System.IO.File.SetCreationTime
System.IO.File.SetLastAccessTime
System.IO.File.SetLastWriteTime
System.IO.FileInfo.CreationTime
System.IO.FileInfo.LastAccessTime
System.IO.FileInfo.LastWriteTime
SystemTimeToFileTime Converts a system time to a file time. System.DateTime.ToFileTime
GetTickCount Retrieves the number of milliseconds that have elapsed since the system was started. System.Environment.TickCount

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Timer Functions

Win32 function Description .NET Framework API
KillTimer Destroys the specified timer. System.Threading.Timer.Dispose
System.Timers.Timer.Dispose
System.Windows.Forms.Timer.Dispose
QueryPerformanceCounter Retrieves the current value of the high-resolution performance counter. System.Diagnostics.PerformanceCounter.NextValue
System.Diagnostics.PerformanceCounter.RawValue
QueryPerformanceFrequency Retrieves the frequency of the high-resolution performance counter. System.Diagnostics.PerformanceCounter.CounterType
SetTimer Creates a timer with the specified time-out value. Any of the following:
System.Threading.Timer
constructor
System.Timers.Timer
constructor
System.Windows.Forms.Timer
constructor
System.Windows.Forms.Timer.Interval
TimerProc An application-defined callback function that processes WM_TIMER messages. Either of the following:
System.Threading.TimerCallback
delegate
System.Timers.ElapsedEventHandler
delegate

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Tool Help Functions

Win32 function Description .NET Framework API
CreateToolhelp32Snapshot Takes a snapshot of the processes and heaps, modules, and threads used by the processes. System.Diagnostics.Process.GetProcesses
System.Diagnostics.Process.Modules
System.Diagnostics.Process.Threads
Module32First Retrieves information about the first module associated with a process. System.Diagnostics.Process.Modules
Module32Next Retrieves information about the next module associated with a process or thread. System.Diagnostics.Process.Modules
Process32First Retrieves information about the first process encountered in a system snapshot. System.Diagnostics.Process.GetProcesses
Process32Next Retrieves information about the next process recorded in a system snapshot. System.Diagnostics.Process.GetProcesses
Thread32First Retrieves information about the first thread of any process encountered in a system snapshot. System.Diagnostics.Process.Threads
Thread32Next Retrieves information about the next thread of any process encountered in the system memory snapshot. System.Diagnostics.Process.Threads

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Unicode and Character Set Functions

Win32 function Description .NET Framework API
GetTextCharset Retrieves a character-set identifier for the font that is currently selected into a specified device context. System.Drawing.Font.GdiCharSet

Alphabetical Win32 Category List
Hierarchical Win32 Category List

User Profile Functions

Win32 function Description .NET Framework API
CreateEnvironmentBlock Retrieves the environment variables for the specified user. Microsoft.Win32.Registry class
Microsoft.Win32.RegistryKey.OpenSubKey(name).GetValue
DeleteProfile Deletes the user profile and all user-related settings from the specified computer. System.IO.Directory.Delete
Microsoft.Win32.Registry
Microsoft.Win32.RegistryKey.DeleteSubKey
ExpandEnvironmentStringsForUser Expands the source string by using the environment block established for the specified user. Microsoft.Win32.Registry class

Microsoft.Win32.RegistryKey.OpenSubKey(name).GetValueNames, and then call GetValue for each name

GetAllUsersProfileDirectory Retrieves the path to the root of the All Users profile. Microsoft.Win32.Registry class
Microsoft.Win32.RegistryKey.OpenSubKey(name).GetValue
GetDefaultUserProfileDirectory Retrieves the path to the root of the Default User profile. Microsoft.Win32.Registry class
Microsoft.Win32.RegistryKey.OpenSubKey(name).GetValue
GetProfilesDirectory Retrieves the path to the root directory where all of the user profiles are stored. Microsoft.Win32.Registry class
Microsoft.Win32.RegistryKey.OpenSubKey(name).GetValue
GetUserProfileDirectory Retrieves the path to the root directory of the profile for the specified user. Microsoft.Win32.Registry class
Microsoft.Win32.RegistryKey.OpenSubKey(name).GetValue

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Version Information Functions

Win32 function Description .NET Framework API
GetFileVersionInfo Retrieves version information for the specified file. System.Diagnostics.FileVersionInfo.GetVersionInfo
GetFileVersionInfoSize Determines whether the operating system can retrieve version information for a specified file. If version information is available, the function returns the size, in bytes, of that information. System.Diagnostics.FileVersionInfo.GetVersionInfo
VerLanguageName Retrieves a description string for the language associated with a specified binary Microsoft language identifier. System.Globalization.CultureInfo.Name
VerQueryValue Retrieves specified version information from the specified version-information resource. System.Diagnostics.FileVersionInfo properties

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Window Functions

Win32 function Description .NET Framework API
AdjustWindowRect Calculates the required size of the window rectangle, based on the desired client-rectangle size. System.Windows.Forms.Form.ClientSize
AdjustWindowRectEx Calculates the required size of the window rectangle, based on the desired client-rectangle size. System.Windows.Forms.Form.ClientSize
ArrangeIconicWindows Arranges all minimized (iconic) child windows of the specified parent window. System.Windows.Forms.Form.LayoutMdi(MdiLayout.ArrangeIcons)
BringWindowToTop Brings the specified window to the top of the Z order. System.Windows.Forms.Form.BringToFront
CascadeWindows Cascades the specified child windows of the specified parent window. System.Windows.Forms.Form.LayoutMdi(MdiLayout.Cascade)
ChildWindowFromPoint Determines which, if any, of the child windows belonging to a parent window contains the specified point. System.Windows.Forms.Form.GetChildAtPoint
CloseWindow Minimizes (but does not destroy) the specified window. System.Windows.Forms.Form.WindowState = System.Windows.Forms.FormWindowState.Minimized
CreateWindow Creates an overlapped, pop-up, or child window. System.Windows.Forms.Form constructor
CreateWindowEx Creates an overlapped, pop-up, or child window with an extended window style. System.Windows.Forms.Form constructor
DestroyWindow Destroys the specified window. System.Windows.Forms.Form.Close
EnumChildProc An application-defined callback function used with EnumChildWindows. Same as EnumChildWindows
EnumChildWindows Enumerates the child windows that belong to the specified parent window. System.Windows.Forms.Form.Controls
GetAncestor Retrieves the handle to the ancestor of the specified window. System.Windows.Forms.Form.FindForm
System.Windows.Forms.Form.Owner
System.Windows.Forms.Form.Parent
GetClientRect Retrieves the coordinates of the client area for a window. System.Windows.Forms.Form.ClientRectangle
GetForegroundWindow Returns a handle to the foreground window. System.Windows.Forms.Form.ActiveForm
GetLayeredWindowAttributes Retrieves the opacity and transparency color key of a layered window. System.Windows.Forms.Form.Opacity
System.Windows.Forms.Form.TransparencyKey
GetNextWindow Retrieves a handle to the next or previous window in Z order. System.Windows.Forms.Form.Controls[1 +/- Control.IndexOf]
GetParent Retrieves a handle to the parent window for the specified child window. System.Windows.Forms.Form.FindForm
System.Windows.Forms.Form.Parent
GetTitleBarInfo Retrieves information about the specified title bar. System.Windows.Forms.Form.SystemInformation.CaptionButtonSize
System.Windows.Forms.Form.SystemInformation.CaptionHeight
System.Windows.Forms.Form.HelpButton
System.Windows.Forms.Form.MaximizeBox
System.Windows.Forms.Form.MinimizeBox
GetTopWindow Retrieves a handle to the child window at the top of the Z order. System.Windows.Forms.Form.Controls[0]
GetWindow Retrieves a handle to a window that has the specified relationship to the specified window. System.Windows.Forms.Form.Controls
GetWindowInfo Retrieves information about the specified window. System.Windows.Forms.Form.ClientSize
System.Windows.Forms.Form.CreateParams.ExStyle
System.Windows.Forms.Form.CreateParams.Style
System.Windows.Forms.Form.Name
System.Windows.Forms.Form.ProductVersion
System.Windows.Forms.Form.Size
System.Windows.Forms.SystemInformation.BorderSize
GetWindowPlacement Retrieves the show state and the restored, minimized, and maximized positions of the specified window. System.Windows.Forms.Form.Bounds
System.Windows.Forms.Form.MaximizedBounds
System.Windows.Forms.Form.Visible
System.Windows.Forms.Form.WindowState
GetWindowRect Retrieves the dimensions of the bounding rectangle of the specified window. System.Windows.Forms.Form.Bounds
GetWindowText Copies the text of the title bar of the specified window. System.Windows.Forms.Form.Text
GetWindowTextLength Retrieves the length of the title bar text for the specified window. System.Windows.Forms.Form.Text.Length
IsChild Tests whether a window is a child window or descendant window of a specified parent window. System.Windows.Forms.Form.Contains
System.Windows.Forms.Form.IsMdiChild
IsIconic Determines whether the specified window is minimized (iconic). System.Windows.Forms.Form.WindowState
IsWindowVisible Retrieves the visibility state of the specified window. System.Windows.Forms.Form.Visible
IsZoomed Determines whether a window is maximized (zoomed). System.Windows.Forms.Form.WindowState
MoveWindow Changes the position and dimensions of the specified window. System.Windows.Forms.Form.SetBounds
OpenIcon Restores a minimized (iconic) window to its previous size and position. System.Windows.Forms.Form.WindowState = System.Windows.Forms.FormWindowState.Normal
SetForegroundWindow Puts the thread that created the specified window into the foreground and activates the window. System.Windows.Forms.Form.Activate
SetLayeredWindowAttributes Sets the opacity and transparency color key of a layered window. System.Windows.Forms.Form.Opacity
System.Windows.Forms.Form.TransparencyKey
SetParent Changes the parent window of the specified child window. System.Windows.Forms.Form.Parent
SetWindowPlacement Sets the show state and the restored, minimized, and maximized positions of the specified window. System.Windows.Forms.Form.Bounds
System.Windows.Forms.Form.MaximizedBounds
System.Windows.Forms.Form.SetBounds
System.Windows.Forms.Form.Visible
System.Windows.Forms.Form.WindowState
SetWindowPos Changes the size, position, and Z order of a window. System.Windows.Forms.Form.BringToFront
System.Windows.Forms.Form.Enabled
System.Windows.Forms.Form.SendToBack
System.Windows.Forms.Form.SetBounds
System.Windows.Forms.Form.TopMost
System.Windows.Forms.Form.Visible
SetWindowText Changes the text of the title bar for the specified window. System.Windows.Forms.Form.Text
ShowWindow Sets the show state of the specified window. System.Windows.Forms.Form.Show
System.Windows.Forms.Form.Visible
System.Windows.Forms.Form.WindowState
TileWindows Tiles the specified child windows of the specified parent window. System.Windows.Forms.Form.LayoutMdi(MdiLayout.TileHorizontal)
System.Windows.Forms.Form.LayoutMdi(MdiLayout.TileVertical)
WindowFromPoint Retrieves a handle to the window that contains the specified point. System.Windows.Forms.Form.GetChildAtPoint

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Window Class Functions

Win32 function Description .NET Framework API
GetClassInfo Retrieves information about a window class. System.ComponentModel.Component.Events
System.Windows.Forms.Control.Cursor
System.Windows.Forms.Control.Name
System.Windows.Forms.Form.BackColor
System.Windows.Forms.Form.Icon
System.Windows.Forms.Form.Menu
System.Windows.Forms.Form.CreateParams.ClassStyle
GetClassLong Retrieves the specified 32-bit value from the WNDCLASSEX structure associated with the specified window. System.ComponentModel.Component.Events
System.Windows.Forms.Control.Cursor
System.Windows.Forms.Control.Name
System.Windows.Forms.Form.BackColor
System.Windows.Forms.Form.Icon
System.Windows.Forms.Form.Menu
System.Windows.Forms.Form.CreateParams.ClassStyle
GetClassLongPtr Retrieves the specified value from the WNDCLASSEX structure associated with the specified window. System.ComponentModel.Component.Events
System.Windows.Forms.Control.Cursor
System.Windows.Forms.Control.Name
System.Windows.Forms.Form.BackColor
System.Windows.Forms.Form.Icon
System.Windows.Forms.Form.Menu
System.Windows.Forms.Form.CreateParams.ClassStyle
GetClassName Retrieves the name of the class to which the specified window belongs. System.Windows.Forms.Control.Name
GetWindowLong Retrieves information about the specified window. System.ComponentModel.Component.Events
System.Windows.Forms.Control.Parent
System.Windows.Forms.Form.CreateParams.ExStyle
System.Windows.Forms.Form.CreateParams.Style
System.Windows.Forms.Form
properties
GetWindowLongPtr Retrieves information about the specified window. System.ComponentModel.Component.Events
System.Windows.Forms.Control.Parent
System.Windows.Forms.Form.CreateParams.ExStyle
System.Windows.Forms.Form.CreateParams.Style
System.Windows.Forms.Form
properties
RegisterClass Registers a window class. System.Windows.Forms.Control.Cursor
System.Windows.Forms.Control.Name
System.Windows.Forms.Form.BackColor
System.Windows.Forms.Form.Icon
System.Windows.Forms.Form.Menu
System.Windows.Forms.Form.CreateParams.ClassStyle
System.Windows.Forms.Form
events
SetClassLong Replaces the specified 32-bit value at the specified offset into the extra class memory or the WNDCLASSEX structure. System.Windows.Forms.Control.Cursor
System.Windows.Forms.Control.Name
System.Windows.Forms.Form.BackColor
System.Windows.Forms.Form.Icon
System.Windows.Forms.Form.Menu
System.Windows.Forms.Form.CreateParams.ClassStyle
System.Windows.Forms.Form
events
SetClassLongPtr Replaces the specified value at the specified offset into the extra class memory or the WNDCLASSEX structure. System.Windows.Forms.Control.Cursor
System.Windows.Forms.Control.Name
System.Windows.Forms.Form.BackColor
System.Windows.Forms.Form.Icon
System.Windows.Forms.Form.Menu
System.Windows.Forms.Form.CreateParams.ClassStyle
System.Windows.Forms.Form
events
SetWindowLong Changes an attribute of the specified window. System.Windows.Forms.Control.Parent
System.Windows.Forms.Form.CreateParams.ExStyle
System.Windows.Forms.Form.CreateParams.Style
System.Windows.Forms.Form
properties
System.Windows.Forms.Form
events
SetWindowLongPtr Changes an attribute of the specified window. System.Windows.Forms.Control.Parent
System.Windows.Forms.Form.CreateParams.ExStyle
System.Windows.Forms.Form.CreateParams.Style
System.Windows.Forms.Form
properties
System.Windows.Forms.Form
events

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Window Procedure Functions

Win32 function Description .NET Framework API
DefWindowProc Calls the default window procedure to provide default processing for any window messages that an application does not process. Any of the following:
System.Windows.Forms.Form.DefWndProc
System.Windows.Forms.Control.DefWndProc
System.Windows.Forms.NativeWindow.DefWndProc
WindowProc An application-defined function that processes messages sent to a window. Any of the following:
System.Windows.Forms.Form.WndProc
System.Windows.Forms.Control.WndProc
System.Windows.Forms.NativeWindow.WndProc

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Window Property Functions

Win32 function Description .NET Framework API
GetProp Retrieves a data handle from the property list of the specified window. System.Windows.Forms.Control.Tag
RemoveProp Removes an entry from the property list of the specified window. System.Windows.Forms.Control.Tag
SetProp Adds a new entry or changes an existing entry in the property list of the specified window. System.Windows.Forms.Control.Tag

Alphabetical Win32 Category List
Hierarchical Win32 Category List

Top of Page Top of Page

QQ消息轰炸机源代码(VB.NET)

日期:2005年1月5日 作者:-=不详=- 人气: 296 人
 

‘***************************************
‘QQ消息轰炸机源代码(VB.NET)
‘wgscd 2005-1-1

‘***************************************
Public Class Form1
    Inherits System.Windows.Forms.Form
    Private Declare Function FindWindowEx Lib "user32.dll" Alias "FindWindowExA" (ByVal hWnd1 As Int32, ByVal hWnd2 As Int32, ByVal lpsz1 As String, ByVal lpsz2 As String) As Int32
    Private Declare Function GetWindowText Lib "user32.dll" Alias "GetWindowTextA" (ByVal hwnd As Int32, ByVal lpString As String, ByVal cch As Int32) As Int32
    Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Int32
    Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Int32, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As Int32) As Int32
    Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Int32, ByVal wMsg As Int32, ByVal wParam As Int32, ByVal lParam As String) As Int32
    ‘Private Const WM_PASTE As Int32 = &H302
    Private Const WM_SETTEXT As Int32 = &HC
    Private Const WM_KEYDOWN As Int32 = &H100
    Private Const WM_KEYUP As Int32 = &H101
    Private Const WM_LBUTTONDOWN As Int32 = &H201
    Private Const WM_LBUTTONUP As Int32 = &H202

    ‘Private Const WM_SHOWWINDOW As Int32 = &H18
    Private Const SW_NORMAL As Int32 = 1
    Private Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As Int32, ByVal nCmdShow As Int32) As Int32
    ‘Private Declare Function GetLastError Lib "kernel32.dll" () As Int32
    Private Const SW_SHOWNOACTIVATE As Int32 = 4
    Private Declare Function SetWindowText Lib "user32.dll" Alias "SetWindowTextA" (ByVal hwnd As Int32, ByVal lpString As String) As Int32
    Private Const SW_HIDE As Int32 = 0
    Private Const SW_SHOW As Int32 = 5

    Dim sMess As String
    Dim hwnd, hwnd2, hwnd3, i, iDelay As Int32
    Dim hWndTalk(20), hWndEdit(20), hWndSend(20) As Int32
    Dim MyThread As Threading.Thread
#Region " Windows 窗体设计器生成的代码 "

    Public Sub New()
        MyBase.New()

        ‘该调用是 Windows 窗体设计器所必需的。
        InitializeComponent()

        ‘在 InitializeComponent() 调用之后添加任何初始化

    End Sub

    ‘窗体重写 dispose 以清理组件列表。
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    ‘Windows 窗体设计器所必需的
    Private components As System.ComponentModel.IContainer

    ‘注意: 以下过程是 Windows 窗体设计器所必需的
    ‘可以使用 Windows 窗体设计器修改此过程。
    ‘不要使用代码编辑器修改它。

    Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents ButtonRefresh As System.Windows.Forms.Button
    Friend WithEvents ButtonStart As System.Windows.Forms.Button
    Friend WithEvents ButtonStop As System.Windows.Forms.Button
    Friend WithEvents RadioButton1 As System.Windows.Forms.RadioButton
    Friend WithEvents RadioButton2 As System.Windows.Forms.RadioButton
    Friend WithEvents ListView1 As System.Windows.Forms.ListView
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.ButtonRefresh = New System.Windows.Forms.Button
        Me.ButtonStart = New System.Windows.Forms.Button
        Me.TextBox1 = New System.Windows.Forms.TextBox
        Me.Label1 = New System.Windows.Forms.Label
        Me.GroupBox1 = New System.Windows.Forms.GroupBox
        Me.ListView1 = New System.Windows.Forms.ListView
        Me.RadioButton2 = New System.Windows.Forms.RadioButton
        Me.RadioButton1 = New System.Windows.Forms.RadioButton
        Me.ButtonStop = New System.Windows.Forms.Button
        Me.Label3 = New System.Windows.Forms.Label
        Me.GroupBox1.SuspendLayout()
        Me.SuspendLayout()
        ‘
        ‘ButtonRefresh
        ‘
        Me.ButtonRefresh.Location = New System.Drawing.Point(16, 80)
        Me.ButtonRefresh.Name = "ButtonRefresh"
        Me.ButtonRefresh.Size = New System.Drawing.Size(56, 24)
        Me.ButtonRefresh.TabIndex = 0
        Me.ButtonRefresh.Text = "刷新"
        ‘
        ‘ButtonStart
        ‘
        Me.ButtonStart.Location = New System.Drawing.Point(16, 116)
        Me.ButtonStart.Name = "ButtonStart"
        Me.ButtonStart.Size = New System.Drawing.Size(56, 24)
        Me.ButtonStart.TabIndex = 1
        Me.ButtonStart.Text = "开始"
        ‘
        ‘TextBox1
        ‘
        Me.TextBox1.AutoSize = False
        Me.TextBox1.Location = New System.Drawing.Point(16, 216)
        Me.TextBox1.Multiline = True
        Me.TextBox1.Name = "TextBox1"
        Me.TextBox1.Size = New System.Drawing.Size(256, 88)
        Me.TextBox1.TabIndex = 3
        Me.TextBox1.Text = "/cy 轰炸美国,从你开始. "
        ‘
        ‘Label1
        ‘
        Me.Label1.AutoSize = True
        Me.Label1.Location = New System.Drawing.Point(24, 200)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(91, 17)
        Me.Label1.TabIndex = 4
        Me.Label1.Text = "请输入发送内容"
        ‘
        ‘GroupBox1
        ‘
        Me.GroupBox1.Controls.Add(Me.ListView1)
        Me.GroupBox1.Controls.Add(Me.RadioButton2)
        Me.GroupBox1.Controls.Add(Me.RadioButton1)
        Me.GroupBox1.Controls.Add(Me.ButtonStop)
        Me.GroupBox1.Controls.Add(Me.ButtonStart)
        Me.GroupBox1.Controls.Add(Me.ButtonRefresh)
        Me.GroupBox1.Location = New System.Drawing.Point(16, 8)
        Me.GroupBox1.Name = "GroupBox1"
        Me.GroupBox1.Size = New System.Drawing.Size(248, 184)
        Me.GroupBox1.TabIndex = 9
        Me.GroupBox1.TabStop = False
        ‘
        ‘ListView1
        ‘
        Me.ListView1.CheckBoxes = True
        Me.ListView1.Location = New System.Drawing.Point(96, 24)
        Me.ListView1.Name = "ListView1"
        Me.ListView1.Size = New System.Drawing.Size(144, 152)
        Me.ListView1.TabIndex = 12
        Me.ListView1.View = System.Windows.Forms.View.List
        ‘
        ‘RadioButton2
        ‘
        Me.RadioButton2.Location = New System.Drawing.Point(12, 40)
        Me.RadioButton2.Name = "RadioButton2"
        Me.RadioButton2.Size = New System.Drawing.Size(88, 24)
        Me.RadioButton2.TabIndex = 1
        Me.RadioButton2.Text = "直到我叫停"
        ‘
        ‘RadioButton1
        ‘
        Me.RadioButton1.Checked = True
        Me.RadioButton1.Location = New System.Drawing.Point(12, 17)
        Me.RadioButton1.Name = "RadioButton1"
        Me.RadioButton1.Size = New System.Drawing.Size(88, 24)
        Me.RadioButton1.TabIndex = 0
        Me.RadioButton1.TabStop = True
        Me.RadioButton1.Text = "只发一次"
        ‘
        ‘ButtonStop
        ‘
        Me.ButtonStop.Location = New System.Drawing.Point(16, 152)
        Me.ButtonStop.Name = "ButtonStop"
        Me.ButtonStop.Size = New System.Drawing.Size(56, 24)
        Me.ButtonStop.TabIndex = 11
        Me.ButtonStop.Text = "停止"
        ‘
        ‘Label3
        ‘
        Me.Label3.Location = New System.Drawing.Point(96, 312)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(184, 24)
        Me.Label3.TabIndex = 10
        Me.Label3.Text = "—自由奔腾 wgscd—-"
        ‘
        ‘Form1
        ‘
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.BackColor = System.Drawing.Color.SkyBlue
        Me.ClientSize = New System.Drawing.Size(280, 325)
        Me.Controls.Add(Me.Label3)
        Me.Controls.Add(Me.Label1)
        Me.Controls.Add(Me.TextBox1)
        Me.Controls.Add(Me.GroupBox1)
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "Form1"
        Me.Text = "QQ消息群炸机"
        Me.GroupBox1.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub ButtonRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonRefresh.Click
        ListView1.Items.Clear()  ‘清除元素
        ””””””””””””””””””””””””
        hwnd = 0
        i = 0
        Dim str As String
        While 1
            hwnd = FindWindowEx(0, hwnd, "#32770", vbNullString)
            If hwnd = 0 Then
                Exit While
            Else
                Str = New String(Chr(0), 50)
                GetWindowText(hwnd, Str, 50)
                Str = Str.TrimEnd(Chr(0))
                If Str.StartsWith("与 ") And Str.EndsWith(" 聊天中") Then
                    ‘聊天主窗口hwnd–子窗口hwnd2(发送BUTTON 和 hwnd3 的父窗口)–hwnd3(文本编辑框的父窗口)–文本编辑窗口句柄
                    hWndTalk(i) = hwnd      ‘聊天主窗口句柄
                    hwnd2 = FindWindowEx(hwnd, 0, "#32770", vbNullString)   ‘发送按钮 和 文本编辑框 的父窗口
                    ”””””””””””””””””””””’
                    hWndSend(i) = FindWindowEx(hwnd2, 0, vbNullString, "发送(&s)")   ‘发送BUTTON 句柄
                    ”””””””””””””””””””””’
                    hwnd3 = FindWindowEx(hwnd2, 0, "AfxWnd42", vbNullString)         ‘文本编辑框的父窗口
                    hWndEdit(i) = FindWindowEx(hwnd3, 0, "RICHEDIT", vbNullString)   ‘文本编辑框的句柄
                    ”””””””””””””””””’
                    i += 1
                    Str = Str.Substring(2)
                    Str = Str.Replace(" 聊天中", "")
                    Dim item As Windows.Forms.ListViewItem
                    item = ListView1.Items.Add(Str)
                    item.Checked = True
                    ”””””””””””””””””’
                End If
            End If
        End While

    End Sub

    Private Sub ButtonStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonStop.Click
        If (Not MyThread Is Nothing) Then
            MyThread.Abort()
        End If
        ButtonStart.Enabled = True
    End Sub

    Private Sub ButtonStart_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonStart.Click
        sMess = Me.TextBox1.Text.ToString
        If sMess = "" Then
            MsgBox("请输入发送内容!")
            Exit Sub
        End If
        ””””””””””””””””””””””””””””
        ‘以下求延迟毫秒数
        iDelay = 0
        For i = 0 To ListView1.Items.Count – 1
            If ListView1.Items(i).Checked = True Then
                iDelay += 1         ‘共有多少个窗口,要发送信息
            End If
        Next
        If iDelay = 0 Then
            MsgBox("请选择至少一个聊天对象,必须打开聊天窗口,再按刷新即可。")
            Exit Sub
        End If
        iDelay = 3100 – iDelay * 1000   ‘延迟多少秒,发送的窗口越少,延迟秒数越大
        If iDelay < 0 Then
            iDelay = 0
        End If
        ””””””””””””””””””””””””””””
        If RadioButton1.Checked Then    ‘只发一次
            SendMess()
        Else                            ‘不停地发,直到用户中止
            MyThread = New Threading.Thread(AddressOf SendMessUntil)
            MyThread.Start()
            ButtonStart.Enabled = False
        End If
    End Sub
    Private Sub SendMess()
        For i = 0 To ListView1.Items.Count – 1
            If ListView1.Items(i).Checked = True Then
                SendMessage(hWndEdit(i), WM_SETTEXT, 0, sMess & "hhhhhhhh")
                System.Threading.Thread.Sleep(iDelay)
                SendMessage(hWndSend(i), WM_LBUTTONDOWN, 0, 0)
                SendMessage(hWndSend(i), WM_LBUTTONUP, 0, 0)
            End If
        Next
    End Sub
    Private Sub SendMessUntil()
        While 1
            SendMess()
        End While
    End Sub

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ButtonRefresh_Click(Nothing, Nothing)
    End Sub

    Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
        If (Not MyThread Is Nothing) Then
            MyThread.Abort()
        End If
    End Sub

End Class

  在.Net Framework SDK文档中,关于调用Windows API的指示比较零散,并且其中稍全面一点的是针对Visual Basic .net讲述的。本文将C#中调用API的要点汇集如下,希望给未在C#中使用过API的朋友一点帮助。另外如果安装了Visual Studio .net的话,在C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Samples\Technologies\Interop\PlatformInvoke\WinAPIs\CS目录下有大量的调用API的例子。

 一、调用格式


  using System.Runtime.InteropServices; //引用此名称空间,简化后面的代码
  …
  //使用DllImportAttribute特性来引入api函数,注意声明的是空方法,即方法体为空。
  [DllImport("user32.dll")]
  public static extern ReturnType FunctionName(type arg1,type arg2,…);
  //调用时与调用其他方法并无区别

  可以使用字段进一步说明特性,用逗号隔开,如:



  [ DllImport( "kernel32", EntryPoint="GetVersionEx" )]


  DllImportAttribute特性的公共字段如下:
  1、CallingConvention 指示向非托管实现传递方法参数时所用的 CallingConvention 值。
  CallingConvention.Cdecl : 调用方清理堆栈。它使您能够调用具有 varargs 的函数。
  CallingConvention.StdCall : 被调用方清理堆栈。它是从托管代码调用非托管函数的默认约定。

  2、CharSet 控制调用函数的名称版本及指示如何向方法封送 String 参数。

  此字段被设置为 CharSet 值之一。如果 CharSet 字段设置为 Unicode,则所有字符串参数在传递到非托管实现之前都转换成 Unicode 字符。这还导致向 DLL EntryPoint 的名称中追加字母“W”。如果此字段设置为 Ansi,则字符串将转换成 ANSI 字符串,同时向 DLL EntryPoint 的名称中追加字母“A”。

  大多数 Win32 API 使用这种追加“W”或“A”的约定。如果 CharSet 设置为 Auto,则这种转换就是与平台有关的(在 Windows NT 上为 Unicode,在 Windows 98 上为 Ansi)。CharSet 的默认值为 Ansi。CharSet 字段也用于确定将从指定的 DLL 导入哪个版本的函数。

  CharSet.Ansi 和 CharSet.Unicode 的名称匹配规则大不相同。对于 Ansi 来说,如果将 EntryPoint 设置为“MyMethod”且它存在的话,则返回“MyMethod”。如果 DLL 中没有“MyMethod”,但存在“MyMethodA”,则返回“MyMethodA”。

  对于 Unicode 来说则正好相反。如果将 EntryPoint 设置为“MyMethod”且它存在的话,则返回“MyMethodW”。如果 DLL 中不存在“MyMethodW”,但存在“MyMethod”,则返回“MyMethod”。如果使用的是 Auto,则匹配规则与平台有关(在 Windows NT 上为 Unicode,在 Windows 98 上为 Ansi)。如果 ExactSpelling 设置为 true,则只有当 DLL 中存在“MyMethod”时才返回“MyMethod”。

  3、EntryPoint 指示要调用的 DLL 入口点的名称或序号。
  如果你的方法名不想与api函数同名的话,一定要指定此参数,例如:



  [DllImport("user32.dll",CharSet="CharSet.Auto",EntryPoint="MessageBox")]
  public static extern int MsgBox(IntPtr hWnd,string txt,string caption, int type);

  4、ExactSpelling 指示是否应修改非托管 DLL 中的入口点的名称,以与 CharSet 字段中指定的 CharSet 值相对应。如果为 true,则当 DllImportAttribute.CharSet 字段设置为 CharSet 的 Ansi 值时,向方法名称中追加字母 A,当 DllImportAttribute.CharSet 字段设置为 CharSet 的 Unicode 值时,向方法的名称中追加字母 W。此字段的默认值是 false。

  5、PreserveSig 指示托管方法签名不应转换成返回 HRESULT、并且可能有一个对应于返回值的附加 [out, retval] 参数的非托管签名。

  6、SetLastError 指示被调用方在从属性化方法返回之前将调用 Win32 API SetLastError。 true 指示调用方将调用 SetLastError,默认为 false。运行时封送拆收器将调用 GetLastError 并缓存返回的值,以防其被其他 API 调用重写。用户可通过调用 GetLastWin32Error 来检索错误代码。

  二、参数类型:

  1、数值型直接用对应的就可。(DWORD -> int , WORD -> Int16)
  2、API中字符串指针类型 -> .net中string
  3、API中句柄 (dWord)  -> .net中IntPtr
  4、API中结构   -> .net中结构或者类。注意这种情况下,要先用StructLayout特性限定声明结构或类

  公共语言运行库利用StructLayoutAttribute控制类或结构的数据字段在托管内存中的物理布局,即类或结构需要按某种方式排列。如果要将类传递给需要指定布局的非托管代码,则显式控制类布局是重要的。它的构造函数中用LayoutKind值初始化 StructLayoutAttribute 类的新实例。 LayoutKind.Sequential 用于强制将成员按其出现的顺序进行顺序布局。

  LayoutKind.Explicit 用于控制每个数据成员的精确位置。利用 Explicit, 每个成员必须使用 FieldOffsetAttribute 指示此字段在类型中的位置。如:



  [StructLayout(LayoutKind.Explicit, Size=16, CharSet=CharSet.Ansi)]
  public class MySystemTime
  {
  [FieldOffset(0)]public ushort wYear;
  [FieldOffset(2)]public ushort wMonth;
  [FieldOffset(4)]public ushort wDayOfWeek;
  [FieldOffset(6)]public ushort wDay;
  [FieldOffset(8)]public ushort wHour;
  [FieldOffset(10)]public ushort wMinute;
  [FieldOffset(12)]public ushort wSecond;
  [FieldOffset(14)]public ushort wMilliseconds;
  }


  下面是针对API中OSVERSIONINFO结构,在.net中定义对应类或结构的例子:
 


 /**********************************************
  * API中定义原结构声明
  * OSVERSIONINFOA STRUCT
  *  dwOSVersionInfoSize   DWORD      ?
  *  dwMajorVersion        DWORD      ?
  *  dwMinorVersion        DWORD      ?
  *  dwBuildNumber         DWORD      ?
  *  dwPlatformId          DWORD      ?
  *  szCSDVersion          BYTE 128 dup (?)
  * OSVERSIONINFOA ENDS
  *
  * OSVERSIONINFO  equ  <OSVERSIONINFOA>
  *********************************************/


  //.net中声明为类
  [ StructLayout( LayoutKind.Sequential )]  
  public class OSVersionInfo
  {  
  public int OSVersionInfoSize;
  public int majorVersion;
  public int minorVersion;
  public int buildNumber;
  public int platformId;

  [ MarshalAs( UnmanagedType.ByValTStr, SizeConst=128 )]   
  public String versionString;
  }
  //或者
  //.net中声明为结构
  [ StructLayout( LayoutKind.Sequential )] 
  public struct OSVersionInfo2
  {
  public int OSVersionInfoSize;
  public int majorVersion;
  public int minorVersion;
  public int buildNumber;
  public int platformId;



  [ MarshalAs( UnmanagedType.ByValTStr, SizeConst=128 )]   
  public String versionString;
  }

  此例中用到MashalAs特性,它用于描述字段、方法或参数的封送处理格式。用它作为参数前缀并指定目标需要的数据类型。例如,以下代码将两个参数作为数据类型长指针封送给 Windows API 函数的字符串 (LPStr):


  [MarshalAs(UnmanagedType.LPStr)]
  String existingfile;
  [MarshalAs(UnmanagedType.LPStr)]
  String newfile;

  注意结构作为参数时候,一般前面要加上ref修饰符,否则会出现错误:对象的引用没有指定对象的实例。



  [ DllImport( "kernel32", EntryPoint="GetVersionEx" )]
  public static extern bool GetVersionEx2( ref OSVersionInfo2 osvi );

  三、如何保证使用托管对象的平台调用成功?
  如果在调用平台 invoke 后的任何位置都未引用托管对象,则垃圾回收器可能将完成该托管对象。这将释放资源并使句柄无效,从而导致平台invoke 调用失败。用 HandleRef 包装句柄可保证在平台 invoke 调用完成前,不对托管对象进行垃圾回收。

  例如下面:


  FileStream fs = new FileStream( "a.txt", FileMode.Open );
  StringBuilder buffer = new StringBuilder( 5 );
  int read = 0;
  ReadFile(fs.Handle, buffer, 5, out read, 0 ); //调用Win API中的ReadFile函数

  由于fs是托管对象,所以有可能在平台调用还未完成时候被垃圾回收站回收。将文件流的句柄用HandleRef包装后,就能避免被垃圾站回收:


  [ DllImport( "Kernel32.dll" )]
  public static extern bool ReadFile(
  HandleRef hndRef,
  StringBuilder buffer,
  int numberOfBytesToRead,
  out int numberOfBytesRead,
  ref Overlapped flag );
  ……
  ……
  FileStream fs = new FileStream( "HandleRef.txt", FileMode.Open );
  HandleRef hr = new HandleRef( fs, fs.Handle );
  StringBuilder buffer = new StringBuilder( 5 );
  int read = 0;
  // platform invoke will hold reference to HandleRef until call ends
  ReadFile( hr, buffer, 5, out read, 0 );