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

📄 install.html

📁 定时器 的源代码 比较简单 简易使用MFC中的定时器
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<meta http-equiv="Content-Type"       content="text/html;       charset=iso-8859-1">
<meta name="GENERATOR" content="/www/htdocs/earthwalkdesigns//earcgi/EWDHtml.cgi">
<!--                                                       -->
<!--      *******************************************      -->
<!--      *                                         *      -->
<!--      * EarthWalk Designs Programming Services. *      -->
<!--      *        WWW.EarthWalkDesigns.Com         *      -->
<!--      *                                         *      -->
<!--      *  Jay Wheeler (Jay@EarthWalkDesigns.com) *      -->
<!--      *              December 1997              *      -->
<!--      *                                         *      -->
<!--      *******************************************      -->
<!--                                                       -->
<!-- This page was designed by Jay Wheeler. -->
<title>MFC Timers - A Tutorial</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#990033" vlink="#333399" alink="#ff0000">
<font size=" 3 " face=" Century Schoolbook ">
<center>
<a href="http://www.earthwalkdesigns.com"><img src="EarthWalk.gif" border="0" align="center" ></a>
<br>
<font size="+2">
<b>MFC Timers - A Tutorial
</b></font>
<br>
<img src="Colorbar.gif" border="0" align="center" ><br>
</center>
<b><u>Installing Timer Interrupts</u></b>
<p>
<ol type=1>
  <li>In the header file of the dialog using the timer,
  <ol type=A>
    <p>
    <li>Add a message number for each timer needed:
    <p>
    <ul>
      <table border=0>
        <tr >
          <td width=100>#define 
          <td width=150>IDT_TIMER_0 
          <td >WM_USER + 200
        <tr>
          <td width=100>#define
          <td width=150>IDT_TIMER_1 
          <td>IDT_TIMER_0 + 1
      </table>
    </ul>
    <p>
    <li>Add the timer interrupt handler
    <p>
    <ul>
      <b>OnTimer (UINT TimerVal)</b>
    </ul>
    <p>
      to the <i>Generated Message Map</i>:
    <p>
    <ol type=a>
      <li>locate the section under <b>Implementation</b> where the
           <b>AFX_MSG</b> message map is declared (usually begins with the
          line <i>OnInitDialog()</i>);
      <p>
      <li>add a line just after the last line in the message map (just before the 
           "//}}AFX_MSG"):
      <p>
      <ul>
        <table border=0>
          <tr >
            <td width=80><b>afx_msg</b>
            <td width=80><b>void</b>
            <td ><b>OnTimer (UINT TimerVal);</b>
        </table>
      </ul>
      <p>
      This should be the <b>last</b> entry in the message map.
    </ol>
  </ol>
  <p>
  <li>In the dialog implementation (.cpp) file,
  <p>
  <ol type=A>
    <li>Locate the dialog class start
    <p>
    <li>Find the line starting "BEGIN_MESSAGE_MAP"
    <p>
    <li>After the last entry in the message map (before the line "//}}AFX_MSG_MAP"),
          add
    <p>
    <ul>
      <b>ON_WM_TIMER ( )</b>
    </ul>
    <p>
  </ol>
</ol>

<p>
<center>
<img src="Colorbar.gif" border="0" align="center" ><br>
</center>
<font size="-1">
Copyright (c) 1997,1998. EarthWalk Designs.
<br>
Direct all inquiries to:<a href="mailto:jay@earthwalkdesigns.com">Jay Wheeler</a>
at EarthWalkDesigns.com
</font>
</p><br></font></body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -