| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 888 人关注过本帖
标题:得到IE地址栏内容的代码,为什么不好使?
只看楼主 加入收藏
奥丁
Rank: 1
等 级:新手上路
帖 子:327
专家分:0
注 册:2006-10-18
结帖率:100%
收藏
 问题点数:0 回复次数:0 
得到IE地址栏内容的代码,为什么不好使?
程序代码:
int main()
{
    HWND   hWorker,hRebar,hComEx,hcom,hEdit;   
    HWND   hwndParent=::FindWindow(L"IEFrame",NULL);//找到最近的IE,要是找到某个IE需要枚举所有的IE过筛子   
    if(hwndParent   ==   NULL)//没有IE运行中   
        return   FALSE;   
    char   szURL[260];  
    memset(szURL, 0, 260);
    hWorker=FindWindowEx(hwndParent,0,L"WorkerA",NULL);//找到工作区   
    if(hWorker   ==   NULL)//用户用NT   
        hWorker=FindWindowEx(hwndParent,0L,L"WorkerW",NULL);//WindowNT中的ie   

    hRebar=FindWindowEx(hWorker,0,L"ReBarWindow32",NULL);//找到Rebar   

    hComEx=FindWindowEx(hRebar,0,L"ComboBoxEx32",NULL);//找到Comboboxex   
    hcom=FindWindowEx(hComEx,0,L"ComboBox",NULL);//找到combobox   

    hEdit=FindWindowEx(hcom,0,L"Edit",NULL);//找到ComBoBox的edit控件句柄   


    ::SendMessage(hEdit,WM_GETTEXT,260,(LPARAM)   szURL);   

    AfxMessageBox((LPCTSTR)szURL);   
    return   TRUE;   
//    cout << szError <<endl;   

}

搜索更多相关主题的帖子: 地址 代码 
2008-08-21 15:27
快速回复:得到IE地址栏内容的代码,为什么不好使?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.025597 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved