This example queries the Language Viewer window handle registered currently in the system for the currently used code page.
#define INCL_PMBIDI #include <OS2.H> #include <PMBIDI.H> HAB hab; HWND hwnd; HMQ hmq; ULONG cp; VOID QueryLanguageViewerWindow(VOID) { cp = WinQueryCp(hmq); /* Query current code page */ if (hwnd = WinQueryLangViewer(hab, /* Anchor block handle of the application */ /* that registered the Language Viewer */ cp)) /* Current code page */ WinMessageBox (HWND_DESKTOP, hwnd, "The Language Viewer handle was queried correctly", "Result", 0, MB_OK); else WinMessageBox (HWND_DESKTOP, hwnd, "No Language Viewer has been registered for this code page", "Error", 0, MB_OK); }