ylvip 发表于 2008-6-10 05:17:30

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

$oie = ObjCreate("Shell.Explorer.2")
$GUIActiveX = GUICtrlCreateObj($oie, 10, 25, 619, 438)

这样创建的 如何在处理完程序后关闭并在需要的时候重新创建呢? 太占资源了

tisiem 发表于 2009-7-4 15:07:30

$oIE=0 试试

lynfr8 发表于 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)
      DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle)
    Else
      Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
    EndIf

    Return $ai_Return
EndFunc   ;==>_ReduceMemory
如果占用不大的话
可以把物理内存写到虚拟内存也是一种方法

kn007 发表于 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 http://www.autoitx.com/images/common/back.gif
请教下:怎么写呢?

lynfr8 发表于 2009-7-4 22:00:03

上面那段代码就是把物理内存写到虚拟内存的代码
如果有GUI的在循环语句的case里面加一句_ReduceMemory(@AutoItPID)就ok了

kn007 发表于 2009-7-4 22:01:12

上面那段代码就是把物理内存写到虚拟内存的代码
如果有GUI的在循环语句的case里面加一句_ReduceMemory(@AutoItPID)就ok了
lynfr8 发表于 2009-7-4 22:00 http://www.autoitx.com/images/common/back.gif
哦,我以为是释放内存的,你所说的使用方法我知道的,谢谢你
页: [1]
查看完整版本: 如何关闭 这个 ie 并在需要的时候重新开启?