John,
This code below should give you some idea of what you are butting up against here. Windows just doesn't work that way, even natively using API calls. You ultimately will need to draw your own MIN and CLOSE buttons if you want to do this...getting rid of the MAX button from between them is not a trivial thing...now if you just wanted to disable the max button and have the controlbox = .f. that may in fact be possible...maybe i say.
DECLARE INTEGER SetWindowLong IN user32;
INTEGER HWND,;
INTEGER nIndex,;
INTEGER dwNewLong
DECLARE INTEGER GetSystemMenu IN user32;
INTEGER hWnd,;
INTEGER bRevert
#DEFINE GWL_STYLE -16
#DEFINE WS_MINIMIZEBOX 0x20000
#DEFINE WS_MAXIMIZEBOX 0x10000
lnhwnd = thisform.hwnd
CurrentStyle = GetWindowLong(lnhwnd, GWL_STYLE)
*!* Both min and max must be removed before they actually disappear
*!* otherwise buttons are just disabled individually but still shown
CurrentStyle = BITAND(CurrentStyle, BITNOT(WS_MINIMIZEBOX))
CurrentStyle = BITAND(CurrentStyle, BITNOT(WS_MAXIMIZEBOX))
*!* code similar to this commented out stuff is used to turn on the buttons
*!* CurrentStyle = BITOR(CurrentStyle, WS_MINIMIZEBOX)
*!* CurrentStyle = BITOR(CurrentStyle, WS_MINIMIZEBOX)
X = SetWindowLong(THISFORM.HWND, GWL_STYLE, CurrentStyle)
*!* just a quick hack to refresh controlbox
thisform.controlbox = .f.
thisform.controlbox = .t.
Slighthaze =
NULL
craig1442@mchsi.com"Whom computers would destroy, they must first drive mad." - Anon