找回密码
 加入
搜索
查看: 1993|回复: 5

如何关闭 这个 ie 并在需要的时候重新开启?

[复制链接]
发表于 2008-6-10 05:17:30 | 显示全部楼层 |阅读模式
$oie = ObjCreate("Shell.Explorer.2")
$GUIActiveX = GUICtrlCreateObj($oie, 10, 25, 619, 438)

这样创建的 如何在处理完程序后关闭并在需要的时候重新创建呢? 太占资源了
发表于 2009-7-4 15:07:30 | 显示全部楼层
$oIE=0 试试
发表于 2009-7-4 21:39:55 | 显示全部楼层
_ReduceMemory(@AutoItPID)
Func _ReduceMemory($i_PID = -1)
    If $i_PID <> -1 Then
        Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID)
        Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
        DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
    Else
        Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
    EndIf

    Return $ai_Return[0]
EndFunc   ;==>_ReduceMemory
如果占用不大的话
可以把物理内存写到虚拟内存也是一种方法
发表于 2009-7-4 21:52:39 | 显示全部楼层
_ReduceMemory(@AutoItPID)
Func _ReduceMemory($i_PID = -1)
    If $i_PID  -1 Then
        Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PI ...
lynfr8 发表于 2009-7-4 21:39

请教下:怎么写呢?
发表于 2009-7-4 22:00:03 | 显示全部楼层
上面那段代码就是把物理内存写到虚拟内存的代码
如果有GUI的在循环语句的case里面加一句_ReduceMemory(@AutoItPID)就ok了
发表于 2009-7-4 22:01:12 | 显示全部楼层
上面那段代码就是把物理内存写到虚拟内存的代码
如果有GUI的在循环语句的case里面加一句_ReduceMemory(@AutoItPID)就ok了
lynfr8 发表于 2009-7-4 22:00

哦,我以为是释放内存的,你所说的使用方法我知道的,谢谢你
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-23 01:41 , Processed in 0.072329 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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