Microsoft KB Archive/65587

INF: Sample PM 1.21 Program That Doesn’t Display Child Control PSS ID Number: Q65587 Article last modified on 09-06-1991 PSS database name: P_PresMan

1.21

OS/2

Summary:

The following information describes how to create a Presentation Manager (PM) program that does not display child controls such as MINMAX boxes, menus, or sysmenu boxes on the screen.

First, the programmer must obtain the window handle for a frame window, then it is easy to remove the child controls that should not be displayed. HWND can be obtained for a particular control by using the WinWindowFromID function and the FID_* constants. Then, WinDestroyWindow should be called with this handle. Finally, inform the frame that its layout should be updated by sending it a WM_UPDATEFRAME message.

The file MIN in the Software/Data Library demonstrates this type of functionality. MIN can be found in the Software/Data Library by searching on the word MIN, the Q number of this article, or S12720. MIN was archived using the PKware file-compression utility.

Please note that there may be a problem getting the necessary frame window handles. This will be particularly difficult with the help manager windows. One possible solution is to have a “background” process that periodically enumerates top-level windows and destroys unwanted child controls if they exist.

Please keep in mind that the help manager was designed with the intention that the windows do have these controls. For example, without a system menu, how will a user close the window? The ALT+F (where F is a function key) accelerators are dependent upon the existence of the system menu as a child of the frame.

Copyright Microsoft Corporation 1991.