Ivan Gentile

Office and .NET blog
posts - 24, comments - 0, trackbacks - 2

martedì 7 marzo 2006

Aprire la finestra di Shutdown di Windows in VB.Net

Sto scoprendo sempre più la forza delle API!!

Riporto il codice che attraverso la shell32.dll mi permette di richiamare la finestra di shutdown del sistema. ... A me è stata utile!!

Public Class Form1

          Declare Sub ShutDownDialog Lib "shell32.dll" Alias "#60" (ByVal hwndOwner As Long)

          Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _

                                        Handles Button1.Click

                    Try

                              ShutDownDialog(Me.Handle)

                              Exit Try

                    Catch Ex As Exception

                              'ERRORE

                    End Try

          End Sub

End Class

Basta aprire un form ed inserirci un pulsante.

Ciao

Ivan

posted @ 10.50 | Feedback (0)