WM_GETOBJECT message

Sent by both Microsoft Active Accessibility and Microsoft UI Automation to obtain information about an accessible object contained in a server application.

Applications never send this message directly. Microsoft Active Accessibility sends this message in response to calls to AccessibleObjectFromPoint, AccessibleObjectFromEvent, or AccessibleObjectFromWindow. However, server applications handle this message. UI Automation sends this message in response to calls to IUIAutomation::ElementFromHandle, ElementFromPoint, and GetFocusedElement, and when handling events for which a client has registered.

dwFlags = (WPARAM)(DWORD) wParam;
dwObjId = (LPARAM)(DWORD) lParam;

Parameters

dwFlags

Provides additional information about the message and is used only by the system. Servers pass dwFlags as the wParam parameter in the call to LresultFromObject when handling the message.

dwObjId

Object identifier. This value is one of the object identifier constants or a custom object identifier. A server application must check this value to identify the type of information being requested. Before comparing this value against the OBJID_ values, the server must cast it to DWORD; otherwise, on 64-bit Windows, the sign extension of the lParam can interfere with the comparison.

  • If dwObjId is one of the OBJID_ values such as OBJID_CLIENT, the request is for a Microsoft Active Accessibility object that implements IAccessible.
  • If dwObjId is equal to UiaRootObjectId, the request is for a UI Automation provider. If the server is implementing UI Automation, it should return a provider using the UiaReturnRawElementProvider function.
  • If dwObjId is OBJID_NATIVEOM, the request is for the control's underlying object model. If the control supports this request, it should return an appropriate COM interface by calling the LresultFromObject function.
  • If dwObjId is OBJID_QUERYCLASSNAMEIDX, the request is for the control to identify itself as a standard Windows control or a common control implemented by the common control library (ComCtrl.dll).

Return value

If the window or control does not need to respond to this message, it should pass the message to the DefWindowProc function; otherwise, the window or control should return a value that corresponds to the request specified by dwObjId:

Remarks

When a client calls AccessibleObjectFromWindow or any of the other AccessibleObjectFromX functions that retrieve an interface to an object, Microsoft Active Accessibility sends the WM_GETOBJECT message to the appropriate window procedure within the appropriate server application. While processing WM_GETOBJECT, server applications call LresultFromObject and use the return value of this function as the return value for the message. Microsoft Active Accessibility, in conjunction with the COM library, performs the appropriate marshaling and passes the interface pointer from the server back to the client.

Servers do not respond to WM_GETOBJECT before the object is fully initialized or after it begins to close down. When an application creates a new window, the system sends EVENT_OBJECT_CREATE to notify clients before it sends the WM_CREATE message to the application's window procedure. Because many applications use WM_CREATE to start their initialization process, servers do not respond to the WM_GETOBJECT message until finished processing the WM_CREATE message.

A server uses WM_GETOBJECT to perform the following tasks:

For clients, this means that they might receive distinct interface pointers for the same user interface element, depending on the server's action. To determine if two interface pointers point to the same user interface element, clients compare IAccessible properties of the object. Comparing pointers does not work.

Requirements

Requirement Value
Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Redistributable
Active Accessibility 1.3 RDK on Windows NT 4.0 with SP6 and later and Windows 95
Header
Winuser.h (include Windows.h)

See also

How to Handle WM_GETOBJECT

How WM_GETOBJECT Works

LresultFromObject