• 获取IE URL


     1 void getURL()
     2 {
     3     HWND hWnd, hWnd1, hWnd2, hWnd3, hWnd4;
     4     WCHAR URL[1000] = { 0 };
     5     hWnd = FindWindow(L"IEFrame", NULL);
     6     hWnd1 = FindWindowEx(hWnd, 0, L"WorkerW", NULL);
     7     hWnd2 = FindWindowEx(hWnd1, 0, L"ReBarWindow32", NULL);
     8     hWnd3 = FindWindowEx(hWnd2, 0, L"Address Band Root", NULL);    //获得IE窗口地址栏句柄
     9     hWnd4 = FindWindowEx(hWnd3, 0, L"Edit", NULL);                  //获得IE窗口地址栏编辑框句柄
    10 
    11     if (hWnd4 != NULL)
    12     {
    13         int i = SendMessage(hWnd4, WM_GETTEXTLENGTH, 0, 0);           //向IE窗口地址栏编辑框发送获取字符串长度的命令
    14         memset(URL, 0, 1000);
    15         SendMessage(hWnd4, WM_GETTEXT, i + 1, long(URL));             //向IE窗口地址栏编辑框发送获取字符的命令
    16         printf("%ws
    ", URL);
    17         return;
    18     }
    19     else
    20     {
    21         printf("Don't find IE!
    ");
    22     }
    23     return;
    24 }
  • 相关阅读:
    angularJS(5)
    angularJS(4)
    angularJS(3)
    AngularJS(1)
    angularJS(2)
    关于响应式布局
    PHP+JQUEY+AJAX实现分页【转】
    bootscript/javascript组件
    你必须收藏的Github技巧
    关于php的一些小知识!
  • 原文地址:https://www.cnblogs.com/endenvor/p/10881011.html
Copyright © 2020-2023  润新知