• 0
Sign in to follow this  
RickM

Desativar O " X " E O " Alt + F4 "

Question

Olá, gostaria de saber se há algum jeito de desativar o xzinho e o Alt + F4, para que meu aplicativo só seja fechado quando a pessoa clicar no botão que eu determinei.

Tem como fazer isso ? Se souberem de algo e postarem aqui, agradeço muito.

Abraços, Marco.

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Cara você pode fazer o form sem nenhuma barra em cima!

Mas quanto ao alt+f4 nunca ouvi falar!

abraços

Share this post


Link to post
Share on other sites
  • 0

desabilita o X

Private Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long

Private Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long

Private Const MF_BYPOSITION = &H400&

Private Sub Form_Load()

  '// desabilita o botão fechar

  RemoveMenus

End Sub

Private Sub RemoveMenus()

  Dim hMenu As Long

  hMenu = GetSystemMenu(hWnd, False)

  DeleteMenu hMenu, 6, MF_BYPOSITION

End Sub

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this