This example gives the client the focus if it does not already have it.
#define INCL_WININPUT #include <OS2.H> #define SYS_MENU 900 HWND hwndFrame; if (WinQueryFocus(HWND_DESKTOP) != /* returns handle of */ /* window with focus. */ WinWindowFromID(hwndFrame,FID_CLIENT)) { WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwndFrame,FID_CLIENT)); /* handle of client */ }