📄 subject_58416.htm
字号:
<p>
序号:58416 发表者:赵斗斗 发表日期:2003-10-31 19:30:35
<br>主题:memset(&LogFont,0,sizeof(LOGFONT))这个函数是干什么的?
<br>内容:[例]用向导生成一个”hello world”程序,用下面的程序段代替相应的程序段即可(vc6.0)<BR><BR>case WM_PAINT:<BR><BR> LOGFONT LogFont;<BR><BR>HFONT hHelv,hTmsRmn;<BR><BR>memset(&LogFont,0,sizeof(LOGFONT));<BR>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<BR>LogFont.lfHeight=25;<BR><BR>LogFont.lfWidth=15;<BR><BR>LogFont.lfUnderline=1;<BR><BR>LogFont.lfItalic=1; <BR><BR>lstrcpy(LogFont.lfFaceName,"Helv");<BR><BR>hHelv=CreateFontIndirect(&LogFont);<BR><BR>memset(&LogFont,0,sizeof(LOGFONT));<BR>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`<BR>LogFont.lfHeight=25;<BR><BR>LogFont.lfWidth=15;<BR><BR>LogFont.lfUnderline=1;<BR><BR>LogFont.lfItalic=1;<BR><BR>lstrcpy(LogFont.lfFaceName,"TmsRmn");<BR><BR>hTmsRmn=CreateFontIndirect(&LogFont);<BR><BR><BR>hdc = BeginPaint(hWnd, &ps);<BR><BR> <BR><BR>SelectObject(hdc,hHelv);<BR><BR>TextOut(hdc,20,20,"例子",5);<BR><BR>SelectObject(hdc,hTmsRmn);<BR><BR>TextOut(hdc,5,100,"Times Roman_Underlined and Itatics",34);<BR><BR><BR>EndPaint(hWnd, &ps);<BR><BR>break;<BR><BR><BR>还有HFONT和LOGFONT有什么区别?为什么会有逻辑字体这个东西?<BR>CreateFont(.....)和CreateFontIndirect(......)这两个函数生成的字体有区别吗?<BR>什么时候该用哪一个?<BR><BR><BR>请多指教,谢谢!
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:无情阁东雪 回复日期:2003-10-31 22:26:14
<br>内容: /* MEMSET.C: This program uses memset to<BR> * set the first four bytes of buffer to "*".<BR> */<BR><BR>#include <memory.h><BR>#include <stdio.h><BR><BR>void main( void )<BR>{<BR> char buffer[] = "This is a test of the memset function";<BR><BR> printf( "Before: %s\n", buffer );<BR> memset( buffer, '*', 4 );<BR> printf( "After: %s\n", buffer );<BR>}<BR><BR>Output<BR><BR>Before: This is a test of the memset function<BR>After: **** is a test of the memset function<BR><BR><BR>其余的查MSDN就知道了!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:王明刚 回复日期:2003-10-31 22:31:06
<br>内容:你看看msdn
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:esong 回复日期:2003-11-01 17:46:55
<br>内容:一楼的说得很清楚了。
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -