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

📄 vcc29.htm

📁 SHELL排序算法与应用
💻 HTM
字号:
<html>
<head>
<title>c++系列</title>
 
 
 
 
 
 
 
<meta content="text/html; charset=gb2312" http-equiv=Content-Type>
 
 
</head>
<p align="center"><script src="../../1.js"></script></a>

<body bgcolor="#ffffff" leftmargin="5" topmargin="1" marginheight="5" marginwidth="5">
<div align=center> 
  <table border=0 cellpadding=0 cellspacing=0 width=680 align="center">
    <tbody> 
    <tr> 
      <td width=200 height="59"> 
         
    </tr>
    </tbody> 
  </table>
  <table border=1 bordercolordark=#ffffff bordercolorlight=#ffffff cellpadding=0 
cellspacing=0 width=685 align="center" height="70">
    <tbody> 
    <tr> 
      <td bgcolor=#F9D23C height=14> 
        <div align=center class=H1> <b><strong>用C++Builder开发动画DLL</strong></b></font></div>
      </td>
    </tr>
    <tr valign=top> 
      <td class=H1 height=212> 
        <p align="right"><font color="#FF0000">&nbsp;&nbsp;&nbsp;  作者:刘 
          学 平</font></font></p>
        <p><font color="#000000">我 们 在Windows98 环 境 下 执 行 拷 贝 文 件、 查 找 文 件 等 计 
          算 机 耗 时 较 长 的 操 作 时,Windows 会 显 示 一 个 小 小 的 动 画, 指 示 正 在 进 行 的 操 作, 
          与 死 板 的 静 止 图 像 相 比 增 色 不 少。 那 么 我 们 自 己 开 发 软 件 时, 能 否 也 显 示 一 个 这 
          样 的 动 画 提 示 呢 ? 笔 者 开 发 了 一 个 能 够 在PB 下 调 用 的 动 画DLL, 由 于 采 用 多 线 程 
          编 程,PB 调 用 的DLL 函 数 能 够 及 时 将 控 制 权 交 还 给PB, 不 影 响 应 用 系 统 的 运 转。 </font></p>
        <p><font color="#000000">一、 代 码 与 编 译 选 项</font> 
        <ol>
          <li><font color="#000000">在C + +Builder 中 创 建 一 个 空 白 的DLL 项 目。 </font></li>
          <li> 创 建 一 个 空 白 的Form, 修 改 它 的 属 性 为: </font> 
            <p> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
              BorderStyle=bsDialog<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BorderIcons 的 子 属 性 均 
              为False<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FormStyle=fsStayOnTop<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Position= poScreenCenter<br>
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Name=StatusForm<br>
              </font></p>
          </li>
          <li><font color="#000000">在Form 上 添 加 一 个Win32 下 的Animate 控 件Animate1, 
            修 改 它 的 属 性 为 </font> 
            <p> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
              Align=alTop</font></p>
          </li>
          <li><font color="#000000">在Form 上 添 加 一 个Standard 下 的Button 控 件Button_Cancel, 
            再 添 加System 下 的Timer 控 件Timer1, 设 置 定 时Interval 时 间 位250, 较 快 响 应 
            用 户 的 取 消 请 求。 </font></li>
        </ol>
        <p> ----因 为PB 应 用 系 统 与 动 画 窗 体 代 码 分 别 属 于 两 个 线 
          程, 不 能 采 用PB 线 程 直 接 关 闭 动 画 窗 体 线 程 的 窗 口, 否 则 会 引 起 系 统 运 行 不 正 常, 
          因 此 采 用PB 线 程 设 置 关 闭 标 志, 而 动 画 线 程 采 用Timer 控 件 定 时 检 查 标 志, 一 旦 检 
          测 到 关 闭 标 志, 就 关 闭 窗 口, 清 除 线 程 标 志, 结 束 动 画 线 程。</font></p>
        <p> ----5. 下 面 给 出 编 码 及 编 码 原 理:</font></p>
        <p> ----(1)DLL 主 体 代 码:</font></p>
        <p> &nbsp;/ *DLL 主 体 代 码<br>
            * 定 义DLL 公 用 变 量<br>
          &nbsp;&nbsp; *g_CommonAVI&nbsp; 对Animate 控 件<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 动 画 类 型 索 引<br>
          &nbsp; *gi_Canceled&nbsp;&nbsp;&nbsp; Button_Cancel&nbsp;<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 按 钮 是 否 被 选 择 过<br>
          &nbsp; *gi_AVIType&nbsp;&nbsp;&nbsp;&nbsp; 要 显 示 的 动 画 类 型,<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 由DLL 输 出 函 数 做 为 参 数 输 入<br>
          &nbsp; *gi_RequestClose&nbsp; 请 求 动 画 线 程 关 闭 标 志<br>
          &nbsp; *gi_WindowActive&nbsp; 动 画 窗 口 所 处 的 状 态<br>
          &nbsp; *lpsWinTitle&nbsp;&nbsp;&nbsp; 动 画 窗 体 的 标 题,<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 由DLL 输 出 函 数 做 为 参 数 输 入<br>
          &nbsp; */<br>
          <br>
          &nbsp;   TCommonAVI g_CommonAVI[]={<br>
          &nbsp;&nbsp;&nbsp;&nbsp;    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; aviNone, 
          aviFindFolder,<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    &nbsp; aviFindFile, 
          aviFindComputer,<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    aviCopyFiles, 
          aviCopyFile,<br>
          &nbsp;   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
          aviRecycleFile, aviEmptyRecycle,<br>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    aviDeleteFile<br>
          &nbsp;   };<br>
          &nbsp;   int gi_Canceled=0,gi_AVIType=0;<br>
          &nbsp;   int gi_RequestClose=0,gi_WindowActive=0;<br>
          &nbsp;   char lpsWinTitle[256];<br>
          &nbsp;   HWND hWndParent=NULL;<br>
          <br>
          &nbsp;   / * 定 义DLL 输 出 函 数 */<br>
          &nbsp;   extern “C&quot; __declspec(dllexport) int pascal Dll&nbsp;<br>
          &nbsp;&nbsp;&nbsp; 

⌨️ 快捷键说明

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