I'm looking into the feasibility of porting some GUI code to OS/2. One of the things needed is to create the menubar and menus completely in code.
From skimming online books, I gather that this is possible, but apparently not as straightforward as calling single API methods like win32's CreateMenu, AppendMenu, SetMenu, etc.
Creating menus programmatically is quite easy but it isn't done using API calls that resemble those in Windows because the windowing model is different.
A top-level OS/2 Presentation Manager window does not have a non-client area where the OS draws stuff like menus and titlebars for you. Instead, each of these design elements is a separately created window of the appropriate class whose size and position is coordinated by the top-level "frame window".
Menubars, popup menus, min/max/close buttons, and system menus are all windows of class WC_MENU. Like any other window, they are created using WinCreateWindow() and are manipulated by sending them window messages such as MM_INSERTITEM. The end result is the same as CreateMenu() and AppendMenu() but the methodology is different.
To get a better understanding of PM windowing, I highly recommend
PMTree. It provides a graphical display of the OS/2 windowing hierarchy for every top-level window open on the Desktop. You'll quickly discover there's a lot more to OS/2 windows than Windows' windows.
FWIW... on a practical note: in cases where you need to create custom menus, it is often easier to create and load conventional menu template resources, then customize them by adding or removing items, rather than starting from scratch.