0

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.

computerWizard
  • 94
  • 3
  • 12
  • 2
    GetClassName() can tell you that it is an Edit control. GetDlgCtrlID() *might* tell you that it is the specific edit control you are looking for. Use Spy++ to look at the window properties. – Hans Passant Apr 29 '14 at 16:31
  • Cool I'll try that out now. I used Spy++... the edit control doesn't have a name so for that reason I am trying to find out if it is an edit control – computerWizard Apr 29 '14 at 16:36
  • GetClassName() worked perfectly, thanks – computerWizard Apr 29 '14 at 16:54

0 Answers0