Visual C++备忘录
来源:互联网 发布:哪个软件可以播音 编辑:程序博客网 时间:2024/06/06 14:12
我爱北京天安门
天安门上太阳升
伟大领袖毛主席
指引我们向前进
<p><strong>有些东西,说来好简单,但有时老记不清,拿不准.在此作些备忘录.不要说它"简单",都多少次了,多么久了,你还老记不住,还敢说简单!</strong></p> <p><strong>1.</strong> CRect (32, 64, 352, 304));</p> <p> CRect (left, top, right, bottom);</p> <p>The four parameters passed to <i>CRect</i>'s constructor specify, in order, the rectangle's left, top, right, and bottom screen coordinates.</p> <p><strong>2.</strong> How to disable a "Windows Style" when creating a window?</p> <p>Create (NULL, _T ("Hello"), ~WS_MAXIMIZEBOX & WS_OVERLAPPEDWINDOW | WS_VSCROLL | WS_HSCROLL);</p> <p>Note this: <strong>~WS_MAXIMIZEBOX &</strong> </p> <p>That's the trick!</p> <p><strong>3.</strong> The different character process between ANSI and Unicode:</p><pre>use the ANSI character set:</pre><pre>char szMsg[256]; pWnd->GetWindowText (szMsg, sizeof (szMsg)); strcat (szMsg, " is the window title"); MessageBox (szMsg);</pre><pre>use the Unicode character set:</pre><pre>TCHAR szMsg[256]; pWnd->GetWindowText (szMsg, sizeof (szMsg) / sizeof (TCHAR)); _tcscat (szMsg, _T (" is the window title")); MessageBox (szMsg);</pre>