Finding handle for Edit Control

2019-09-09 16:38发布

问题:

I am trying to find a handle for an Edit control in a window in another application. Basically what I have done so far is the following:

I already have the handle to the window in which the combo box of the edit control and edit control are in. I am using the EnumChildWindows() function to look through all the child windows of the parent window until I hit the Edit control:

HWND hWnd;//handle to parent window... I already have this
HWND handleEditControl;//I am looking for this

EnumChildWindows(hWnd, EnumChildProc, 0);

BOOL CALLBACK EnumChildProc(HWND hWnd, LPARAM lParam)
{

  if (HERE IS THE PROBLEM)
  {
     handleEditControl = hWnd;
     return true;
  }

  return false;
}

The problem I have is how to identify if the specific handle I am analysing is a handle for an Edit control or not. Might there be a msg for the SendMessage() function which identifies what type of a control the handle is for?...

Question:: How do I check if a handle that I have is from an Edit Control?

PS: The Edit Control doesn't have a name in the application I am using, so for that reason I am interested in knowing the type.