[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 982
  • Last Modified:

equivalent of FindWindowEx in Windows mobile

I am trying to get the url from browser in windows mobile, it is working fine with desktop win32 but not with windows mobile.
Get errors like FindWindowEx not found.
equivalent of FindWindowEx in Windows mobile
void GetIEAddress( )
{
      #define MAX_LEN  255
      long lngStyle,lngLen;
      HWND hWnd,hWndChild;      
      char strBuffer[MAX_LEN];
      char strURL[MAX_LEN];
      char strCAPTION[MAX_LEN];
      char *mconCAPTION = " - Microsoft Internet Explorer";
      char *partFOUND;
      OSVERSIONINFO tOSInfo;
      tOSInfo.dwOSVersionInfoSize = sizeof(tOSInfo);
      GetVersionEx(&tOSInfo);
 
      hWnd =GetWindow(GetDesktopWindow(), GW_CHILD);
      while(hWnd!=0)
      {
            lngStyle = GetWindowLong(hWnd, GWL_STYLE);
            if(lngStyle & WS_VISIBLE)
            {
                  GetClassName(hWnd, strBuffer, MAX_LEN);
                  if(!strcmp(strBuffer,"IEFrame"))
                  {
                        GetWindowText(hWnd, strCAPTION, MAX_LEN);
                        partFOUND = strstr(strCAPTION,mconCAPTION);
                        if(partFOUND)
                        {
                              if(tOSInfo.dwPlatformId == VER_PLATFORM_WIN32_NT)
                                    hWndChild = FindWindowEx(hWnd, 0, "WorkerW",0);
                              else
                                    hWndChild = FindWindowEx(hWnd, 0, "WorkerA",0);
                              if(hWndChild>0)
                                    hWndChild = FindWindowEx(hWndChild, 0, "ReBarWindow32",0);
                              if(hWndChild>0)
                                    hWndChild = FindWindowEx(hWndChild, 0, "ComboBoxEx32",0);
                              if(hWndChild>0)
                                    hWndChild = FindWindowEx(hWndChild, 0, "ComboBox",0);
                              if(hWndChild>0)
                                    hWndChild = FindWindowEx(hWndChild, 0, "Edit",0);
                              if(hWndChild>0)
                              {
                                    lngLen = SendMessage(hWndChild, WM_GETTEXTLENGTH, 0,0);
                                    SendMessage(hWndChild, WM_GETTEXT,((lngLen + 1) > MAX_LEN)?(lngLen + 1):MAX_LEN, (long)&strURL);
                                    MessageBox(NULL,strURL,strCAPTION,0);
                              }
                        }
                  }
            }
            hWnd = GetWindow(hWnd, GW_HWNDNEXT);
      }
}

Open in new window

0
Vineel_Davuluri
Asked:
Vineel_Davuluri
2 Solutions
 
Mikal613Commented:
FindWindowEx in CE.  Use FindWindow.
0
 
Aleksei_MalkovCommented:
Hi,
You can try to EnumWindows, and in callback check if the window is one you are looking for.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now