83bfe07c50
- corretti valori assi macchina su Tpa - correzione lettura risultati calc in supervisore - migliorat partenza tick di comunicazione con la macchina - correttie liste colori in Tpa - gestita visibilita' pagine input, output su Tpa - Aggiunto GoToProd in supervisore - Aggiunto GoToSupervisor in ottimizzatore - correzione su gestione tick dei thread di comunicazione - Aggiunto nesting travi su dimensioni diverse e abilitazione dimensioni - Correzione caricamento prod da supervisore
58 lines
1.7 KiB
VB.net
58 lines
1.7 KiB
VB.net
Imports System.Runtime.InteropServices
|
|
|
|
Public 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
|
|
|
|
Public 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
|