69e010e147
- Modifiche lettura variabili NUM per input ed output - introdotte differenze grafiche tra NUM e TPA - Introdotto controllo chiave su utilizzo Db non locale - Correzione su reset dei CALC quando ci sono modifiche - Blocco comandi su MachGroup in produzione - Introdotto bottone supervisore in View/Optim per aprirlo o richiamarlo in primo piano
58 lines
1.7 KiB
VB.net
58 lines
1.7 KiB
VB.net
Imports System.Runtime.InteropServices
|
|
|
|
Module ManageWindow
|
|
|
|
|
|
<DllImport("user32.dll")>
|
|
Public Function FindWindow(ByVal className As String, ByVal windowTitle As String) As IntPtr
|
|
End Function
|
|
<DllImport("user32.dll")>
|
|
Private Function ShowWindow(ByVal hWnd As IntPtr, ByVal flags As ShowWindowEnum) As Boolean
|
|
End Function
|
|
<DllImport("user32.dll")>
|
|
Private Function SetForegroundWindow(ByVal hwnd As IntPtr) As Integer
|
|
End Function
|
|
<DllImport("user32.dll")>
|
|
Private Function GetWindowPlacement(ByVal hWnd As IntPtr, ByRef lpwndpl As Windowplacement) As Boolean
|
|
End Function
|
|
|
|
Private Enum ShowWindowEnum
|
|
Hide = 0
|
|
ShowNormal = 1
|
|
ShowMinimized = 2
|
|
ShowMaximized = 3
|
|
Maximize = 3
|
|
ShowNormalNoActivate = 4
|
|
Show = 5
|
|
Minimize = 6
|
|
ShowMinNoActivate = 7
|
|
ShowNoActivate = 8
|
|
Restore = 9
|
|
ShowDefault = 10
|
|
ForceMinimized = 11
|
|
End Enum
|
|
|
|
Private Structure Windowplacement
|
|
Public length As Integer
|
|
Public flags As Integer
|
|
Public showCmd As Integer
|
|
Public ptMinPosition As System.Drawing.Point
|
|
Public ptMaxPosition As System.Drawing.Point
|
|
Public rcNormalPosition As System.Drawing.Rectangle
|
|
End Structure
|
|
|
|
Friend Sub BringWindowToFront(wdwIntPtr As IntPtr)
|
|
'Dim wdwIntPtr As IntPtr = FindWindow(Nothing, "0016 - EgtBEAMWALL")
|
|
Dim placement As Windowplacement = New Windowplacement()
|
|
GetWindowPlacement(wdwIntPtr, placement)
|
|
' se minimizzata
|
|
If placement.showCmd = 2 Then
|
|
' riporto in vista non minimizzata
|
|
ShowWindow(wdwIntPtr, ShowWindowEnum.Restore)
|
|
End If
|
|
' porto avanti la finestra rendendola quella attiva
|
|
SetForegroundWindow(wdwIntPtr)
|
|
End Sub
|
|
|
|
End Module
|