博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

GetEnvironment()

Posted on 2010-01-20 11:43  大椰网吧  阅读(644)  评论(0编辑  收藏  举报
GetEnvironment()
  功能得到操作系统、处理器、屏幕显示等与系统相关的信息。
  语法GetEnvironment ( environmentinfo )

  参数environmentinfo:Environment对象名,用于保存系统环境信息返回值Integer。函数执行成功时返回1,发生错误时返回-1。如果参数environmentinfo的值为 NULL,GetEnvironment()函数返回NULL。用法当开发交叉平台项目时,利用GetEnvironment()函数,应用程序能够得到当前运行的操作系统、使用的CPU类型、操作系统的版本、屏幕的大小以及颜色数等信息,这些信息的具体表示请参阅本书环境对象(Environment Object)的介绍。

 

例:

environment lenv_env

if GetEnvironment(lenv_env) <> 1 then
 MessageBox("提示信息","获取系统信息出错,程序将终止!",StopSign!)
 FileClose(ll_file)
 halt close
end if

if lenv_env.osType <> WindowsNT! then
 MessageBox("提示信息","请在Windows NT上运行本系统",Exclamation!)
 FileClose(ll_file)
 halt close
end if
if lenv_env.ScreenHeight < 768 or lenv_env.ScreenWidth < 1024 then
 MessageBox("提示信息","请在至少1024*768的分辨率下使用本系统!",Exclamation!)
 FileClose(ll_file)
 halt close
end if