Il existe des API que vous pouvez appeler pour saisir l'objet fenêtre et effectuer les appels suivants pour saisir le handle des zones de texte dans la fenêtre. Une fois que vous avez le handle, vous pouvez appeler une autre API pour définir le texte dessus. voici quelques-unes des API dont je parle:
<DllImport("user32.dll", CharSet:=CharSet.Auto, ExactSpelling:=True)>
Private Shared Function GetForegroundWindow() As IntPtr
End Function
<DllImport("user32.dll", CharSet:=CharSet.Auto, ExactSpelling:=True)>
Private Shared Function ShowWindow(ByVal hWnd As IntPtr, ByVal nCmdShow As Integer) As IntPtr
End Function
<DllImport("user32.dll", CharSet:=CharSet.Auto, ExactSpelling:=True)>
Private Shared Function DestroyWindow(ByVal hWnd As IntPtr) As Boolean
End Function
Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
<DllImport("user32", CharSet:=CharSet.Auto, SetLastError:=True, ExactSpelling:=True)>
Private Shared Function GetWindow(ByVal hwnd As IntPtr, ByVal uCmd As Integer) As IntPtr
End Function
Private Declare Function SetFocus Lib "user32.dll" (ByVal hwnd As IntPtr) As IntPtr
'Private Declare Function SetWindowText Lib "user32.dll" Alias "SetWindowTextA" (ByVal hWnd As IntPtr, ByVal lpString As String) As Boolean
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function SendMessage(ByVal hWnd As HandleRef, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As String) As IntPtr
End Function
Public Sub SetTitle(ByVal Title As String)
Dim h As New HandleRef(Me, Handle)
SendMessage(h, WM_SETTEXT, 0, Title)
End Sub
Public Function GetTitle() As String
Dim str As String = String.Empty
Dim h As New HandleRef(Me, Handle)
SendMessage(h, WM_GETTEXT, 300, str)
Return str
End Function
Sons déviants .. – jlafay
Plus d'explications s'il vous plaît. Nous avons donc 1 application ou deux? Quand les utilisateurs devraient-ils mettre leurs informations d'identification et quand vous allez faire pour eux? – Aliostad
Vous allez avoir besoin d'entrer dans les gestionnaires de fenêtres et tous ces trucs C++. –