How to determine specific object from Msg.HWnd 'MESSAGE CLOSED'
-
I think I found the answer by walking the Parent of Msg.HWnd until I find the containing 'Control' window in which FromHandle(hwnd) returns a Control object. In a custom control I have implemented an IMessageFilter to process the WM_MOUSEMOVE message to determine when the mouse is over a particular control. I then try to convert the hWnd to a control with Control.FromHandle(Msg.HWnd). This works for common controls. When the mouse is over as WebBrowser control I get Nothing returned from FromHandle(). I can use api GetClassName() to get the class name which returns either "shell embedding" or "internet explorer_server". The problem is I have more than one WebBrowser instance in the app. and need to distinguish between them. My question is, is there some value I can retrieve using an api with Msg.HWnd that will be unique to the particular instance object? WebBrowser does not have a Text property so GetWindowText() returns "". WebBrowser does have a Tag and Name property but I don't know if that is accessable through a windows api. Thank you