获取IE地址栏内容
来源:互联网 发布:中建一局房地产 知乎 编辑:程序博客网 时间:2024/04/30 14:16
// test.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "test.h"
//#include "TestIe.h"
#include "mshtml.h"
#include <comutil.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// The one and only application object
CWinApp theApp;
using namespace std;
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;
// initialize MFC and print and error on failure
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: change error code to suit your needs
cerr << _T("Fatal Error: MFC initialization failed") << endl;
nRetCode = 1;
}
else
{
// TODO: code your application's behavior here.
CString strHello;
strHello.LoadString(IDS_HELLO);
cout << (LPCTSTR)strHello << endl;
}
::CoInitialize(NULL);
IShellWindows* m_spSHWinds;
::CoCreateInstance( CLSID_ShellWindows,NULL,CLSCTX_INPROC_SERVER,IID_IShellWindows,(LPVOID*)&m_spSHWinds);
long nCount;
CString str;
m_spSHWinds->get_Count(&nCount);
BSTR Url ;
for (long i = 0; i < nCount; i++)
{
VARIANT va;
va.vt = VT_I4;
va.lVal = i;
IDispatch* spDisp;
m_spSHWinds->Item(va,&spDisp);
IWebBrowser2* spBrowser;
spDisp->QueryInterface(IID_IWebBrowser2,(void**)&spBrowser);
if (spBrowser != NULL)
{
IHTMLDocument2* spDoc;
IDispatch* IDispDoc;
spBrowser->get_Document(&IDispDoc);
IDispDoc->QueryInterface(IID_IHTMLDocument2,(void**)&spDoc);
if (spDoc != NULL)
{
spDoc->get_URL(&Url);
str = Url;
cout <<(LPCTSTR)str <<endl ;
}
}
}
::CoUninitialize();
return nRetCode;
}
- 获取IE地址栏内容
- Qt获取IE地址栏内容
- js获取地址栏内容
- JavaScript获取地址栏内容
- VB获取资源管理器地址栏内容
- 获取当前 IE 地址栏中的 URL
- c#:获取IE地址栏中的URL
- C#获取当前IE地址栏的url
- 获取当前 IE 地址栏中的 URL
- JS获得当前地址栏url+完整获取,Js获取IE地址栏
- C#中利用winapi获取IE地址栏URL
- 利用WM_GETTEXT消息获取谷歌浏览器地址栏内容。
- 获取地址栏
- C# 系统应用之获取IE浏览记录和IE地址栏输入网址
- C# 系统应用之获取IE浏览记录和IE地址栏输入网址
- 自定义IE地址栏图标
- IE地址栏的秘密
- IE地址栏的秘密
- EJB应用从WebLogic到JBoss的迁移方法
- 千万数量级分页存储过程(效果演示)
- 整理了一些t-sql技巧
- 英文换行
- 产品经理的第一堂课(十五):团队的力量
- 获取IE地址栏内容
- 为什么使用OSGi
- 两台SQL Server数据同步解决方案
- 如何解决ACCESS中select TOP语句竟然返回多条记录的问题?
- 如何让一个影片按钮区分开拖动和点击事件
- DLL基础
- NULL和DUAL表的使用
- exp/imp命令详解
- sql常用日期