Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BorderIcons: Minimize, Maximize without X

Status
Not open for further replies.

doctorjellybean

Programmer
May 5, 2003
145
If I set the biSystemMenu property of BorderIcons to false, it disables the Minimize and Maximize icons, with a BorderStyle setting of bsSingle.

As I have an Exit option in the MainMenu, I would like to get rid of the X, but retain the Minimize and Maximize options.

Is that possible?

Thank you.
 
No. Best I can see that you can do is disable the Close icon. The Close icon seems to be arbitrarily default, unless I'm not seeing something.

Code:
procedure TForm1.Button5Click(Sender: TObject);
var
  mySysMenu: DWord;
begin
{ Const SC_SIZE As Int32 = &HF000
  Const SC_MOVE As Int32 = &HF010
  Const SC_MINIMIZE As Int32 = &HF020
  Const SC_MAXIMIZE As Int32 = &HF030
  Const SC_CLOSE As Int32 = &HF060
  Const SC_RESTORE As Int32 = &HF120
  Const MF_BYCOMMAND As Int32 = &H0
  Const MF_SEPARATOR As Int32 = &H800 }

  mySysMenu := GetSystemMenu(Form1.Handle, false);
  EnableMenuItem(mySysMenu, SC_CLOSE, MF_DISABLED);
  DrawMenuBar(Form1.Handle);
end;

----------
Those who work hard are rewarded with more work and remembered come time to downsize.  Those who hardly work are given a paycheck and ignored completely.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top