Finding handle for Edit Control

懵懂的女人 提交于 2019-12-13 04:59:24

问题


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.

来源:https://stackoverflow.com/questions/23369951/finding-handle-for-edit-control

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!