#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
#include <GuiStatusBar.au3>
#include <GuiConstantsEx.au3>
#include <EditConstants.au3>
#include <IE.au3>
#include <Misc.au3>
HotKeySet("{Esc}", "OUT")
Global $Rect = WinGetPos("[CLASS:Shell_TrayWnd]")
Global $IE, $Form
Global $Web = "http://www.99uc.net/"
Global $title = "浏览器"
_IEErrorHandlerRegister()
$IE = _IECreateEmbedded()
_IEAction($IE, "stop")
$Form = GUICreate($title, @DesktopWidth, @DesktopHeight - $Rect[3], 0, 0, $WS_POPUP)
$GUIActiveX = GUICtrlCreateObj($IE, 2, 2, @DesktopWidth - 2, @DesktopHeight - $Rect[3] - 5)
_IENavigate($IE, $Web, 0)
GUISetState(@SW_SHOW, $Form)
_IELoadWait($IE)
While 1
_ReduceMemory(@AutoItPID)
Sleep(100)
WEnd
Func OUT()
$doc=_IEDocReadHTML($IE)
$doc1=StringRegExpReplace($doc,'<img src=".*?/>','')
$doc2=StringRegExpReplace($doc1,'src="[^http]','src="http://www.99uc.net/')
$doc3=StringRegExpReplace($doc2,'href="[^http]','href="http://www.99uc.net/')
$doc4=StringRegExpReplace($doc3,'http://www.99uc.net/adfile/A0.js|http://www.99uc.net/adfile/banner.js|http://www.99uc.net/adfile/top.js','')
$doc5=StringRegExpReplace($doc4,'<DIV id=banner class=banner>(?s).+?</A> </DIV></DIV>','')
$doc6=StringRegExpReplace($doc5,'<DIV class=topadbox>(?s).+?<DIV class=headertop>','<DIV class=headertop>')
$doc7=StringRegExpReplace($doc6,'<DIV class=topadbox>(?s).+?<DIV class=mainbox>','<DIV class=mainbox>')
$doc8=StringRegExpReplace($doc7,'</BODY></HTML>(?s).+?</a>','</BODY></HTML>')
_IEDocWriteHTML($IE,$doc8)
; Exit
EndFunc ;==>OUT
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