codice:
'<DllImport("user32.dll", CharSet:=CharSet.Unicode)> _
'Friend Shared Function GetClassName(ByVal hWnd As System.IntPtr, ByVal lpClassName As System.Text.StringBuilder, ByVal nMaxCount As Integer) As Integer
'End Function
'<DllImport("user32.dll", CharSet:=CharSet.Auto, ExactSpelling:=True)> _
'Friend Shared Function ShowCursor(ByVal bShow As Boolean) As Integer
'End Function
<DllImport("wininet.dll")> _
Friend Shared Function InternetGetConnectedState(ByRef Description As Integer, ByVal ReservedValue As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
'<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
'Friend Shared Function GetWindow(ByVal hWnd As IntPtr, ByVal uCmd As UInt32) As IntPtr
'End Function
'Friend Declare Function Mouse_Event Lib "user32.dll" Alias "mouse_event" (ByVal dwFlags As Int32, _
' ByVal dX As Int32, ByVal dY As Int32, ByVal cButtons As Int32, ByVal dwExtraInfo As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
'<DllImport("User32.dll", SetLastError:=True)> _
'Friend Shared Function PrintWindow(hwnd As IntPtr, hDC As IntPtr, nFlags As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
'End Function
'<DllImport("user32.dll")> _
'Friend Shared Function RedrawWindow(hWnd As IntPtr, lprcUpdate As IntPtr, hrgnUpdate As IntPtr, flags As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
'End Function
<DllImport("kernel32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)> _
Friend Shared Function GetModuleHandle(ByVal lpModuleName As String) As IntPtr
End Function
<DllImport("user32.dll")> _
Friend Shared Function CallNextHookEx(ByVal hhk As IntPtr, ByVal nCode As Int32, ByVal wParam As IntPtr, ByRef vkCode As UInt32) As IntPtr
End Function
<DllImport("user32.dll", SetLastError:=True)> _
Friend Shared Function SetWindowsHookEx(ByVal idHook As Int32, ByVal lpfn As [Delegate], ByVal hMod As IntPtr, ByVal dwThreadId As UInt32) As IntPtr
End Function
<DllImport("user32.dll", SetLastError:=True)> _
Friend Shared Function UnhookWindowsHookEx(ByVal hhk As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
'<DllImport("user32.dll")> _
'Friend Shared Function GetWindowRect(ByVal hWnd As IntPtr, ByRef lpRect As RECT) As <MarshalAs(UnmanagedType.Bool)> Boolean
'End Function
'<DllImport("user32.dll", CharSet:=CharSet.Auto)> _
'Friend Shared Function GetClientRect(ByVal hWnd As System.IntPtr, ByRef lpRECT As RECT) As <MarshalAs(UnmanagedType.Bool)> Boolean
'End Function
'<DllImport("user32.dll")> _
'Friend Shared Function WindowFromPoint(ByVal PointX As Integer, PointY As Integer) As IntPtr
'End Function
'Friend Declare Unicode Function GetCurrentThemeName Lib "uxtheme.dll" (ByVal stringThemeName As StringBuilder, _
' ByVal lengthThemeName As Integer, ByVal stringColorName As StringBuilder, ByVal lengthColorName As Integer, _
' ByVal stringSizeName As StringBuilder, ByVal lengthSizeName As Integer) As Integer
'<DllImport("user32.dll", CharSet:=CharSet.Unicode)> _
'Friend Shared Function GetClassName(ByVal hWnd As System.IntPtr, ByVal lpClassName As System.Text.StringBuilder, ByVal nMaxCount As Integer) As Integer
'End Function
'<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)> _
'Friend Shared Function SetParent(ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As IntPtr
'End Function
'<DllImport("user32.dll")> _
'Friend Shared Function DefWindowProc(ByVal hWnd As IntPtr, ByVal uMsg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
'End Function
'<DllImport("user32.dll", ExactSpelling:=True, CharSet:=CharSet.Unicode)> _
'Friend Shared Function GetParent(ByVal hWnd As IntPtr) As IntPtr
'End Function
'<DllImport("user32.dll")> _
'Friend Shared Function MoveWindow(ByVal hWnd As IntPtr, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal bRepaint As Boolean) As <MarshalAs(UnmanagedType.Bool)> Boolean
'End Function
'Friend Declare Auto Function GetWindow Lib "user32.dll" ( _
'ByVal hWnd As IntPtr, ByVal uCmd As Int32) As IntPtr
'<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
'Friend Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
'End Function
'serve per trovare le Child della Lobby
'Friend Declare Function EnumChildWindows Lib "user32" (ByVal hWnd As IntPtr, ByVal lpEnumFunc As EnumWindProc, ByRef lParam As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
'Friend Delegate Function EnumWindProc(ByVal hWnd As IntPtr, ByVal lParam As Int32) As <MarshalAs(UnmanagedType.Bool)> Boolean
'<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)> _
'Friend Shared Function FindWindow(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
'End Function
'<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
'Friend Shared Function FindWindowEx(ByVal parentHandle As IntPtr, _
' ByVal childAfter As IntPtr, ByVal lclassName As String, ByVal windowTitle As String) As IntPtr
'End Function
<DllImport("user32.dll")> _
Friend Shared Function SetWindowLong(ByVal hWnd As IntPtr, ByVal nIndex As Integer, ByVal dwNewLong As IntPtr) As Integer
End Function
'questa serve per mettere in primo piano le finestre non dei tavoli e sapere se sono normali o massimizzate
<DllImport("user32.dll", SetLastError:=True)> _
Friend Shared Function GetWindowLong(ByVal hWnd As IntPtr, ByVal nIndex As Integer) As Integer
End Function
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)> _
Friend Shared Function GetWindowText(ByVal hwnd As IntPtr, ByVal lpString As StringBuilder, ByVal cch As Integer) As Integer
End Function
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)> _
Friend Shared Function GetWindowTextLength(ByVal hwnd As IntPtr) As Integer
End Function
<DllImport("user32.dll", SetLastError:=True)> _
Friend Shared Function GetForegroundWindow() As IntPtr
End Function
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)> _
Friend Shared Function ShowWindow(ByVal hwnd As IntPtr, ByVal nCmdShow As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function
<DllImport("kernel32.dll")> _
Friend Shared Function GetCurrentThreadId() As Integer
End Function
'<DllImport("user32.dll", SetLastError:=True)> _
'Friend Shared Function BringWindowToTop(ByVal hwnd As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
'End Function
''per leggere dal file .ini
'<DllImport("kernel32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)> _
'Friend Shared Function GetPrivateProfileString(ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As String, _
' ByVal lpReturnedString As StringBuilder, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
'End Function
'<DllImport("kernel32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)> _
'Friend Shared Function WritePrivateProfileString(ByVal lpAppName As String, _
' ByVal lpKeyName As String, ByVal lpString As String, ByVal lpFileName As String) As <MarshalAs(UnmanagedType.Bool)> Boolean
'End Function
<DllImport("user32.dll")> _
Friend Shared Function GetAsyncKeyState(ByVal vKey As System.Windows.Forms.Keys) As Short
End Function
'Friend Declare Function SetWindowPos Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal hWndInsertAfter As IntPtr, _
' ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal uFlags As Integer) As Boolean
'Friend Declare Unicode Function GetCurrentThemeName Lib "uxtheme.dll" (ByVal stringThemeName As StringBuilder, _
' ByVal lengthThemeName As Integer, ByVal stringColorName As StringBuilder, ByVal lengthColorName As Integer, _
' ByVal stringSizeName As StringBuilder, ByVal lengthSizeName As Integer) As Integer
Friend Declare Function GetWindowThreadProcessId Lib "user32.dll" (ByVal hwnd As IntPtr, _
ByRef lpdwProcessId As Integer) As Integer
Friend Declare Function AttachThreadInput Lib "user32.dll" (ByVal idAttach As Integer, _
ByVal idAttachTo As Integer, <MarshalAs(UnmanagedType.Bool)> ByVal fAttach As Boolean) As <MarshalAs(UnmanagedType.Bool)> Boolean
Friend Declare Auto Function IsIconic Lib "user32.dll" (ByVal hwnd As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
'Friend Declare Auto Function GetSystemMetrics Lib "user32.dll" (ByVal smIndex As Integer) As Integer
'Friend Declare Auto Function IsZoomed Lib "user32.dll" (ByVal hwnd As IntPtr) As Boolean
'Friend Declare Function EnumWindows Lib "user32" (ByVal Adress As CallBack, ByVal y As Integer) As Integer
'' CallBack delegate
'Friend Delegate Function CallBack(ByVal hWnd As IntPtr, ByVal lParam As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
'Friend Declare Function IsWindowVisible Lib "user32.dll" (ByVal hwnd As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
GetAsyncKey la STRAUSO in quasi tutti i programmi e non dà il minimo problema.