📄 subject_19219.htm
字号:
<p>
序号:19219 发表者:阿飞 发表日期:2002-10-26 17:59:51
<br>主题:为什么用VC写WIN32 application 时 Month CaLendar 资源无法使用
<br>内容:为什么用VC写WIN32 application 时 Month CaLendar 资源无法使用,怎样可以用呢?
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:凯凯 回复日期:2002-10-26 18:13:11
<br>内容:出现怎样的出错提示?
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:阿飞 回复日期:2002-10-26 18:39:56
<br>内容:听说不能使用,即使加了如下代码也不行<BR>#include "commctrl.h"<BR>#pragma comment(lib,"comctl32.lib") <BR>InitCommonControls();<BR><BR>好象sdk不支持这些资源,不知该怎么办?<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:Guns & Roses 回复日期:2002-10-29 14:07:42
<br>内容:我没用过这个资源<BR>不过我自己创建过这样一个控件可以仿MSDN中的例子:<BR>// CreateMonthCal -- Creates a month calendar control in a dialog box.<BR>// Returns the handle to the month calendar control<BR>// if successful, or NULL otherwise.<BR>//<BR>// hwndOwner -- Handle to the owner of the dialog box.<BR>// g_hinst -- Global handle to the program instance.<BR>// <BR>/////<BR>HWND WINAPI CreateMonthCal(HWND hwndOwner)<BR>{<BR> HWND hwnd;<BR> RECT rc;<BR> INITCOMMONCONTROLSEX icex;<BR><BR> // Load the window class.<BR> icex.dwSize = sizeof(icex);<BR> icex.dwICC = ICC_DATE_CLASSES;<BR> InitCommonControlsEx(&icex);<BR><BR> // Create a modeless dialog box to hold the control.<BR> g_hwndDlg = CreateDialog(g_hinst,<BR> MAKEINTRESOURCE(IDD_DIALOG1),<BR> hwndOwner,<BR> DlgProc);<BR><BR> // Create the month calendar.<BR> hwnd = CreateWindowEx(0,<BR> MONTHCAL_CLASS,<BR> "",<BR> WS_BORDER | WS_CHILD | WS_VISIBLE | MCS_DAYSTATE,<BR> 0,0,0,0, // resize it later<BR> g_hwndDlg,<BR> NULL,<BR> g_hinst,<BR> NULL);<BR><BR> // Get the size required to show an entire month.<BR> MonthCal_GetMinReqRect(hwnd, &rc);<BR><BR>// Arbitrary values<BR>#define LEFT 35<BR>#define TOP 40<BR><BR> // Resize the control now that the size values have been obtained.<BR> SetWindowPos(hwnd, NULL, TOP, LEFT, <BR> LEFT + rc.right, TOP + rc.bottom,<BR> SWP_NOZORDER);<BR><BR> // Set colors for aesthetics.<BR> MonthCal_SetColor(hwnd, MCSC_BACKGROUND, RGB(175,175,175));<BR> MonthCal_SetColor(hwnd, MCSC_MONTHBK, RGB(248,245,225));<BR><BR> return(hwnd);<BR>}<BR><BR>别忘了加上那个Comctl32.dll。<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 + -