玩酷之家

 找回密码
 立即注册
查看: 49|回复: 0

VB 程序内存释放的代码

[复制链接]
发表于 2021-1-8 16:37:41 | 显示全部楼层 |阅读模式
释放内存,常用于第一次启动完窗体后,效果显著
  1. Private Declare Function SetProcessWorkingSetSize Lib "kernel32" (ByVal hProcess As Long, ByVal dwMinimumWorkingSetSize As Long, ByVal dwMaximumWorkingSetSize As Long) As Long
  2. Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
  3. Private Sub releasemem()

  4. SetProcessWorkingSetSize GetCurrentProcess, -1, -1
  5. End Sub
  6. Private Sub Form_Load()
  7. releasemem
  8. End Sub
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|玩酷之家 ( 鄂ICP备14012049号 )

GMT+8, 2021-1-21 04:41 , Processed in 1.092002 second(s), 17 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表