As part of the WinSetLangInfo API, an optional message can be sent to the window procedure whose bidi attributes (or bidi status) is being set. This provides a bidi-aware window procedure with a way to know that an application is modifying its bidi state (attribute and/or status). This allows the window procedure to provide the required processing for this case. For example, when a bidi-aware window receives the WM_SETBIDIATTR message, it can inspect which bidi attributes are being set, and do necessary conversion on its internal buffers to accommodate this change. Another option it can take is to refuse the request and protect its bidi attributes from modifications done by external applications.
A window procedure can also ignore the WM_SETBIDIATTR by passing it to the default window procedure which will result in the bidi attributes being set in the internal window structure.
Similarly, the WinQueryLangInfo can send a message to the window procedure whose bidi attributes or status are being queried. This gives the bidi-aware window a chance to specify the value of the bidi attributes or status that is returned to the querying application.
A window procedure can also ignore the WM_QUERYBIDIATTR by passing it to the default window procedure which returns the window bidi attributes as stored in the internal window structure.
When the WinSetLangInfo API is used by a window procedure to set its own bidirectional attributes as part of WM_SETBIDIATTR processing, the LIF_NO_SENDMSG flag should be set in order to prevent recursive calls to the window procedure.
It is recommended that the LIF_NO_SENDMSG flag is NOT turned on when WinSet/QueryLanginfo is called outside the window procedure whose attributes are being set. Applications should generally use the default flag (which causes a WM_SETBIDIATTR message to be sent), so that bidi-aware window procedures can take the appropriate actions when a request to change their Bidi attributes is made.