I wrote a universal search engine for windows/controls of all kind, using both of the following methods:
a) Thread_ID = GetWindowThreadProcessId(lhWnd, ProcessID)
lRet = EnumThreadWindows(ThreadID, CodePtr(EnumThreadProc), lParam)
b) lRet = EnumChildWindows
As you can see, a code pointer is used to access function EnumChildProc. This function however as defined gives back a result which I'd like to use to finish searching when the desired window/control was found via its parameters. I don't remember that the SDK offers directly a result from a function pointed to.
I'd be glad to be wrong.
a) Thread_ID = GetWindowThreadProcessId(lhWnd, ProcessID)
lRet = EnumThreadWindows(ThreadID, CodePtr(EnumThreadProc), lParam)
b) lRet = EnumChildWindows
Code:
Inside the code I'm using a function to enumerate all windows and controls. Function EnumChildWindowsByParam (lhWnd As Long) As Long Local lParam As Long Local lRet As Long ==> lRet = EnumChildWindows(lhWnd, CodePtr(EnumChildProc), lParam) Function = lRet End Function
I'd be glad to be wrong.
Comment