l3.htm

来自「C++Builder教学大全」· HTM 代码 · 共 38 行

HTM
38
字号
 

<html>

<head>

<title>怎样以最小化方式启动程序</title>

<meta http-equiv="目录类型" content="文本/html; 字符集=gb2312">

</head>

<body bgcolor="#FFFFFF">

<table width="100%" border="0" height="285">

  <tr> 

    <td height="35"> 

      <div align="center" class="p14"><font color="#000000">怎样以最小化方式启动程序</font></div>

    </td>

  </tr>

  <tr valign="top"> 

    <td>

      <p><font color="#000000">可以调用Application-&gt;Minimize函数来最小化应用程序到任务条。如何你希望你的程序启动时就最小化,只需在调用Run方法前调用Application-&gt;Minimize就行了。</font></p>

      <pre><span style="BACKGROUND-COLOR: silver"><font color="#000000">WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, </font></span><font color="#000000"><span style="BACKGROUND-COLOR: silver"><b>int</b>)</span>

<span style="BACKGROUND-COLOR: silver">{</span>

<span style="BACKGROUND-COLOR: silver">    <b>try</b></span>

<span style="BACKGROUND-COLOR: silver">    {</span>

<span style="BACKGROUND-COLOR: silver">        Application-&gt;Initialize();</span>

<span style="BACKGROUND-COLOR: silver">        Application-&gt;CreateForm(<b>__classid</b>(TForm1), &amp;Form1);</span>

<span style="BACKGROUND-COLOR: silver">        Application-&gt;Minimize();  //以最小化方式启动</span>

<span style="BACKGROUND-COLOR: silver">        Application-&gt;Run();</span>

<span style="BACKGROUND-COLOR: silver">    }</span>

<span style="BACKGROUND-COLOR: silver">    <b>catch</b> (Exception &amp;exception)</span>

<span style="BACKGROUND-COLOR: silver">    {</span>

<span style="BACKGROUND-COLOR: silver">        Application-&gt;ShowException(&amp;exception);</span>

<span style="BACKGROUND-COLOR: silver">    }</span>

<span style="BACKGROUND-COLOR: silver">    <b>return</b> 0;</span>

<span style="BACKGROUND-COLOR: silver">}</span></font></pre>

      </td>

  </tr>

</table>

<br>

</body>

</html>

⌨️ 快捷键说明

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