使用ie尝试打开一个url

#使用ie尝试打开一个url
!include "LogicLib.nsh"
SetCompressor /SOLID lzma
SetCompress force
XPStyle on
OutFile "Test.exe"
!define VARIANT_TRUE -1
!define VT_ERROR 10
!define DISP_E_PARAMNOTFOUND 0x80020004
!define CLSCTX_LOCAL_SERVER 0x4
!define CLSID_InternetExplorer {0002DF01-0000-0000-C000-000000000046}
!define IID_IWebBrowserApp {0002DF05-0000-0000-C000-000000000046}
!define IWebBrowserApp.Navigate ->11(i,i,i,i,i)i
!define IWebBrowserApp.put_Visible ->41(&i2)i
Function InternetExplorerAuto_OpenURL
exch $2
push $0
push $1
System::Call "ole32::CoCreateInstance(
g '${CLSID_InternetExplorer}', i 0,
i ${CLSCTX_LOCAL_SERVER},
g '${IID_IWebBrowserApp}', *i 0 r0)"
${If} $0 <> 0
System::Call "$0${IWebBrowserApp.put_Visible} (${VARIANT_TRUE}).r1"
${If} $1 = 0
System::Call "*(i ${VT_ERROR},i ${DISP_E_PARAMNOTFOUND},i)i.r1"
System::Call 'Oleaut32::SysAllocString(w "$2")i.r2'
System::Call "$0${IWebBrowserApp.Navigate} ($2,$1,$1,$1,$1)"
System::Free $1
System::Call 'Oleaut32::SysFreeString(ir2)'
${EndIf}
System::Call "$0->2()"
${EndIf}
pop $1
pop $0
pop $2
FunctionEnd
section
push "http://WWW.yhxs3344.net"
call InternetExplorerAuto_OpenURL
sectionend
© 版权声明
THE END
喜欢就支持一下吧
点赞10 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容