Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = 0 Then Cancel = 1: Me.WindowState = 1
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbFormControlMenu Then
Cancel = 12345
WindowState = vbMinimized
End If
End Sub
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const SC_MINIMIZE = &HF020&
Private Const WM_SYSCOMMAND = &H112
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If UnloadMode = vbFormControlMenu Then
Cancel = Abs(CLng(True))
SendMessage Me.hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0
End If
End Sub
HotKitten писал(а):а через диспетчер задач => приложения твою прогу всё равно отрубят
HotKitten писал(а):а через диспетчер задач => приложения твою прогу всё равно отрубят
Сейчас этот форум просматривают: AhrefsBot, Majestic-12 [Bot], Yandex-бот и гости: 105