📄 group__timer__fns.htm
字号:
<td> </td> <td><p>Determines whether a timer is installed. <p>This function determines whether a timer with identifier <em>id</em> of a window <em>hwnd</em> has been installed.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>hWnd</em> </td><td>The window owns the timer. </td></tr> <tr><td valign="top"></td><td valign="top"><em>id</em> </td><td>The identifier of the timer.</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>TRUE for installed, otherwise FALSE.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__timer__fns.htm#ga7">SetTimer</a>, <a class="el" href="group__timer__fns.htm#ga6">HaveFreeTimer</a> </dd></dl> </td> </tr></table><a class="anchor" name="ga2" doxytag="window.h::KillTimer"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">int GUIAPI KillTimer </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group__handles.htm#ga1">HWND</a> </td> <td class="mdname" nowrap> <em>hWnd</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>id</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Destroys a timer. <p>This function destroys the specified timer <em>id</em>.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>hWnd</em> </td><td>The window owns the timer. </td></tr> <tr><td valign="top"></td><td valign="top"><em>id</em> </td><td>The identifier of the timer. If <em>id</em> equals or is less than 0, this function will kill all timers in the system.</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>The number of actually killed timer.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__timer__fns.htm#ga7">SetTimer</a> </dd></dl> </td> </tr></table><a class="anchor" name="ga3" doxytag="window.h::ResetTimerEx"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"><a class="el" href="group__simple__types.htm#ga0">BOOL</a> GUIAPI ResetTimerEx </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group__handles.htm#ga1">HWND</a> </td> <td class="mdname" nowrap> <em>hWnd</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>id</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>unsigned int </td> <td class="mdname" nowrap> <em>speed</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap><a class="el" href="group__timer__fns.htm#ga0">TIMERPROC</a> </td> <td class="mdname" nowrap> <em>timer_proc</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Adjusts a timer with a different timeout value or different timer callback procedure. <p>This function resets a timer with the specified timeout <em>speed</em> value.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>hWnd</em> </td><td>The window owns the timer. </td></tr> <tr><td valign="top"></td><td valign="top"><em>id</em> </td><td>The identifier of the timer. </td></tr> <tr><td valign="top"></td><td valign="top"><em>speed</em> </td><td>The new timeout value. </td></tr> <tr><td valign="top"></td><td valign="top"><em>timer_proc</em> </td><td>The new timer callback procedure. If <em>timer_proc</em> is 0xFFFFFFFF, the setting of timer callback procedure will not changed.</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>TRUE on success, FALSE on error.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__timer__fns.htm#ga1">SetTimerEx</a> </dd></dl> </td> </tr></table><a class="anchor" name="ga1" doxytag="window.h::SetTimerEx"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"><a class="el" href="group__simple__types.htm#ga0">BOOL</a> GUIAPI SetTimerEx </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group__handles.htm#ga1">HWND</a> </td> <td class="mdname" nowrap> <em>hWnd</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>id</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>unsigned int </td> <td class="mdname" nowrap> <em>speed</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap><a class="el" href="group__timer__fns.htm#ga0">TIMERPROC</a> </td> <td class="mdname" nowrap> <em>timer_proc</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Creates a timer with the specified timeout value. <p>This function creates a timer with the specified timeout value <em>speed</em>. Note that the timeout value is in unit of 10 ms. When the timer expires, an MSG_TIMER message will be send to the window <em>hWnd</em> if <em>timer_proc</em> is NULL, otherwise MiniGUI will call <em>timer_proc</em> by passing <em>hWnd</em>, <em>id</em>, and the tick count when this timer had expired to this callback procedure.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>hWnd</em> </td><td>The window receives the MSG_TIMER message. If <em>timer_proc</em> is not NULL, MiniGUI will call <em>timer_proc</em> instead sending MSG_TIMER message to this window. If you use timer callback procedure, <em>hWnd</em> can be any value you can pass. </td></tr> <tr><td valign="top"></td><td valign="top"><em>id</em> </td><td>The identifier of the timer, will be passed to the window with MSG_TIMER message as the first parameter of the message. </td></tr> <tr><td valign="top"></td><td valign="top"><em>speed</em> </td><td>The timeout value of the timer. Note that the timeout value is in unit of 10 ms. </td></tr> <tr><td valign="top"></td><td valign="top"><em>timer_proc</em> </td><td>The timer callback procedure. If this argument is NULL, MiniGUI will send MSG_TIMER to the window procedure of <em>hWnd</em>. </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>TRUE on success, FALSE on error.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__timer__fns.htm#ga7">SetTimer</a>, <a class="el" href="group__timer__fns.htm#ga3">ResetTimerEx</a>, <a class="el" href="group__timer__fns.htm#ga2">KillTimer</a>, <a class="el" href="group__system__msgs.htm#ga4">MSG_TIMER</a></dd></dl><dl compact><dt><b>Note:</b></dt><dd>You should set, reset, and kill a timer in the same thread if your MiniGUI is configured as MiniGUI-Threads.</dd></dl>Example:<p><div class="fragment"><pre class="fragment"><span class="comment">/*</span><span class="comment"> * A typical handling of timer.</span><span class="comment"> */</span><span class="keywordtype">int</span> FlyingGUIWinProc (<a class="code" href="group__handles.htm#ga1">HWND</a> hWnd, <span class="keywordtype">int</span> message, <a class="code" href="group__win32__types.htm#ga8">WPARAM</a> wParam, <a class="code" href="group__win32__types.htm#ga9">LPARAM</a> lParam){ <span class="keywordflow">switch</span> (message) { <span class="keywordflow">case</span> <a class="code" href="group__creation__msgs.htm#ga1">MSG_CREATE</a>: <span class="comment">/* create a timer which expires every 100 ms, and whose id is 100. */</span><span class="preprocessor">#ifdef _TIMER_UNIT_10MS</span><span class="preprocessor"></span> <a class="code" href="group__timer__fns.htm#ga7">SetTimer</a> (hWnd, 100, 10);<span class="preprocessor">#else</span><span class="preprocessor"></span> <a class="code" href="group__timer__fns.htm#ga7">SetTimer</a> (hWnd, 100, 100);<span class="preprocessor">#endif</span><span class="preprocessor"></span> <span class="keywordflow">break</span>; <span class="comment">/* handling the MSG_TIMER message. */</span> <span class="keywordflow">case</span> <a class="code" href="group__system__msgs.htm#ga4">MSG_TIMER</a>: <span class="keywordflow">if</span> (wParam == 100) <span class="comment">/* if it is the timer whose id is 100. */</span> <a class="code" href="group__window__general__fns.htm#ga29">InvalidateRect</a> (hWnd, <a class="code" href="group__simple__types.htm#ga3">NULL</a>, <a class="code" href="group__simple__types.htm#ga1">FALSE</a>); <span class="keywordflow">break</span>; <span class="keywordflow">case</span> <a class="code" href="group__creation__msgs.htm#ga7">MSG_CLOSE</a>: <span class="comment">/* kill the timer whose id is 100. */</span> <a class="code" href="group__timer__fns.htm#ga2">KillTimer</a> (hWnd, 100); <a class="code" href="group__window__create__fns.htm#ga10">DestroyMainWindow</a> (hWnd); <a class="code" href="group__msg__pass__fns.htm#ga15">PostQuitMessage</a> (hWnd); <span class="keywordflow">return</span> 0; } <span class="keywordflow">return</span> <a class="code" href="group__window__create__fns.htm#ga19">DefaultMainWinProc</a>(hWnd, message, wParam, lParam);}</pre></div> </td> </tr></table><hr size="1"><address style="align: right;"><small>Generated on Thu Nov 22 15:35:55 2007 for MiniGUI V1.6.10 API Reference by <a href="http://www.doxygen.org/index.html"><img src="http://www.minigui.com/api_ref/1.6.10/doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.2 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -