Invisible à crtl-alt-supp

vegetalain Messages postés 747 Date d'inscription mardi 25 mars 2003 Statut Membre Dernière intervention 11 août 2022 - 18 oct. 2004 à 13:31
Gobillot Messages postés 3140 Date d'inscription vendredi 14 mai 2004 Statut Membre Dernière intervention 11 mars 2019 - 18 oct. 2004 à 21:55
Salut, voila j'iamerais savoir si il est possible de faire un prog en vb6 et faire en sorte que lorsqu'on fait "Crtl-Alt-Supp", il 'napparaisse pas dans la liste des prog dit "actifs"?...

merci d'avance pour votre aide !!

1 réponse

Gobillot Messages postés 3140 Date d'inscription vendredi 14 mai 2004 Statut Membre Dernière intervention 11 mars 2019 34
18 oct. 2004 à 21:55
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long
Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long

Const MF_BYPOSITION = &H400&
Const MF_REMOVE = &H1000&

Private Sub Form_Load()
    Dim hSysMenu As Long, nCnt As Long
    hSysMenu = GetSystemMenu(Me.hwnd, False)

    If hSysMenu Then
        nCnt = GetMenuItemCount(hSysMenu)
        If nCnt Then
            RemoveMenu hSysMenu, nCnt - 1, MF_BYPOSITION Or MF_REMOVE
            RemoveMenu hSysMenu, nCnt - 2, MF_BYPOSITION Or MF_REMOVE ' Remove the seperator
            DrawMenuBar Me.hwnd
        End If
    End If
End Sub
0
Rejoignez-nous