Posted by Barbara Brazil on November 29, 2006 at 08:19:51:
In Reply to: Comet Windows Programming posted by Mike Saunders on November 29, 2006 at 06:51:06:
Mike:
There are API calls to determine whether the windown is maximized or minimized. They are COS.IsMaximized and COS.IsMinimized. Here's an example:
gosub COS.GetFrameWnd
gosub COS.IsMaximized
IsMax = cosState
Upon return, cosState will be either 1 or 0 depending on whether the window was maximized or not. Save its value for testing later.
Then, to restore the original state before exit,
gosub COS.GetFrameWnd
if IsMax = 1
cosState = SW.MAXIMIZE
else
cosState = SW.MINIMIZE
endif
gosub COS.ShowWindow
Check out the MinMax.ibs demo program in the DMW folder for more examples fo how to change a window's state.
bb