Imports System.ComponentModel Imports EgtWPFLib5 Class MainWindowV Inherits EgtCustomWindow Private Sub MainWindow_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized If Not ProjectVM.GetAppToShow() Then Me.ShowInTaskbar = False End If End Sub Private Sub MainWindow_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded ' Posizione e dimensioni del Form Dim WinPos As New WinPos If ProjectVM.GetAppToShow() Then GetPrivateProfileWinPos(S_GENERAL, K_WINPLACE, WinPos.nFlag, WinPos.nLeft, WinPos.nTop, WinPos.nWidth, WinPos.nHeight) Else GetPrivateProfileWinPos(S_GENERAL, K_HIDEPLACE, WinPos.nFlag, WinPos.nLeft, WinPos.nTop, WinPos.nWidth, WinPos.nHeight) End If WinPosToWindow(Me, WinPos) End Sub Private Sub MainWindowV_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles Me.Closing If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt AndAlso Keyboard.IsKeyDown(Key.F4) Then e.Cancel = True Return End If End Sub Private Sub MainWindow_Drop(sender As Object, e As DragEventArgs) ' Se drag di file If e.Data.GetDataPresent(DataFormats.FileDrop) Then ' Attivo il programma Me.Activate() ' Recupero l'array di stringhe con i nomi del file Dim sFiles() As String = DirectCast(e.Data.GetData(DataFormats.FileDrop), String()) ' Apro il primo come file standard If Map.refProjectVM.OpenStdFile(sFiles(0)) Then Return ' Riprovo come file descrizione porta Map.refProjectVM.OpenDoorFile(sFiles(0)) End If End Sub End Class