GetFirstChild in win32?
I am using EnumChildWindows to get all child windows from the main HWND window, but I would only like to get the first child of a given HWND window.
BOOL CALLBACK EnumChildProc ( HWND hwndChild, LPARAM lParam)
{
// logic to call only once
}
Is it correct? or in any other simple way?
~ UK
+2
a source to share
3 answers
Sure:
BOOL CALLBACK EnumChildProc ( HWND hwndChild, LPARAM lParam)
{
/* do what you want with the first HWND */
return FALSE; // stops enumeration.
}
See MSDN for more details , but the relevant line is this:
Return value
Bool
To continue enumerating, the callback function must return TRUE ; stop enumeration, it should return FALSE .
+2
a source to share