VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Disables the X in the window

by Deano Splamoni (15 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 7th June 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Disables the X in the window

API Declarations


Public Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long
Public Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Public Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
Public Const MF_BYPOSITION = &H400&
Public Const MF_DISABLED = &H2&


Rate Disables the X in the window



Dim hMenu As Long
Dim nCount As Long
  hMenu = GetSystemMenu(Frm.hwnd, 0)
  nCount = GetMenuItemCount(hMenu)
  Call RemoveMenu(hMenu, nCount - 1, MF_DISABLED Or MF_BYPOSITION)
  DrawMenuBar Frm.hwnd
End Sub

private sub form_load()
disablex me
end sub

Download this snippet    Add to My Saved Code

Disables the X in the window Comments

No comments have been posted about Disables the X in the window. Why not be the first to post a comment about Disables the X in the window.

Post your comment

Subject:
Message:
0/1000 characters