Click to See Complete Forum and Search --> : [Q]: How to disable the size option from my app menu
jeremy
January 22nd, 1999, 01:53 PM
I made an app that is sizeable, but i disabled the maximize box. i want it so it can either be minimized or if you click on its icon in the tray have it return to its normal state. it does those fine, but if you left click on the app icon in the upper left corner, the menu alows you to size it. how can i remedy this?
thanks,
jeremy
Jeremy-Deleted
January 22nd, 1999, 01:53 PM
I made an app that is sizeable, but i disabled the maximize box. i want it so it can either be minimized or if you click on its icon in the tray have it return to its normal state. it does those fine, but if you left click on the app icon in the upper left corner, the menu alows you to size it. how can i remedy this?
thanks,
jeremy
Chris Eastwood
January 22nd, 1999, 03:00 PM
Hi
You say you made your app sizable yet you don't want to see the option in the system menu ?
If you don't want the user to resize your app at all, you can do it using the following code :
Create a new VB project, and paste the following code into the code section of form1
Option Explicit
Private Declare Function GetSystemMenu Lib "user32" _
(ByVal hWnd As Long, ByVal bRevert As Long) As Long
Private Declare Function RemoveMenu Lib "user32" _
(ByVal hMenu As Long, ByVal nPosition As Long, _
ByVal wFlags As Long) As Long
Private Const MF_BYPOSITION = &H400&
Public Sub RemoveResizeMenuItem()
Dim hSysMenu As Long
'get the system menu for this form
hSysMenu = GetSystemMenu(Me.hWnd, 0)
'remove the close item
Call RemoveMenu(hSysMenu, 2, MF_BYPOSITION)
End Sub
Private Sub Form_Load()
RemoveResizeMenuItem
End Sub
Hope it helps
Regards
Chris Eastwood
Software Engineer
ACNielsen Ltd
CodeGuru - the website for developers
http://www.codeguru.com
jeremy
January 22nd, 1999, 03:13 PM
N/T
Jeremy-Deleted
January 22nd, 1999, 03:13 PM
N/T
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.