This example uses the WinSetActiveWindow call to make the main window the active window.
#define INCL_WINWINDOWMGR #include <OS2.H> HWND hwnd; WinSetActiveWindow(HWND_DESKTOP,hwnd);