﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-    Update 牌...@ Blog-随笔分类-VC界面</title><link>http://www.cppblog.com/Lee7/category/9818.html</link><description>  当华美的叶片落尽，生命的脉络才历历可见。 －－ 聂鲁达    
</description><language>zh-cn</language><lastBuildDate>Thu, 16 Jul 2009 09:54:12 GMT</lastBuildDate><pubDate>Thu, 16 Jul 2009 09:54:12 GMT</pubDate><ttl>60</ttl><item><title>VC6.0实现鼠标显示按钮功能提示文本</title><link>http://www.cppblog.com/Lee7/archive/2009/07/16/90229.html</link><dc:creator>isabc</dc:creator><author>isabc</author><pubDate>Thu, 16 Jul 2009 07:04:00 GMT</pubDate><guid>http://www.cppblog.com/Lee7/archive/2009/07/16/90229.html</guid><wfw:comment>http://www.cppblog.com/Lee7/comments/90229.html</wfw:comment><comments>http://www.cppblog.com/Lee7/archive/2009/07/16/90229.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Lee7/comments/commentRss/90229.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Lee7/services/trackbacks/90229.html</trackback:ping><description><![CDATA[<div class="Section0">
<p class="p0" style="margin-bottom: 5pt; margin-top: 5pt; line-height: 140%;"><span style="font-size: 9pt; font-family: 'Times New Roman';">本文以</span><span><a  href="http://www.itwis.com/html/c/ctool/"><span style="color: #0000ff; text-decoration: underline; font-size: 9pt; font-family: 'Times New Roman';">VC6.0</span></a></span><span style="font-size: 9pt; font-family: 'Times New Roman';">对话框应用程序为例，当鼠标在按钮上移动、按下或者弹起时显示按钮功能提示文本，本文将在按钮上显示功能提示文本：<font face="Times New Roman">&#8220;IT</font><font face="宋体">知道网</font><font face="Times New Roman">&#8221;</font><font face="宋体">。</font></span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">在<font face="Times New Roman">CXXXDlg.h</font><font face="宋体">文件中定义：</font></span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">public:</span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">&nbsp;&nbsp;CToolTipCtrl&nbsp;m_openToolTip;&nbsp;</span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">&nbsp;</span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">在<font face="Times New Roman">CXXXDlg.cpp</font><font face="宋体">的</font><font face="Times New Roman">OnInitDialog()</font><font face="宋体">中初始化：&nbsp;</font></span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">&nbsp;m_openToolTip.Create(this);&nbsp;</span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">&nbsp;m_openToolTip.AddTool(&nbsp;GetDlgItem(IDC_BOTTON),&nbsp;"IT<font face="宋体">知道网</font><font face="Times New Roman">"&nbsp;);</font></span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">&nbsp;m_openToolTip.SetDelayTime(200);</span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">&nbsp;m_openToolTip.SetTipTextColor(&nbsp;#0000ff&nbsp;);</span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">&nbsp;m_openToolTip.SetTipBkColor(&nbsp;#ffffff);</span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">&nbsp;m_openToolTip.Activate(TRUE);</span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">&nbsp;</span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">重载函数<font face="Times New Roman">PreTranslateMessage</font></span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">BOOL&nbsp;CXXXDlg::PreTranslateMessage(MSG*&nbsp;pMsg)</span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">{</span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">&nbsp;//&nbsp;TODO:&nbsp;Add&nbsp;your&nbsp;specialized&nbsp;code&nbsp;here&nbsp;and/or&nbsp;call&nbsp;the&nbsp;base&nbsp;class</span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">&nbsp;switch(pMsg-&gt;message)</span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">&nbsp;{</span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">&nbsp;case&nbsp;WM_LBUTTONDOWN:</span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">&nbsp;case&nbsp;WM_LBUTTONUP:</span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">&nbsp;case&nbsp;WM_MOUSEMOVE:</span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">&nbsp;&nbsp;m_openToolTip.RelayEvent(pMsg);</span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">&nbsp;}</span><span style="font-size: 9pt; font-family: 'Times New Roman';"><o:p></o:p></span></p>
<p class="p0" style="margin-bottom: 0pt; margin-top: 0pt;"><span style="font-size: 9pt; font-family: 'Times New Roman';">&nbsp;return&nbsp;CDialog::PreTranslateMessage(pMsg);</span><span style="font-size: 9pt; font-family: 'Times New Roman';"><br></span><span style="font-size: 9pt; font-family: 'Times New Roman';">}&nbsp;</span><span style="font-size: 10.5pt; font-family: 'Times New Roman';"><o:p></o:p></span></p>
</div><img src ="http://www.cppblog.com/Lee7/aggbug/90229.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Lee7/" target="_blank">isabc</a> 2009-07-16 15:04 <a href="http://www.cppblog.com/Lee7/archive/2009/07/16/90229.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>GetWindowRect，GetClientRect，ScreenToClient MoveWindow SetWindowPos 用法说明</title><link>http://www.cppblog.com/Lee7/archive/2009/05/29/86070.html</link><dc:creator>isabc</dc:creator><author>isabc</author><pubDate>Fri, 29 May 2009 07:51:00 GMT</pubDate><guid>http://www.cppblog.com/Lee7/archive/2009/05/29/86070.html</guid><wfw:comment>http://www.cppblog.com/Lee7/comments/86070.html</wfw:comment><comments>http://www.cppblog.com/Lee7/archive/2009/05/29/86070.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Lee7/comments/commentRss/86070.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Lee7/services/trackbacks/86070.html</trackback:ping><description><![CDATA[<span style="font-weight: bold;">GetWindowRect() </span>得到的是在屏幕坐标系下的RECT（即以屏幕左上角为原点）<br>
&nbsp;&nbsp;&nbsp;<br>
<span style="font-weight: bold;">GetClientRect() </span>得到的是在客户区坐标系下的RECT（即以所在窗口左上角为原点，去掉了标题栏计算，仅仅是个大小，返回值的左上角永远为0，0） <br>
&nbsp;&nbsp;<br>
<span style="font-weight: bold;">ScreenToClient()</span> 就是把屏幕坐标系下的RECT坐标转换为客户区坐标系下的RECT坐标。<br><br> void &nbsp; MoveWindow( &nbsp; int &nbsp; x, &nbsp; int &nbsp; y, &nbsp; int &nbsp; nWidth, &nbsp; int &nbsp; nHeight, &nbsp; BOOL &nbsp; bRepaint &nbsp; = &nbsp; TRUE &nbsp; ); &nbsp; <br> &nbsp; void &nbsp; MoveWindow( &nbsp; LPCRECT &nbsp; lpRect, &nbsp; BOOL &nbsp; bRepaint &nbsp; = &nbsp; TRUE &nbsp; ); &nbsp; <br> &nbsp; 参数 &nbsp; <br> &nbsp; x指定了CWnd的左边的新位置。 &nbsp; <br> &nbsp; y指定了CWnd的顶部的新位置。 &nbsp; <br> &nbsp; nWidth指定了CWnd的新宽度。 &nbsp; <br> &nbsp; nHeight指定了CWnd的新高度。 &nbsp; <br>
&nbsp;
bRepaint指定了是否要重画CWnd。如果为TRUE，则CWnd象通常那样在OnPaint消息处理函数中接收到一条WM_PAINT消息。如果
这个参数为FALSE，则不会发生任何类型的重画操作。这应用于客户区、非客户区（包括标题条和滚动条）和由于CWnd移动而露出的父窗口的任何部分。当
这个参数为FALSE的时候，应用程序必须明确地使CWnd和父窗口中必须重画的部分无效或重画。lpRectCRect对象或RECT结构，指定了新的
大小和位置。说明这个函数改变窗口的位置和大小。对于顶层的CWnd对象，x和y参数是相对于屏幕的左上角的。对于子对象，它们是相对于父窗口客户区的左
上角的。 &nbsp; <br> &nbsp;
MoveWindow函数发送一条WM_GETMINMAXINFO消息。处理这个消息时，CWnd得到一个改变最大和最小的窗口缺省值的机会。如果传递
给MoveWindow成员函数的参数超过了这些值，则在WM_GETMINMAXINFO处理函数中可以用最小或最大值来代替这些值。 &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp;  &nbsp; <br>
&nbsp; CWnd::SetWindowPosBOOL &nbsp; SetWindowPos( &nbsp; const &nbsp; CWnd* &nbsp;
pWndInsertAfter, &nbsp; int &nbsp; x, &nbsp; int &nbsp; y, &nbsp; int &nbsp; cx, &nbsp; int &nbsp; cy,UINT &nbsp;
nFlags &nbsp; ); &nbsp; <br> &nbsp; 返回值如果函数成功，则返回非零值；否则返回0。 &nbsp; <br> &nbsp;
参数pWndInsertAfter标识了在Z轴次序上位于这个CWnd对象之前的CWnd对象。这个参数可以是指向CWnd对象的指针，也可以是指向下
列值的指针：l &nbsp; wndBottom &nbsp; &nbsp; &nbsp;
将窗口放在Z轴次序的底部。如果这个CWnd是一个顶层窗口，则窗口将失去它的顶层状态；系统将这个窗口放在其它所有窗口的底部。l &nbsp; wndTop
&nbsp; &nbsp; &nbsp; 将窗口放在Z轴次序的顶部。l &nbsp; wndTopMost &nbsp; &nbsp; &nbsp;
将窗口放在所有非顶层窗口的上面。这个窗口将保持它的顶层位置，即使它失去了活动状态。wndNoTopMost &nbsp; &nbsp; &nbsp;
将窗口重新定位到所有非顶层窗口的顶部（这意味着在所有的顶层窗口之下）。这个标志对那些已经是非顶层窗口的窗口没有作用。有关这个函数以及这些参数的使
用规则参见说明部分。x指定了窗口左边的新位置。y指定了窗口顶部的新位置。cx指定了窗口的新宽度。cy指定了窗口的新高度。nFlags指定了大小和
位置选项。这个参数可以是下列值的组合：l &nbsp; SWP_DRAWFRAME &nbsp; &nbsp; &nbsp; 围绕窗口画出边框（在创建窗口的时候定义）。l &nbsp;
SWP_FRAMECHANGED &nbsp; &nbsp; &nbsp;
向窗口发送一条WM_NCCALCSIZE消息，即使窗口的大小不会改变。如果没有指定这个标志，则仅当窗口的大小发生变化时才发送
WM_NCCALCSIZE消息。l &nbsp; SWP_HIDEWINDOW &nbsp; &nbsp; &nbsp; 隐藏窗口。SWP_NOACTIVATE &nbsp; &nbsp; &nbsp;
不激活窗口。如果没有设置这个标志，则窗口将被激活并移动到顶层或非顶层窗口组（依赖于pWndInsertAfter参数的设置）的顶部。l &nbsp;
SWP_NOCOPYBITS &nbsp; &nbsp; &nbsp;
废弃这个客户区的内容。如果没有指定这个参数，则客户区的有效内容将被保存，并在窗口的大小或位置改变以后被拷贝回客户区。l &nbsp;
SWP_NOMOVE &nbsp; &nbsp; &nbsp; 保持当前的位置（忽略x和y参数）。l &nbsp; SWP_NOOWNERZORDER &nbsp; &nbsp; &nbsp;
不改变拥有者窗口在Z轴次序上的位置。l &nbsp; SWP_NOREDRAW &nbsp; &nbsp; &nbsp;
不重画变化。如果设置了这个标志，则不发生任何种类的变化。这适用于客户区、非客户区（包括标题和滚动条）以及被移动窗口覆盖的父窗口的任何部分。当这个
标志被设置的时候，应用程序必须明确地无效或重画要重画的窗口和父窗口的任何部分。l &nbsp; SWP_NOREPOSITION &nbsp; &nbsp; &nbsp;
与SWP_NOOWNERZORDER相同。l &nbsp; SWP_NOSENDCHANGING &nbsp; &nbsp; &nbsp;
防止窗口接收WM_WINDOWPOSCHANGING消息。l &nbsp; SWP_NOSIZE &nbsp; &nbsp; &nbsp; 保持当前的大小（忽略cx和cy参数）。l
&nbsp; SWP_NOZORDER &nbsp; &nbsp; &nbsp; 保持当前的次序（忽略pWndInsertAfter）。l &nbsp; SWP_SHOWWINDOW &nbsp; &nbsp;
&nbsp; 显示窗口。 &nbsp; <br> &nbsp;  &nbsp; <br> &nbsp;
调用这个成员函数以改变子窗口、弹出窗口和顶层窗口的大小、位置和Z轴次序。窗口在屏幕上按照它们的Z轴次序排序。在Z轴次序上处于顶端的窗口将程序在所
有其它窗口的顶部。子窗口的所有坐标都是客户坐标（相对于父窗口客户区的左上角）。窗口可以被移动到Z轴次序的顶部，既可以通过将
pWndInsertAfter参数设为&amp;wndTopMost，并确保没有设置SWP_NOZORDER标志，也可以通过设置窗口的Z轴次序使
它位于所有现存的顶层窗口上方。当一个非顶层窗口被设为顶层窗口时，它拥有的窗口也被设为顶层的。它的拥有者不发生变化。如果顶层窗口被重新定位到Z轴次
序的底部（&amp;wndBottom）或任何非顶层窗口之后，则它将不再是顶层窗口。当顶层窗口被变为非顶层窗口时，它所有的拥有者和它拥有的所有窗
口都被变为非顶层窗口。如果既没有指定SWP_NOACTIVE标志也没有指定SWP_NOZORDER标志（这意味着应用程序要求窗口被同时激活并放入
指定的Z轴次序），则pWndInsertAfter参数中指定的值将只在下列环境下适用：l &nbsp;
在pWndInsertAfter参数中既没有指定&amp;wndTopMost也没有指定&amp;wndNoTopMost。 &nbsp; <br>
&nbsp;
这个窗口不是活动窗口。应用程序不能激活一个非活动窗口但同时又不把它带到Z轴次序的顶部。应用程序可以没有任何限制地改变活动窗口的Z轴次序。非顶层窗
口可能拥有一个顶层窗口，但是反之则不成立。任何被顶层窗口拥有的窗口（例如对话框）都将自己变为顶层窗口，以确保所有被拥有的窗口位于它们的拥有者上
方。在Windows &nbsp;
3.1或更新的版本中，可以将窗口移动到Z轴次序的顶部，并通过设置它们的WS_EX_TOPMOST风格而将之锁定在那里。这种顶层窗口即使在失去活动
状态以后也会保持顶层位置。例如，选择WinHelp的Always &nbsp; On &nbsp;
Top命令会使帮助窗口变为顶层，并且在你返回应用程序之后它还保持可见。要创建一个顶层窗口，应在调用SetWindowPos的时候将
pWndInsertAfter参数设为&amp;wndTopMost，或者在创建窗口的时候设置WS_EX_TOPMOST风格。如果Z轴次序中包含
了任何具有WS_EX_TOPMOST风格的窗口，则用&amp;wndTopMost移动的窗口将被放到所有非顶层窗口的顶部，但是位于任何顶层窗口的
下面。当应用程序激活一个不具有WS_EX_TOPMOST风格的非活动窗口时，该窗口将被移动到所有非顶层窗口的上方，但是位于所有顶层窗口的下方。如
果在调用SetWindowPos的时候pWndInsertAfter参数被设为&amp;wndBottom，并且CWnd是一个顶层窗口，则该窗口
失去顶层状态（WS_EX_BOTTOM风格被清除），并且系统将窗口放在Z轴次序的底部。&nbsp; <br><img src ="http://www.cppblog.com/Lee7/aggbug/86070.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Lee7/" target="_blank">isabc</a> 2009-05-29 15:51 <a href="http://www.cppblog.com/Lee7/archive/2009/05/29/86070.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>VC6.0使用GDI+的方法及初始化工作</title><link>http://www.cppblog.com/Lee7/archive/2009/04/28/81292.html</link><dc:creator>isabc</dc:creator><author>isabc</author><pubDate>Tue, 28 Apr 2009 01:57:00 GMT</pubDate><guid>http://www.cppblog.com/Lee7/archive/2009/04/28/81292.html</guid><wfw:comment>http://www.cppblog.com/Lee7/comments/81292.html</wfw:comment><comments>http://www.cppblog.com/Lee7/archive/2009/04/28/81292.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Lee7/comments/commentRss/81292.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Lee7/services/trackbacks/81292.html</trackback:ping><description><![CDATA[
<span style="font-family: simsun; font-size: 14px; line-height: 23px; "><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 14px; line-height: 23px; margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; "></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 14px; line-height: 23px; margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; ">GDI+是Windows XP中的一个子系统，它主要负责在显示屏幕和打印设备输出有关信息，它是一组通过C++类实现的应用程序编程接口。顾名思义，GDI+是以前版本GDI的继承者，出于兼容性考虑，Windows XP仍然支持以前版本的GDI，但是在开发新应用程序的时候，开发人员为了满足图形输出需要应该使用GDI+，因为GDI+对以前的Windows版本中GDI进行了优化，并添加了许多新的功能。</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 14px; line-height: 23px; margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; ">&#160;&#160;&#160;&#160; 遗憾的是，VC6.0并不能直接使用GDI+，下面介绍一种很方便的在VC6.0中使用GDI+的方法。步骤如下：</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 14px; line-height: 23px; margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; ">1.将GDI+.rar将其中的Includes和Lib中的文件拷到vc目录下的Includes和Lib文件夹中；</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 14px; line-height: 23px; margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; ">&#160; GDI+ for VC6.0 SDK下载地址：</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 14px; line-height: 23px; margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; ">&#160;&#160;<a href="http://www.codeguru.com/code/legacy/gdi/GDIPlus.zip" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(102, 102, 102); text-decoration: none; ">http://www.codeguru.com/code/legacy/gdi/GDIPlus.zip</a></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 14px; line-height: 23px; margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; ">2.在你将要使用GDI+的工程中，完成初始化工作：</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 14px; line-height: 23px; margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; ">将以下代码加入StdAfx.h头文件中：</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 14px; line-height: 23px; margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; ">//加入的头文件<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">#include &lt;comdef.h>//初始化一下com口</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 14px; line-height: 23px; margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; ">#ifndef ULONG_PTR<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">#define ULONG_PTR unsigned long*<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">#include "GdiPlus.h"<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">using namespace Gdiplus;<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">#endif<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">//结束</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 14px; line-height: 23px; margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; "><br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">3.在程序初始化部分加入</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 14px; line-height: 23px; margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; ">//gdi+用到的两个变量<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">&#160;&#160;&#160; GdiplusStartupInput m_gdiplusStartupInput;<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">&#160;&#160;&#160; ULONG_PTR m_pGdiToken;<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">&#160;&#160;&#160; //装载gdi+<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">&#160;&#160;&#160; GdiplusStartup(&amp;m_pGdiToken,&amp;m_gdiplusStartupInput,NULL);</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 14px; line-height: 23px; margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; ">4在程序退出部分前加入</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 14px; line-height: 23px; margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; ">&#160;&#160;&#160; //卸载gdi+<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; GdiplusShutdown(m_pGdiToken);</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 14px; line-height: 23px; margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; ">5在Project->stting->Link->Object/libary中加入gdiplus.lib</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 14px; line-height: 23px; margin-top: 15px; margin-right: 0px; margin-bottom: 15px; margin-left: 0px; ">这样你的工程就可以使用GDI+了，没什么技术含量吧!</p><p>&#160;</p></span><img src ="http://www.cppblog.com/Lee7/aggbug/81292.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Lee7/" target="_blank">isabc</a> 2009-04-28 09:57 <a href="http://www.cppblog.com/Lee7/archive/2009/04/28/81292.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>vc中对话框背景色的设置</title><link>http://www.cppblog.com/Lee7/archive/2009/04/27/81273.html</link><dc:creator>isabc</dc:creator><author>isabc</author><pubDate>Mon, 27 Apr 2009 14:47:00 GMT</pubDate><guid>http://www.cppblog.com/Lee7/archive/2009/04/27/81273.html</guid><wfw:comment>http://www.cppblog.com/Lee7/comments/81273.html</wfw:comment><comments>http://www.cppblog.com/Lee7/archive/2009/04/27/81273.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Lee7/comments/commentRss/81273.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Lee7/services/trackbacks/81273.html</trackback:ping><description><![CDATA[<span style="font-size: 12pt;">一个基于对话框的MFC AppWizard应用程序中，如何改变对话框的背景颜色呢？对于这个问题，其实可以 由几种不同的方法来实现，具体如下（粗斜体代码为增添的）：<br>---- 方法一：调用CWinApp类的成员函数SetDialogBkColor来实现。<br>---- 其中函数的第一个参数指定了背景颜色，第二个参数指定了文本颜色。下面的例子是将应用程序对话 框设置为蓝色背景和红色文本，步骤如下：<br>---- ① 新建一个基于Dialog的MFC AppWizard应用程序ExampleDlg。<br>---- ② 在CExampleDlgApp ::InitInstance()中添加如下代码：<br>BOOL CExampleDlgApp: : InitInstance ( )<br>{<br>&#8230;<br>&nbsp;&nbsp;&nbsp; CExampleDlgDlg dlg;<br>&nbsp;&nbsp;&nbsp; m_pMainWnd = &amp;dlg;<br>//先于DoModal()调用，将对话框设置为蓝色背景、红色文本<br>&nbsp;&nbsp;&nbsp; SetDialogBkColor(#0000ff,#ff0000);<br>&nbsp;&nbsp;&nbsp; int nResponse = dlg.DoModal();<br>&#8230;<br>}<br>---- 编译并运行，此时对话框的背景色和文本色已发生了改变。值得注意的是：在调用DoModal()之前必须 先调用SetDialogBkColor，且此方法是将改变应用程序中所有的对话框颜色，并不能针对某一个指定的对 话框。<br>---- 方法二：重载OnPaint()，即WM_PAINT消息。有关代码如下（以上例工程为准）：<br>void CExampleDlgDlg::OnPaint()<br>{<br>&nbsp;&nbsp;&nbsp; if (IsIconic())<br>&#8230;<br>&nbsp;&nbsp; else<br>&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CRect rect;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CPaintDC dc(this);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GetClientRect(rect);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dc.FillSolidRect(rect,#00ff00);&nbsp; //设置为绿色背景<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CDialog::OnPaint();<br>&nbsp;&nbsp; }<br>---- 方法三：重载OnCtlColor (CDC* pDC, CWnd* pWnd, UINT nCtlColor)，即WM_CTLCOLOR消息。具体 步骤如下（以上例工程为准）：<br>---- ①在CExampleDlgDlg的头文件中，添加一CBrush的成员变量：<br>class CExampleDlgDlg : public CDialog<br>{<br>...<br>protected:<br>CBrush m_brush;<br>...<br>};<br>---- ②在OnInitDialog()函数中添加如下代码：<br>BOOL CExampleDlgDlg::OnInitDialog()<br>{<br>...<br>// TODO: Add extra initialization here<br>m_brush.CreateSolidBrush(#00ff00); // 生成一绿色刷子<br>...<br>}<br>---- ③利用ClassWizard重载OnCtlColor(&#8230;)，即WM_CTLCOLOR消息：<br>HBRUSH CExampleDlgDlg::OnCtlColor<br>(CDC* pDC, CWnd* pWnd, UINT nCtlColor)<br>{<br>/*<br>** 这里不必编写任何代码！<br>**下行代码要注释掉<br>** HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);<br>*/<br>return m_brush;&nbsp;&nbsp; //返加绿色刷子<br>}<br>---- 方法四：还是重载OnCtlColor (CDC* pDC, CWnd* pWnd, UINT nCtlColor)，即WM_CTLCOLOR消息。 具体步骤如下（以上例工程为准）：<br>---- 步骤①、②同上方法三中的步骤①、②。<br>---- 步骤③利用ClassWizard重载OnCtlColor(&#8230;)（即WM_CTLCOLOR消息）时则有些不同：<br>HBRUSH CExampleDlgDlg::OnCtlColor<br>(CDC* pDC, CWnd* pWnd, UINT nCtlColor)<br>{<br>HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);<br>//在这加一条是否为对话框的判断语句<br>if(nCtlColor ==CTLCOLOR_DLG)<br>return m_brush;&nbsp;&nbsp; //返加绿色刷子<br>return hbr;<br>}<br>---- 编译并运行即可。<br>----
关于如何改变对话框背景颜色的问题，可能还有很多种不同方法可以实现，笔者在这仅举出四种常见
的方法。其中方法三的编程似乎有点不太规范，方法四则要比方法三正统些，笔者这样的对比举例是为了
拓宽VC编程爱好者特别是初学者的编程思路，读者可以根据实际情况选用其中的一种。如果再结合《软件
报》2000年第5期中改变对话框上的控件颜色，相信会使您的MFC应用程序"增色"不少。
<p>&nbsp;</p>
<p>另外一种就是用</p>
BOOL CBPCALLView::OnEraseBkgnd(CDC* pDC) <br>{ <br>&nbsp;//可以背景图，画刷等<br>&nbsp;//return CScrollView::OnEraseBkgnd(pDC);<br>}</span><img src ="http://www.cppblog.com/Lee7/aggbug/81273.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Lee7/" target="_blank">isabc</a> 2009-04-27 22:47 <a href="http://www.cppblog.com/Lee7/archive/2009/04/27/81273.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>自绘控件示例说明</title><link>http://www.cppblog.com/Lee7/archive/2009/03/16/76732.html</link><dc:creator>isabc</dc:creator><author>isabc</author><pubDate>Mon, 16 Mar 2009 06:18:00 GMT</pubDate><guid>http://www.cppblog.com/Lee7/archive/2009/03/16/76732.html</guid><wfw:comment>http://www.cppblog.com/Lee7/comments/76732.html</wfw:comment><comments>http://www.cppblog.com/Lee7/archive/2009/03/16/76732.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Lee7/comments/commentRss/76732.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Lee7/services/trackbacks/76732.html</trackback:ping><description><![CDATA[<p class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 12px; FONT-FAMILY: 新宋体">示例一：</span></p>
<p class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">Step1: </span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">创建对话框工程。<span lang=EN-US><o:p></o:p></span></span></p>
<p class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">Step2: </span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">添加要自绘的按钮，为每个按钮添加一个位图<span lang=EN-US><o:p></o:p></span></span></p>
<p class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">Step3: </span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">添加<span lang=EN-US>WM_DRAWITEM </span>消息的响应函数<span lang=EN-US>OnDrawItem</span>实现具体的自绘，详细实现方式参考函数实现代码<span lang=EN-US><o:p></o:p></span></span></p>
<p class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">Step4: </span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">本示例是根据<span lang=EN-US>ODS_FOCUS</span>状态进行定制。还可以进行其他状态的绘制。控件自绘只需要记住一点<span lang=EN-US>:</span>随时访问<span lang=EN-US>MEASUREITEMSTRUCT</span>数据结构的数据成员是进行自绘的关</span></p>
<p class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left></p>
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" align=top><span style="COLOR: #008000">//</span><span style="COLOR: #008000">通过消息WM_DRAWITEM自绘按纽</span><span style="COLOR: #008000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/None.gif" align=top></span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">&nbsp;CMyBtnDlg::OnDrawItem(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">&nbsp;nIDCtl,&nbsp;LPDRAWITEMSTRUCT&nbsp;lpDrawItemStruct)&nbsp;<br><img id=Codehighlighter1_97_1705_Open_Image onclick="this.style.display='none'; Codehighlighter1_97_1705_Open_Text.style.display='none'; Codehighlighter1_97_1705_Closed_Image.style.display='inline'; Codehighlighter1_97_1705_Closed_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><img id=Codehighlighter1_97_1705_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_97_1705_Closed_Text.style.display='none'; Codehighlighter1_97_1705_Open_Image.style.display='inline'; Codehighlighter1_97_1705_Open_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ContractedBlock.gif" align=top></span><span id=Codehighlighter1_97_1705_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.cppblog.com/Images/dot.gif"></span><span id=Codehighlighter1_97_1705_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">&nbsp;TODO:&nbsp;Add&nbsp;your&nbsp;message&nbsp;handler&nbsp;code&nbsp;here&nbsp;and/or&nbsp;call&nbsp;default</span><span style="COLOR: #008000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;::CDC&nbsp;BtnDC;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;::CBitmap&nbsp;bitmapTrans;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;::BITMAP&nbsp;bmp;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;::CDC&nbsp;mem;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;::CRect&nbsp;rc;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">得到用于绘制按钮的DC(从HDC得到一个CDC)</span><span style="COLOR: #008000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;BtnDC.Attach(lpDrawItemStruct</span><span style="COLOR: #000000">-&gt;</span><span style="COLOR: #000000">hDC);<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">准备用于向按钮区域传输位图</span><span style="COLOR: #008000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;mem.CreateCompatibleDC(</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">BtnDC);<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">获取按钮所占的矩形大小</span><span style="COLOR: #008000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;rc&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;lpDrawItemStruct</span><span style="COLOR: #000000">-&gt;</span><span style="COLOR: #000000">rcItem;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">获取按钮目前所处的状态，根据不同状态绘制不同的按钮</span><span style="COLOR: #008000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;UINT&nbsp;uState&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;lpDrawItemStruct</span><span style="COLOR: #000000">-&gt;</span><span style="COLOR: #000000">itemState;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">如果是按钮已经得到焦点，绘制选中状态下的按钮</span><span style="COLOR: #008000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">if</span><span style="COLOR: #000000">(uState&nbsp;</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">&nbsp;ODS_FOCUS)<br><img id=Codehighlighter1_530_1128_Open_Image onclick="this.style.display='none'; Codehighlighter1_530_1128_Open_Text.style.display='none'; Codehighlighter1_530_1128_Closed_Image.style.display='inline'; Codehighlighter1_530_1128_Closed_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_530_1128_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_530_1128_Closed_Text.style.display='none'; Codehighlighter1_530_1128_Open_Image.style.display='inline'; Codehighlighter1_530_1128_Open_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_530_1128_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.cppblog.com/Images/dot.gif"></span><span id=Codehighlighter1_530_1128_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">该函数从模块的可执行文件中加载指定的位图资源</span><span style="COLOR: #008000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bitmapTrans.LoadBitmap(IDB_GETFOCUS);</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">切记是位图ID<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">本函数用于查看CBitmap对象的信息。返回的信息存放<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">在pBitMap指向的BITMAP结构中。</span><span style="COLOR: #008000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bitmapTrans.GetBitmap(</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">bmp);<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">该函数选择一对象到指定的设备上下文环境中，该新对象替换先前的相同类型的对象。</span><span style="COLOR: #008000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;::CBitmap&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">old&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;mem.SelectObject(</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">bitmapTrans);<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">向按钮所在位置传输位图<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">使用StretchBlt的目的是为了让位图随按钮大小而改变</span><span style="COLOR: #008000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BtnDC.StretchBlt(rc.left,rc.top,rc.right,rc.bottom,</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">mem,</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bmp.bmWidth,bmp.bmHeight,SRCCOPY);<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mem.SelectObject(old);<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bitmapTrans.DeleteObject();<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">设置文字背景为透明</span><span style="COLOR: #008000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BtnDC.SetBkMode(TRANSPARENT);<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">绘制按钮标题</span><span style="COLOR: #008000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BtnDC.DrawText(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">已选中</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,&nbsp;</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">rc,&nbsp;DT_CENTER&nbsp;</span><span style="COLOR: #000000">|</span><span style="COLOR: #000000">&nbsp;DT_VCENTER&nbsp;</span><span style="COLOR: #000000">|</span><span style="COLOR: #000000">&nbsp;DT_SINGLELINE);<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #0000ff">else</span><span style="COLOR: #000000"><br><img id=Codehighlighter1_1137_1654_Open_Image onclick="this.style.display='none'; Codehighlighter1_1137_1654_Open_Text.style.display='none'; Codehighlighter1_1137_1654_Closed_Image.style.display='inline'; Codehighlighter1_1137_1654_Closed_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><img id=Codehighlighter1_1137_1654_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1137_1654_Closed_Text.style.display='none'; Codehighlighter1_1137_1654_Open_Image.style.display='inline'; Codehighlighter1_1137_1654_Open_Text.style.display='inline';" src="http://www.cppblog.com/Images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span id=Codehighlighter1_1137_1654_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.cppblog.com/Images/dot.gif"></span><span id=Codehighlighter1_1137_1654_Open_Text><span style="COLOR: #000000">{<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bitmapTrans.LoadBitmap(IDB_LOSTFOCUS);<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bitmapTrans.GetBitmap(</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">bmp);<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;::CBitmap&nbsp;</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">old2&nbsp;</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">&nbsp;mem.SelectObject(</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">bitmapTrans);<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">&nbsp;&nbsp;&nbsp;&nbsp;::CBitmap&nbsp;*old&nbsp;=&nbsp;mem.SelectObject(&amp;bitmapTrans);<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">向按钮所在位置传输位图<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">使用StretchBlt的目的是为了让位图随按钮大小而改变</span><span style="COLOR: #008000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BtnDC.StretchBlt(rc.left,rc.top,rc.right,rc.bottom,</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">mem,</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">,<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bmp.bmWidth,bmp.bmHeight,SRCCOPY);<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">设置文字背景为透明</span><span style="COLOR: #008000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BtnDC.SetBkMode(TRANSPARENT);<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">绘制按钮标题</span><span style="COLOR: #008000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top></span><span style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BtnDC.DrawText(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">未选中</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">,</span><span style="COLOR: #000000">&amp;</span><span style="COLOR: #000000">rc,DT_CENTER&nbsp;</span><span style="COLOR: #000000">|</span><span style="COLOR: #000000">&nbsp;DT_VCENTER&nbsp;</span><span style="COLOR: #000000">|</span><span style="COLOR: #000000">&nbsp;DT_SINGLELINE);<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mem.SelectObject(old2);<br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bitmapTrans.DeleteObject();<br><img src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="COLOR: #000000"><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top><br><img src="http://www.cppblog.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;CDialog::OnDrawItem(nIDCtl,&nbsp;lpDrawItemStruct);<br><img src="http://www.cppblog.com/Images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</span></span></div>
<p class=MsoNormal style="TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 12px; FONT-FAMILY: 新宋体"></span></p>
<img src ="http://www.cppblog.com/Lee7/aggbug/76732.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Lee7/" target="_blank">isabc</a> 2009-03-16 14:18 <a href="http://www.cppblog.com/Lee7/archive/2009/03/16/76732.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于CBitmap的使用</title><link>http://www.cppblog.com/Lee7/archive/2009/03/16/76712.html</link><dc:creator>isabc</dc:creator><author>isabc</author><pubDate>Mon, 16 Mar 2009 02:54:00 GMT</pubDate><guid>http://www.cppblog.com/Lee7/archive/2009/03/16/76712.html</guid><wfw:comment>http://www.cppblog.com/Lee7/comments/76712.html</wfw:comment><comments>http://www.cppblog.com/Lee7/archive/2009/03/16/76712.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Lee7/comments/commentRss/76712.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Lee7/services/trackbacks/76712.html</trackback:ping><description><![CDATA[<p>&nbsp;</p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">在初始化<span lang=EN-US>CBitmap</span>对象时</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">,</span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">常用<span lang=EN-US>Cbitmap</span></span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">::<span style="COLOR: black">LoadBitmap</span>,</span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">即如下两种</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">:<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">BOOL</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"> <span style="COLOR: black">LoadBitmap</span>(<span style="COLOR: black">LPCTSTR</span> <span style="COLOR: black">lpszRecourceName</span>);<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">BOOL</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"> <span style="COLOR: black">LoadBitmap</span>(<span style="COLOR: black">UINT</span> <span style="COLOR: black">nIDResource</span>);<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">MSDN</span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">中的说明为</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">:<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: maroon; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">" </span><span style="FONT-SIZE: 9pt; COLOR: maroon; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">返回值调用成功时返回非零值，否则为。<span lang=EN-US><span style="mso-spacerun: yes">&nbsp; </span><o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp; </span><span style="COLOR: black">lpszResourceName</span></span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">指向一个包含了位图资源名字的字符串（该字符串以<span lang=EN-US>null</span>结尾）。<span lang=EN-US>NIDResource</span>指定位图资源中资源的<span lang=EN-US>ID</span>号。说明本函数从应用的可执行文件中加载由<span lang=EN-US>lpszResourceName</span>指定名字或者由<span lang=EN-US>nIDResource</span>指定的<span lang=EN-US>ID</span>号标志的位图资源。加载的位图被附在<span lang=EN-US>Cbitmap</span>对象上。如果由<span lang=EN-US>lpszResourceName</span>指定名字的对象不存在，或者没有足够的内存加载位图，函数将返回。可以调用函数<span lang=EN-US>CgdiObject</span></span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">::<span style="COLOR: black">DeleteObject</span></span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">删除由<span lang=EN-US>LoadBitmap</span>加载的位图，否则<span lang=EN-US>Cbitmap</span>的析构函数将删除该位图对象。警告</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">在删除位图对象之前，要保证它没有被选到设备上下文中。在<span lang=EN-US>Windows3</span></span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">.1</span><span style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">以及以后的版本中<span style="COLOR: black">，增加了如下的位图：<span lang=EN-US>OBM_UPARROWIORM_DNARROWIOBM_RGARROWIOBM_LFARROWI</span></span><span lang=EN-US> ......<span style="COLOR: maroon">"<o:p></o:p></span></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">刚开始用的时候</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">,</span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">我直接把图像路径名给了</span><span style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"> <span lang=EN-US style="COLOR: black">lpszRecourceName</span><span lang=EN-US>,</span><span style="COLOR: black">可总是不成功</span><span lang=EN-US>.</span><span style="COLOR: black">仔细检查了程序</span><span lang=EN-US>,</span><span style="COLOR: black">也没发现错误</span><span lang=EN-US>.</span><span style="COLOR: black">可为什么呢</span><span lang=EN-US>?...<span style="COLOR: black">CSDN</span></span><span style="COLOR: black">一查才发现问题出在</span> <span lang=EN-US style="COLOR: black">lpszRecourceName</span><span style="COLOR: black">上</span><span lang=EN-US>. <span style="COLOR: black">lpszRecourceName</span></span><span style="COLOR: black">按字面意思好像是</span><span lang=EN-US style="COLOR: maroon">"</span><span style="COLOR: maroon">指向资源的名称字符串<span lang=EN-US>"</span></span><span lang=EN-US>,</span><span style="COLOR: black">可实际呢</span><span lang=EN-US>?</span><span style="COLOR: black">却不是一般理解的磁盘上的资源文件名</span><span lang=EN-US>,</span><span style="COLOR: black">而是<span lang=EN-US>VC</span>工程内部已导入的资源名</span><span lang=EN-US>,</span><span style="COLOR: black">所以把外部文件的名称赋给它当然不成功了</span><span lang=EN-US>.</span><span style="COLOR: black">问题怎么解决呢</span><span lang=EN-US>?---</span><span style="COLOR: black">用<span lang=EN-US>API</span>函数<span lang=EN-US>HBITMAP</span></span><span lang=EN-US> <span style="COLOR: black">LoadImage</span>(<span style="COLOR: maroon">"</span></span><span style="COLOR: maroon">文件名<span lang=EN-US>"</span></span><span lang=EN-US>);</span><span style="COLOR: black">不过改函数返回的是指向<span lang=EN-US>Load</span>图片的句柄</span><span lang=EN-US>,</span><span style="COLOR: black">所以需要用到<span lang=EN-US>CBitmap</span>的<span lang=EN-US>Attach</span>方法</span><span lang=EN-US>:<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: green; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">//</span><span style="FONT-SIZE: 9pt; COLOR: green; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">直接从外部文件加载图片<span lang=EN-US><o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: green; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">HBITMAP</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"> <span style="COLOR: black">bitmap</span>;<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">bitmap</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">=(<span style="COLOR: black">HBITMAP</span>)<span style="COLOR: black">LoadImage</span>(<span style="COLOR: black">AfxGetInstanceHandle</span>(),<span style="COLOR: black">strFileName</span>,<span style="COLOR: black">IMAGE_BITMAP</span>,0,0,<span style="COLOR: black">LR_LOADFROMFILE</span>);<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">m_backBitmap</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">.<span style="COLOR: black">DeleteObject</span>();<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">if</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">(!<span style="COLOR: black">m_backBitmap</span>.<span style="COLOR: black">Attach</span>(<span style="COLOR: black">bitmap</span>))<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">{<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: black">MessageBox</span>(<span style="COLOR: maroon">"</span></span><span style="FONT-SIZE: 9pt; COLOR: maroon; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">导入背景图失败<span lang=EN-US>!"</span></span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">,<span style="COLOR: maroon">"</span></span><span style="FONT-SIZE: 9pt; COLOR: maroon; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">提示<span lang=EN-US>"</span></span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">,<span style="COLOR: black">MB_OK</span>);<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: blue">return</span>;<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">}<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">****************************************<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: blue; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">void</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"> <span style="COLOR: black">CitemView</span>::<span style="COLOR: black">getBitMap</span>( <span style="COLOR: black">CDC</span> *<span style="COLOR: black">pDC</span> )<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">{<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: black">CDC</span><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><span style="COLOR: black">MemDC</span>;<span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: black">HBITMAP</span><span style="mso-spacerun: yes">&nbsp; </span><span style="COLOR: black">hBmp</span>;<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: black">BITMAP</span><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><span style="COLOR: black">bm</span>;<span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: black">CBitmap</span><span style="mso-spacerun: yes">&nbsp; </span><span style="COLOR: black">Bitmap</span>;<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: black">CPoint</span> <span style="COLOR: black">point</span>( 10, 10);<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: black">CString</span> <span style="COLOR: black">cStr</span>;<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: green">//hBmp = (HBITMAP)::LoadImage(NULL,"BG.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);<o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: black">hBmp</span> = (<span style="COLOR: black">HBITMAP</span>)::<span style="COLOR: black">LoadImage</span>(<span style="COLOR: black">AfxGetInstanceHandle</span>(),<span style="COLOR: maroon">"BG.bmp"</span>,<span style="COLOR: black">IMAGE_BITMAP</span>,0,0,<span style="COLOR: black">LR_LOADFROMFILE</span>);<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: black">Bitmap</span>.<span style="COLOR: black">DeleteObject</span>();<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: black">Bitmap</span>.<span style="COLOR: black">Attach</span>( <span style="COLOR: black">hBmp</span> );<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: black">Bitmap</span>.<span style="COLOR: black">GetObject</span>(<span style="COLOR: blue">sizeof</span>(<span style="COLOR: black">BITMAP</span>),&amp;<span style="COLOR: black">bm</span>);<span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: black">MemDC</span>.<span style="COLOR: black">CreateCompatibleDC</span>(<span style="COLOR: black">pDC</span>);<span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: black">MemDC</span>.<span style="COLOR: black">SelectObject</span>(&amp;<span style="COLOR: black">Bitmap</span>);<span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: black">pDC</span>-&gt;<span style="COLOR: black">BitBlt</span>(<span style="COLOR: black">point</span>.<span style="COLOR: black">x</span>, <span style="COLOR: black">point</span>.<span style="COLOR: black">y</span>, <span style="COLOR: black">bm</span>.<span style="COLOR: black">bmWidth</span>, <span style="COLOR: black">bm</span>.<span style="COLOR: black">bmHeight</span>, &amp;<span style="COLOR: black">MemDC</span>, 0, 0, <span style="COLOR: black">SRCCOPY</span>);<span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: black">MemDC</span>.<span style="COLOR: black">DeleteDC</span>();<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">}<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">***************************************************<o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">请问<span lang=EN-US>LoadBitmap</span></span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">( <span style="COLOR: black">LPCTSTR</span> <span style="COLOR: black">lpszResourceName</span> )</span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">中<span lang=EN-US>lpszResourceName</span></span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"> </span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">是指哪个名字<span lang=EN-US><o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">BOOL</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"> <span style="COLOR: black">LoadBitmap</span>(<span style="COLOR: black">LPCTSTR</span> <span style="COLOR: black">lpszResourceName</span>);<span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">BOOL</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"> <span style="COLOR: black">LoadBitmap</span>(<span style="COLOR: black">UINT</span> <span style="COLOR: black">nIDResource</span>);<span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">nIDResource</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp; </span></span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">是指资源<span lang=EN-US>ID</span></span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">但<span lang=EN-US>lpszResourceName</span>是指什么呢</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">比如：我创建了一个<span lang=EN-US>BITMAP</span>资源<span lang=EN-US>IDB_BITMAP1</span></span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"> ;<span style="mso-spacerun: yes">&nbsp;&nbsp; </span><span style="COLOR: black">lpszResourceName</span></span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">是指什么呢，是硬盘上的<span lang=EN-US>bitmap1</span></span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">.<span style="COLOR: black">bmp</span></span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">吗，如果是，以下代码为什么是错的。<span lang=EN-US><o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">CBitmap</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><span style="COLOR: black">bmp</span>;<span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">bmp</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">.<span style="COLOR: black">LoadBitmap</span>(<span style="COLOR: maroon">"d:\\..\\res\\bitmpa1.bmp"</span>);<span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">CDC</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><span style="COLOR: black">memdc</span>;<span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">BITMAP</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><span style="COLOR: black">bmstru</span>;<span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">bmp</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">.<span style="COLOR: black">GetBitmap</span>(&amp;<span style="COLOR: black">bmstru</span>);<span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">memdc</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">.<span style="COLOR: black">CreateCompatibleDC</span>(<span style="COLOR: black">pDC</span>);<span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">memdc</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">.<span style="COLOR: black">SelectObject</span>(&amp;<span style="COLOR: black">bmp</span>);<span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">pDC</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">-&gt;<span style="COLOR: black">BitBlt</span>(0,0,<span style="COLOR: black">bmstru</span>.<span style="COLOR: black">bmWidth</span>,<span style="COLOR: black">bmstru</span>.<span style="COLOR: black">bmHeight</span>,&amp;<span style="COLOR: black">memdc</span>,0,0,<span style="COLOR: black">SRCCOPY</span>);<span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">用<span lang=EN-US>Notepad</span>打开</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">*.<span style="COLOR: black">rc</span></span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">文件，找到类似下面一行：</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp; </span><span style="COLOR: black">IDB_BITMAP</span><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><span style="COLOR: black">BITMAP</span><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><span style="COLOR: maroon">"res\\background.bmp"</span><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp; </span></span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">改成：</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp; </span><span style="COLOR: black">Bitmap1</span><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><span style="COLOR: black">BITMAP</span><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><span style="COLOR: maroon">"res\background.bmp"</span><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp; </span></span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">或者，在<span lang=EN-US>VC</span>中察看位图资源的属性，将其<span lang=EN-US>ID</span>栏内改为</span><span lang=EN-US style="FONT-SIZE: 9pt; COLOR: maroon; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">"Bitmap"</span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">（注意，一定要加引号）。</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp; </span></span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">然后调用：</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp; </span><span style="COLOR: black">bmp</span>.<span style="COLOR: black">LoadBitmap</span>(<span style="COLOR: maroon">"Bitmap1"</span>);<span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp; </span></span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">保证成功。</span><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align=left><span lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp; </span></span><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 新宋体; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">资源可以用一个整数来标示，也可以用一个字符串标示。但无论如何，这些<span lang=EN-US>ID</span>都不是指位图文件名。不要将它们混淆。<span lang=EN-US><o:p></o:p></span></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US><o:p>&nbsp;</o:p></span></p>
<img src ="http://www.cppblog.com/Lee7/aggbug/76712.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Lee7/" target="_blank">isabc</a> 2009-03-16 10:54 <a href="http://www.cppblog.com/Lee7/archive/2009/03/16/76712.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>CDC类简要描述</title><link>http://www.cppblog.com/Lee7/archive/2009/03/16/76710.html</link><dc:creator>isabc</dc:creator><author>isabc</author><pubDate>Mon, 16 Mar 2009 02:42:00 GMT</pubDate><guid>http://www.cppblog.com/Lee7/archive/2009/03/16/76710.html</guid><wfw:comment>http://www.cppblog.com/Lee7/comments/76710.html</wfw:comment><comments>http://www.cppblog.com/Lee7/archive/2009/03/16/76710.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Lee7/comments/commentRss/76710.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Lee7/services/trackbacks/76710.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: MFC把DC(设备描述环境)和一些GDI函数填充装到一起,形成了一个DCD类.&nbsp;&nbsp;<a href='http://www.cppblog.com/Lee7/archive/2009/03/16/76710.html'>阅读全文</a><img src ="http://www.cppblog.com/Lee7/aggbug/76710.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Lee7/" target="_blank">isabc</a> 2009-03-16 10:42 <a href="http://www.cppblog.com/Lee7/archive/2009/03/16/76710.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>