⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subject_19219.htm

📁 一些关于vc的问答
💻 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>//&nbsp;&nbsp; CreateMonthCal -- Creates a month calendar control in a dialog box.<BR>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Returns the handle to the month calendar control<BR>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if successful, or NULL otherwise.<BR>//<BR>//&nbsp;&nbsp;&nbsp;&nbsp;hwndOwner&nbsp;&nbsp; -- Handle to the owner of the dialog box.<BR>//&nbsp;&nbsp;&nbsp;&nbsp;g_hinst&nbsp;&nbsp;&nbsp;&nbsp; -- Global handle to the program instance.<BR>//&nbsp;&nbsp; <BR>/////<BR>HWND WINAPI CreateMonthCal(HWND hwndOwner)<BR>{<BR>&nbsp;&nbsp; HWND hwnd;<BR>&nbsp;&nbsp; RECT rc;<BR>&nbsp;&nbsp; INITCOMMONCONTROLSEX icex;<BR><BR>&nbsp;&nbsp; // Load the window class.<BR>&nbsp;&nbsp; icex.dwSize = sizeof(icex);<BR>&nbsp;&nbsp; icex.dwICC&nbsp;&nbsp;= ICC_DATE_CLASSES;<BR>&nbsp;&nbsp; InitCommonControlsEx(&icex);<BR><BR>&nbsp;&nbsp; // Create a modeless dialog box to hold the control.<BR>&nbsp;&nbsp; g_hwndDlg = CreateDialog(g_hinst,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MAKEINTRESOURCE(IDD_DIALOG1),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hwndOwner,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DlgProc);<BR><BR>&nbsp;&nbsp; // Create the month calendar.<BR>&nbsp;&nbsp; hwnd = CreateWindowEx(0,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n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nbsp;&nbsp; // Get the size required to show an entire month.<BR>&nbsp;&nbsp; MonthCal_GetMinReqRect(hwnd, &rc);<BR><BR>// Arbitrary values<BR>#define LEFT 35<BR>#define TOP&nbsp;&nbsp;40<BR><BR>&nbsp;&nbsp; // Resize the control now that the size values have been obtained.<BR>&nbsp;&nbsp; SetWindowPos(hwnd, NULL, TOP, LEFT, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LEFT + rc.right, TOP + rc.bottom,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SWP_NOZORDER);<BR><BR>&nbsp;&nbsp; // Set colors for aesthetics.<BR>&nbsp;&nbsp; MonthCal_SetColor(hwnd, MCSC_BACKGROUND, RGB(175,175,175));<BR>&nbsp;&nbsp; MonthCal_SetColor(hwnd, MCSC_MONTHBK, RGB(248,245,225));<BR><BR>&nbsp;&nbsp; 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 + -