This example uses WinIsWindowEnabled to check that the parent window is currently disabled before calling WinEnableWindow to enable the system menu window.
#define INCL_WINWINDOWMGR /* Window Manager Functions */ #define INCL_WINFRAMEMGR /* Window Frame Functions */ #include <os2.h> HAB hab; /* Anchor-block handle */ HWND hwndSysmenu; /* System menu window */ HWND hwnd; /* Parent window */ BOOL fSuccess; /* Success indicator */ /* Obtain the handle for the system menu */ hwndSysmenu = WinWindowFromID(hwnd,FID_SYSMENU); /* If the system menu is disabled, enable it */ if (!WinIsWindowEnabled(hwndSysmenu)) fSuccess = WinEnableWindow(hwndSysmenu, TRUE);