标题:得到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



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-229308-1-1.html




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

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