关于win c中的DIB问题?

pzyny 2000-07-30 07:03:00
已经知道了一个bitmap在内存中的地址pointer和size,请问如何才能把这个位图装入一个HBITMAP句柄中去,是否有这样的函数可直接调用?(在vc++环境下编译)
...全文
129 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
halfdream 2000-08-01
  • 打赏
  • 举报
回复

用HBITMAP CreateBitmapIndirect(
CONST BITMAP *lpbm // pointer to the bitmap data
);
其中:typedef struct tagBITMAP { // bm
LONG bmType;
LONG bmWidth;
LONG bmHeight;
LONG bmWidthBytes;
WORD bmPlanes;
WORD bmBitsPixel;
LPVOID bmBits;
} BITMAP;
programer 2000-07-30
  • 打赏
  • 举报
回复
HBITMAP hBitmap=(HBITMAP)pointer
Using DIB Sections in VB An Easy to Use Class for manipulating DIBSections plus a blindingly quick technique for updating the bits Updated! 17 February 1999 The previous version of this code crashed when run under NT4.0. This was because the code was not always clearing up the SAFEARRAY pointer after it had finished using it. Under Win9x, this did not cause a problem but NT is stricter. All the samples and the code are now updated to fix this problem. This is a supporting article describing in more detail the DIB Section techniques used in the vbAccelerator Image Processor. It describes what DIB Sections are, how to use them and provides a class I wrote to wrap up the DIB Section. What is a DIB Section?A DIB (Device Independent Bitmap) Section is a GDI object like a standard DIB but which additionally provides a pointer to the memory used to store the bitmap bits to which the creating application has direct access. This allows ultimate flexibility if you want to modify the bits of a bitmap. Using DIB SectionsA DIB section is created using the GDI CreateDIBSection call. You need to modify the declare provided for this in the VB API guide because this declare assumes you cannot use the pointer to the bitmap returned by the function and simply discards it. Here are the declares you need:Private Type BITMAPINFOHEADER '40 bytes biSize As Long biWidth As Long biHeight As Long biPlanes As Integer biBitCount As Integer biCompression As Long biSizeImage As Long biXPelsPerMeter As Long biYPelsPerMeter As Long biClrUsed As Long biClrImportant As Long End Type Private Type BITMAPINFO bmiHeader As BITMAPINFOHEADER bmiColors As RGBQUAD End Type ' Note - this is not the declare in the API viewer - modify lplpVoid to be ' Byref so we get the pointer back:
What is a DIB Section?
A DIB (Device Independent Bitmap) Section is a GDI object like a standard DIB but which additionally provides a pointer to the memory used to store the bitmap bits to which the creating application has direct access. This allows ultimate flexibility if you want to modify the bits of a bitmap.

Using DIB Sections
A DIB section is created using the GDI CreateDIBSection call. You need to modify the declare provided for this in the VB API guide because this declare assumes you cannot use the pointer to the bitmap returned by the function and simply discards it. Here are the declares you need:


Private Type BITMAPINFOHEADER '40 bytes
biSize As Long
biWidth As Long
biHeight As Long
biPlanes As Integer
biBitCount As Integer
biCompression As Long
biSizeImage As Long
biXPelsPerMeter As Long
biYPelsPerMeter As Long
biClrUsed As Long
biClrImportant As Long
End Type
Private Type BITMAPINFO
bmiHeader As BITMAPINFOHEADER
bmiColors As RGBQUAD
End Type

' Note - this is not the declare in the API viewer - modify lplpVoid to be
' Byref so we get the pointer back:
Private Declare Function CreateDIBSection Lib "gdi32" _
(ByVal hdc As Long, _
pBitmapInfo As BITMAPINFO, _
ByVal un As Long, _
lplpVoid As Long, _
ByVal handle As Long, _
ByVal dw As Long) As Long


To create the DIB Section, you initialise a BITMAPINFO structure with the required fields, which are all in the bmiHeader sub-structure:

Member Required Value
biSize Size of the BITMAPINFO structure
biWidth Width of the DIBSection in pixels

biHeight Height of the DIBSection in pixels

biPlanes Number of colour planes. Set to 1

biBitCount Bits per pixel. Set to 24 for true colour

biCompression Whether to use compression. If you want to work on the bits, set this to BI_RGB so the image is uncompressed
biSizeImage The size of the image in bytes. This is worked out from the width, height, number of bits per pixel. In a 24 bit image there are three bytes per pixel. Additionally, GDI requires that every horizontal line in the image aligns on a four byte boundary. So for a 24 bit image the ImageSize is biWidth*biHeight*3 rounded up to the nearest four bytes. You can round up to the width to the nearest four bytes as follows:
(.biWidth * 3 + 3) And &HFFFFFFFC



This allows you to create a DIB Section. You call CreateDIBSection like this:

hDib = CreateDIBSection( _
lHDC, _
m_tBI, _
DIB_RGB_COLORS, _
m_lPtr, _
0, 0)


Where:

hDib is a variable to receive the GDI handle to the DIB Section
lHDC is a valid DC, for example a Form's DC or the desktop DC

m_tBI is a the BITMAPINFO structure
m_lPtr is a variable to receive the pointer to the memory containing the bitmap bits.

To actually display a DIB Section, you must select it into a DC.

m_hDC = CreateCompatibleDC(0)
If (m_hDC <> 0) Then
If (CreateDIB(m_hDC, lWidth, lHeight, m_hDIb)) Then
m_hBmpOld = SelectObject(m_hDC, m_hDIb)
Create = True
Else
DeleteObject m_hDC
m_hDC = 0
End If
End If



Once it is in a DC you can then use BitBlt to paint it to another device context or to transfer the contents of another device context into it. Remember you must keep track of all the handles created in GDI so you can clear them up again when the DIBSection is no longer needed. To clear up, you need to:

Select the old bitmap (m_hBmpOld) back into the DC.
Delete the DIB section.
Delete the DC.
So far this has created a DIB which you can load with a graphic and display on the screen, but this achieves no more than you can do with a standard bitmap. The good stuff starts when you start modifying the bitmap bits.

Modifying the Bitmap Bits Directly
CreateDIBSection returns an address to the memory containing the bitmap. You can manipulate this directly through VB using a cool technique to make the memory look like a VB Byte array. This technique was originally presented in VBPJ article (Note the original article is no longer easily available). It uses a hidden VB call exposed by MSVBVM50.DLL (which is also available in VB6 - thanks to Paul Wilde for pointing this out) and the ubiquitous CopyMemory call. In my opinion, “CopyMemory” is the best language feature in VB (except that it isn't VB at all!)

Here are the declares you need:

Private Type SAFEARRAY2D
cDims As Integer
fFeatures As Integer
cbElements As Long
cLocks As Long
pvData As Long
Bounds(0 To 1) As SAFEARRAYBOUND
End Type
Private Declare Function VarPtrArray Lib "msvbvm50.dll" Alias "VarPtr" (Ptr() As Any) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" ( _
lpvDest As Any, lpvSource As Any, ByVal cbCopy As Long)



To make the byte array point to the memory, you have to fill in the SAFEARRAY2D structure and then use CopyMemory as follows:

Dim tSA As SAFEARRAY2D
Dim bDib() As Byte

' Get the bits in the from DIB section:
With tSA
.cbElements = 1
.cDims = 2
.Bounds(0).lLbound = 0
' Height of the bitmap
.Bounds(0).cElements = m_tBI.bmiHeader.biHeight
.Bounds(1).lLbound = 0
' Width of the bitmap in bits (see earlier):
.Bounds(1).cElements = BytesPerScanLine()
.pvData = m_lPtr
End With
' Make the bDib() array point to the memory addresses:
CopyMemory ByVal VarPtrArray(bDib()), VarPtr(tSA), 4



Now the bDib() array is a two dimensional array with the first dimension being the x values and the second being the y values. A 24 bit DIB section is arranged so the bytes run Blue, Green, Red and remember that since the array is padded to a DWORD boundary there may be up to three unused bytes at the end of each row. So, for example, to set the top left pixel to purple you would write this:

bDib(0,0) = 255 ' Blue
bDib(1, 0) = 0 ' Green
bDib(2, y) = 255 ' Red



Once you have finished with the bDib array, you need to be sure to clear up the SAFEARRAY pointer you have created. If you fail to do this, your code will work under Win9x but will crash NT4.0:

CopyMemory ByVal VarPtrArray(bDib), 0&, 4


Enough of That, I Want to Use It
That covers the theory of using DIB Sections. To make it easy, I include a self-contained class (cDibSection) which you can include. The implementation is as follows:

Method Description
BytesPerScanLine Returns the number of bytes horizontally, taking into account the bits per pixel and 4 byte boundary padding.
ClearUp Frees up any GDI objects held by the class. Called automatically when the class terminates.
CopyToClipboard Does as it says!
Create Creates a DIB section of the specified width and height in pixels.
CreateFromPicture Creates a DIB section the same size as a VB picture object and copies the bitmap in it into the DIB section.
DIBSectionBitsPtr Returns the address of the DIBSection's bits in memory.
hdc Returns the memory device context used by the class to hold the DIB Section. You can use this in GDI operations, but do not call DeleteObject on it.
hDib Returns a handle to the DIBSection held by the class. You can use this in GDI operations, but do not call DeleteObject on it.
Height Returns the Height of the DIBSection in pixels.
LoadPictureBlt Copies all or a part of a picture from another Device Context into the DIB section.
PaintPicture Similar to the VB paint picture method, this copies all or part of the DIB section to another device context using the specified Raster Operation.
RandomiseBits Randomises the pixels in the DIB Section, either to random colours or gray scaled.
Resample Resizes the DIB using linear interpolation to create a smoother resized version than you would get if you used StretchBlt.
Width Returns the width of the DIB in pixels.


A Simple Fade Example
This demonstrates how to fade out a bitmap. It should run as a real-time animation, provided the image size isn't too big. I've found that images which are too large don't show as a smooth animation even when the fade code runs quickly enough because BitBlt tends to "tear". This occurs because BitBlt doesn't completely display the bitmap during a single screen refresh and therefore the image is partially displayed before the refresh occurs. To get round this problem you need to use DirectX.

This sample is simplified version of the static and fade example available for download on the Image Processing using DIB Sections page.

To try this sample, create a new project and add the cDIBSection class to it. Copy the declares for CopyMemory, VarPtrArray and SAFEARRAY2D into the project's form.

Then add this sub:

Private Sub Fade( _
ByRef cTo As cDIBSection, _
ByVal lAmount As Long _
)
Dim bDib() As Byte
Dim x As Long, y As Long
Dim xMax As Long, yMax As Long
Dim lB As Long, lG As Long, lR As Long
Dim lA As Long, lA2 As Long
Dim lTIme As Long
Dim tSA As SAFEARRAY2D

' have the local matrix point to bitmap pixels
With tSA
.cbElements = 1
.cDims = 2
.Bounds(0).lLbound = 0
.Bounds(0).cElements = cTo.Height
.Bounds(1).lLbound = 0
.Bounds(1).cElements = cTo.BytesPerScanLine
.pvData = cTo.DIBSectionBitsPtr
End With
CopyMemory ByVal VarPtrArray(bDib), VarPtr(tSA), 4

yMax = cTo.Height - 1
xMax = cTo.Width - 1

For x = 0 To (xMax * 3) Step 3
For y = 0 To yMax
lB = lAmount * bDib(x, y) \ 255
lG = lAmount * bDib(x + 1, y) \ 255
lR = lAmount * bDib(x + 2, y) \ 255
bDib(x, y) = lB
bDib(x + 1, y) = lG
bDib(x + 2, y) = lR
Next y
Next x

CopyMemory ByVal VarPtrArray(bDib), 0&, 4

End Sub


Add a Command Button to the Form, and put this code behind it:

Private Sub Command1_Click()

Dim cDib As New cDibSection
Dim cDibBuffer as New cDibSection
Dim i As Long

' Load the picture to fade:
Set sPic = LoadPicture("Put Your File Here!")
cDib.CreateFromPicture sPic

' Create a copy of it:
cDibBuffer.Create cDib.Width, cDib.Height
cDib.PaintPicture cDibBuffer.HDC

' Fade Loop:
For i = 0 To 255 Step 4
' Fade the dib by amount i:
Fade cDib, i
' Draw it:
cDib.PaintPicture Form1.hDC
' Breathe a little. You may have to put a slowdown here:
DoEvents
' Reset for next fade:
cDibBuffer.PaintPicture cDib.HDC
Next i

End Sub



Now run the code. When you click the button, the image will be faded as fast as your system allows. The code will run slowly in the IDE but will go much much quicker if you compile it to native code. Also, checking all the Advanced Optimisation settings will make it run about 60% faster again! On my machine (PII 266 with 8Mb Xpert@Work card) it does 40fps when working on a 256x256 pixel image.



目录 第一部分 Windows编程基础 第1章 HelloWindowsCE 1.1 WindowsCE标准Windows的差别 1.1.1 WindowsCE和标准Windows的差别 1.1.2 资源有限的WindowsCE设备 1.1.3 Unicode编码 1.1.4 组件化设计 1.1.5 Win32子集 1.2 仍然是Windows编程 1.3 第一个WindowsCE应用程序 1.3.1 创建第一个WindowsCE应用程序 1.3.2 运行程序 1.3.3 出了什么问题 1.4 Hello2程序 1.5 剖析窗口应用程序 1.5.1 窗口 1.5.2 窗口类 1.5.3 窗口过程 1.5.4 消息的生命期 1.5.5 注册窗口 1.5.6 创建窗口 1.5.7 消息循环 1.5.8 窗口过程 1.6 HelloCE 1.7 运行HelloCE 第2章 在屏幕上绘图 2.1 绘图基础 2.1.1 合法和非法区域 2.1.2 设备上下文 2.2 文本输出 2.2.1 设备上下文属性 2.2.2 TextDemo示例程序 2.2.3 字体 2.2.4 未完成的任务 2.3 位图 2.3.1 设备相关位图 2.3.2 设备无关位图 2.3.3 DIB区域 2.3.4 绘制位图 2.3.5 AlphaBlending 2.4 线和形体 2.4.1 线 2.4.2 形体 2.4.3 填充函数 2.4.4 Shapes示例程序 第3章 输入:键盘、鼠标和触摸屏 3.1 键盘 3.1.1 输入焦点 3.1.2 键盘消息 3.1.3 键盘函数 3.1.4 KeyTrac示例程序 3.2 鼠标和触摸屏 3.2.1 鼠标消息 3.2.2 使用触摸屏 3.2.3 TicTacl示例程序 第4章 窗口、控件和菜单 4.1 子窗口 4.2 窗口管理函数 4.2.1 枚举窗口 4.2.2 寻找窗口 4.2.3 移动窗口 4.2.4 编辑窗口结构的内容 4.3 窗口控件 4.3.1 使用控件工作 4.3.2 按钮控件 4.3.3 编辑控件 4.3.4 列表框控件 4.3.5 组合框控件 4.3.6 静态文本控件 4.3.7 滚动条控件 4.3.8 控件和颜色 4.4 菜单 4.5 资源 4.5.1 资源脚本 4.5.2 图标 4.5.3 加速键 4.5.4 位图 4.5.5 字符串 4.6 DOIView示例程序 第5章 通用控件与WindowsCE 5.1 通用控件编程 5.2 通用控件 5.2.1 命令栏 5.2.2 其他菜单控件 5.2.3 日历控件 5.2.4 时间日期选择器控件 5.2.5 列表视图控件 5.2.6 CapEdit控件 5.3 其他一些通用控件 5.4 不支持的通用控件 第6章 对话框和属性表 6.1 对话框 6.1.1 对话框资源模板 6.1.2 创建对话框 6.1.3 对话框过程 6.1.4 非模态的对话框 6.1.5 属性表 6.1.6 通用对话框 6.2 DlgDemo范例程序 第二部分WindOWSCE编程 第7章 内存管理 7.1 内存基础知识 7.1.1 关于RAM 7.1.2 关于ROM 7.1.3 关于虚拟内存 7.1.4 应用程序的地址空间 7.2 不同类型的内存分配 7.2.1 虚拟内存 7.2.2 堆 7.2.3 本地堆 7.2.4 独立堆 7.2.5 栈 7.2.6 静态数据 7.2.7 字符串资源 7.2.8 选择适当的内存类型 7.2.9 管理低内存状态 第8章 模块、进程和线程 8.1 模块 8.2 进程 8.2.1 创建进程 8.2.2 终止进程 8.2.3 其他进程 8.3 线程 8.3.1 系统调度器 8.3.2 创建线程 8.3.3 设置和查询线程优先级 8.3.4 设置线程时间片 8.3.5 挂起和恢复线程 8.4 纤程 8.5 线程本地存储 8.6 同步 8.6.1 事件 8.6.2 等待 8.6.3 信号量 8.6.4 互斥量 8.6.5 复制同步旬柄 8.6.6 临界区 8.6.7 互锁变量访问 8.7 进程间通信 8.7.1 查找其他进程 8.7.2 WM-COPYDATA 8.7.3 命名内存映射对象 8.7.4 点对点消息队列 8.7.5 使用文件和数据库通信 8.8 XTalk示例程序 8.9 异常处理 8.9.1 C++异常处理 8.9.2 Win32异常处理 第9章 WindLOWSCE文件系统 9.1 WindowsCE文件系统API 9.1.1 标准文件VO 9.1.2 内存映射文件 9.1.3 文件系统浏览 9.2 存储处理 9.2.1 对象存储 9.2.2 使用文件API来访问卷 9.2.3 存储管理器 第10章 注册表 10.1 注册表组织 l0.2 注册表API l0.2.1 打开和创建主键 10.2.2 读取注册表值 10.2.3 写人注册表值 10.2.4 删除注册表主键和值 10.2.5 枚举注册表主键 l0.2.6 刷新注册表主键 10.2.7 注册表改动通知 10.2.8 RegView示例程序 第11章 WindowsCE数据库 11.1 两种数据库 11.2 基本概念 11.3 数据库.API 第12章 通知 12.1 用户通知 12.2 计时器事件通知 12.3 系统事件通知 12.4 NoteDemo示例程序 12.5 查询已设定的通知 12.6 气泡通知 12.6.1 添加气泡通知 12.6.2 修改气泡通知 12.6.3 删除气泡通知 第三部分高级WindOWSCE 第13章 windOWSCE网络 13.1 Windows网络支持 13.1.1 WNet函数 13.1.2 ListNet示例程序 13.2 TCP/IP编程 13.2.1 套接字编程 13.2.2 阻塞套接字与非阻塞套接字 第14章 设备间通信 14.1 红外通信 14.1.1 红外基础 14.1.2 设备发现 14.1.3 发布红外服务 14.1.4 查询和设置红外套接字选项 14.1.5 MySquirt示例程序 14.2 蓝牙 14.2.1 蓝牙协议栈 14.2.2 蓝牙发现 14.2.3 发布一个服务 14.2.4 通过WinSock进行蓝牙通信 14.2.5 通过虚拟COM端口进行蓝牙通信 14.2.6 BtSquirt示例程序 第15章 系统程序设计 15.1 WindowsCE的内存体系结构 15.1.1 应用程序的地址空间 15.1.2 内核态的地址空间 15.2 编写跨平台的WindowsCE应用程序 15.2.1 平台与操作系统版本 15.2.2 编译时的版本确定 15.2.3 显式链接 15.2.4 运行时的版本检测 15.3 电源管理 15.3.1 关机的含义 15.3.2 查询电源状态 15.3.3 电源管理器 15.3.4 不使用电源管理器来管理电源 第16章 串行通信 16.1 基本串行通信 16.1.1 打开和关闭串行端口 16.1.2 读写串行端口 16.1.3 异步串行I/O 16.1.4 配置串行端口 16.1.5 设置端口的超时值 16.1.6 查询串行驱动程序的能力 16.1.7 控制串行端口 16.1.8 清除错误并查询状态 16.1.9 保持活动状态 16.2 CeChat示例程序 第17章 设备驱动程序和服务 17.1 驱动程序基础 17.1.1 驱动程序的名称 17.1.2 设备驱动加载过程 17.1.3 枚举活动的驱动? 17.1.4 读写设备驱动 17.2 编写WindowsCE流式设备驱动 17.2.1 流式驱动的入口函数 17.2.2 缓冲区管理 17.2.3 驱动程序接口类 17.2.4 设备驱动程序的电源管理 17.3 设备驱动程序的构建 17.3.1 DebugZone 17.3.2 Gentle驱动程序示例 17.4 服务 17.4.1 服务的体系结构 17.4.2 服务的生命周期 17.4.3 应用程序对服务的控制 17.4.4 服务DLL的人口函数 17.4.5 服务的IOCTL命令 17.4.6 超级服务 17.4.7 Services.exe的命令行 17.4.8 TickSrv示例服务
目录 第一部分 Windows编程基础 第1章 HelloWindowsCE 1.1 WindowsCE标准Windows的差别 1.1.1 WindowsCE和标准Windows的差别 1.1.2 资源有限的WindowsCE设备 1.1.3 Unicode编码 1.1.4 组件化设计 1.1.5 Win32子集 1.2 仍然是Windows编程 1.3 第一个WindowsCE应用程序 1.3.1 创建第一个WindowsCE应用程序 1.3.2 运行程序 1.3.3 出了什么问题 1.4 Hello2程序 1.5 剖析窗口应用程序 1.5.1 窗口 1.5.2 窗口类 1.5.3 窗口过程 1.5.4 消息的生命期 1.5.5 注册窗口 1.5.6 创建窗口 1.5.7 消息循环 1.5.8 窗口过程 1.6 HelloCE 1.7 运行HelloCE 第2章 在屏幕上绘图 2.1 绘图基础 2.1.1 合法和非法区域 2.1.2 设备上下文 2.2 文本输出 2.2.1 设备上下文属性 2.2.2 TextDemo示例程序 2.2.3 字体 2.2.4 未完成的任务 2.3 位图 2.3.1 设备相关位图 2.3.2 设备无关位图 2.3.3 DIB区域 2.3.4 绘制位图 2.3.5 AlphaBlending 2.4 线和形体 2.4.1 线 2.4.2 形体 2.4.3 填充函数 2.4.4 Shapes示例程序 第3章 输入:键盘、鼠标和触摸屏 3.1 键盘 3.1.1 输入焦点 3.1.2 键盘消息 3.1.3 键盘函数 3.1.4 KeyTrac示例程序 3.2 鼠标和触摸屏 3.2.1 鼠标消息 3.2.2 使用触摸屏 3.2.3 TicTacl示例程序 第4章 窗口、控件和菜单 4.1 子窗口 4.2 窗口管理函数 4.2.1 枚举窗口 4.2.2 寻找窗口 4.2.3 移动窗口 4.2.4 编辑窗口结构的内容 4.3 窗口控件 4.3.1 使用控件工作 4.3.2 按钮控件 4.3.3 编辑控件 4.3.4 列表框控件 4.3.5 组合框控件 4.3.6 静态文本控件 4.3.7 滚动条控件 4.3.8 控件和颜色 4.4 菜单 4.5 资源 4.5.1 资源脚本 4.5.2 图标 4.5.3 加速键 4.5.4 位图 4.5.5 字符串 4.6 DOIView示例程序 第5章 通用控件与WindowsCE 5.1 通用控件编程 5.2 通用控件 5.2.1 命令栏 5.2.2 其他菜单控件 5.2.3 日历控件 5.2.4 时间日期选择器控件 5.2.5 列表视图控件 5.2.6 CapEdit控件 5.3 其他一些通用控件 5.4 不支持的通用控件 第6章 对话框和属性表 6.1 对话框 6.1.1 对话框资源模板 6.1.2 创建对话框 6.1.3 对话框过程 6.1.4 非模态的对话框 6.1.5 属性表 6.1.6 通用对话框 6.2 DlgDemo范例程序 第二部分WindOWSCE编程 第7章 内存管理 7.1 内存基础知识 7.1.1 关于RAM 7.1.2 关于ROM 7.1.3 关于虚拟内存 7.1.4 应用程序的地址空间 7.2 不同类型的内存分配 7.2.1 虚拟内存 7.2.2 堆 7.2.3 本地堆 7.2.4 独立堆 7.2.5 栈 7.2.6 静态数据 7.2.7 字符串资源 7.2.8 选择适当的内存类型 7.2.9 管理低内存状态 第8章 模块、进程和线程 8.1 模块 8.2 进程 8.2.1 创建进程 8.2.2 终止进程 8.2.3 其他进程 8.3 线程 8.3.1 系统调度器 8.3.2 创建线程 8.3.3 设置和查询线程优先级 8.3.4 设置线程时间片 8.3.5 挂起和恢复线程 8.4 纤程 8.5 线程本地存储 8.6 同步 8.6.1 事件 8.6.2 等待 8.6.3 信号量 8.6.4 互斥量 8.6.5 复制同步旬柄 8.6.6 临界区 8.6.7 互锁变量访问 8.7 进程间通信 8.7.1 查找其他进程 8.7.2 WM-COPYDATA 8.7.3 命名内存映射对象 8.7.4 点对点消息队列 8.7.5 使用文件和数据库通信 8.8 XTalk示例程序 8.9 异常处理 8.9.1 C++异常处理 8.9.2 Win32异常处理 第9章 WindLOWSCE文件系统 9.1 WindowsCE文件系统API 9.1.1 标准文件VO 9.1.2 内存映射文件 9.1.3 文件系统浏览 9.2 存储处理 9.2.1 对象存储 9.2.2 使用文件API来访问卷 9.2.3 存储管理器 第10章 注册表 10.1 注册表组织 l0.2 注册表API l0.2.1 打开和创建主键 10.2.2 读取注册表值 10.2.3 写人注册表值 10.2.4 删除注册表主键和值 10.2.5 枚举注册表主键 l0.2.6 刷新注册表主键 10.2.7 注册表改动通知 10.2.8 RegView示例程序 第11章 WindowsCE数据库 11.1 两种数据库 11.2 基本概念 11.3 数据库.API 第12章 通知 12.1 用户通知 12.2 计时器事件通知 12.3 系统事件通知 12.4 NoteDemo示例程序 12.5 查询已设定的通知 12.6 气泡通知 12.6.1 添加气泡通知 12.6.2 修改气泡通知 12.6.3 删除气泡通知 第三部分高级WindOWSCE 第13章 windOWSCE网络 13.1 Windows网络支持 13.1.1 WNet函数 13.1.2 ListNet示例程序 13.2 TCP/IP编程 13.2.1 套接字编程 13.2.2 阻塞套接字与非阻塞套接字 第14章 设备间通信 14.1 红外通信 14.1.1 红外基础 14.1.2 设备发现 14.1.3 发布红外服务 14.1.4 查询和设置红外套接字选项 14.1.5 MySquirt示例程序 14.2 蓝牙 14.2.1 蓝牙协议栈 14.2.2 蓝牙发现 14.2.3 发布一个服务 14.2.4 通过WinSock进行蓝牙通信 14.2.5 通过虚拟COM端口进行蓝牙通信 14.2.6 BtSquirt示例程序 第15章 系统程序设计 15.1 WindowsCE的内存体系结构 15.1.1 应用程序的地址空间 15.1.2 内核态的地址空间 15.2 编写跨平台的WindowsCE应用程序 15.2.1 平台与操作系统版本 15.2.2 编译时的版本确定 15.2.3 显式链接 15.2.4 运行时的版本检测 15.3 电源管理 15.3.1 关机的含义 15.3.2 查询电源状态 15.3.3 电源管理器 15.3.4 不使用电源管理器来管理电源 第16章 串行通信 16.1 基本串行通信 16.1.1 打开和关闭串行端口 16.1.2 读写串行端口 16.1.3 异步串行I/O 16.1.4 配置串行端口 16.1.5 设置端口的超时值 16.1.6 查询串行驱动程序的能力 16.1.7 控制串行端口 16.1.8 清除错误并查询状态 16.1.9 保持活动状态 16.2 CeChat示例程序 第17章 设备驱动程序和服务 17.1 驱动程序基础 17.1.1 驱动程序的名称 17.1.2 设备驱动加载过程 17.1.3 枚举活动的驱动? 17.1.4 读写设备驱动 17.2 编写WindowsCE流式设备驱动 17.2.1 流式驱动的入口函数 17.2.2 缓冲区管理 17.2.3 驱动程序接口类 17.2.4 设备驱动程序的电源管理 17.3 设备驱动程序的构建 17.3.1 DebugZone 17.3.2 Gentle驱动程序示例 17.4 服务 17.4.1 服务的体系结构 17.4.2 服务的生命周期 17.4.3 应用程序对服务的控制 17.4.4 服务DLL的人口函数 17.4.5 服务的IOCTL命令 17.4.6 超级服务 17.4.7 Services.exe的命令行 17.4.8 TickSrv示例服务

69,335

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧