سلام
من یه برنامه میخوام بنویسم که اسم پنجره فعال رو تشخیص یده
تا اینجا پیش رفتم
اما نمیدونم کجای کار ایراد داره که بجای اسم پنجره یه مشت عدد تحویل میده :frown:کد:Public Class Form1
Public Declare Function GetActiveWindow Lib "user32" Alias "GetActiveWindow" () As Long
Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Public Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
Dim H = GetActiveWindow
Dim Le = GetWindowTextLength(H)
Dim NUM = Space(H.ToString.Length)
Dim R = GetWindowText(H, NUM, H)
MsgBox(R)
End Sub
End Class