如果你已經獲得了一個PPS的視窗值,那就可以透過一個Timer1控制元件來不斷獲取視窗標題了:Private Sub Timer1_Timer()Dim k As Long, aClass As String,GetWinText As String aClass = Space$(254) k = GetWindowText(Hwd, aClass, 254) GetWinText = StrConv(LeftB(StrConv(aClass, vbFromUnicode), k), vbUnicode)End Sub附:GetWindowText宣告如下:Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
如果你已經獲得了一個PPS的視窗值,那就可以透過一個Timer1控制元件來不斷獲取視窗標題了:Private Sub Timer1_Timer()Dim k As Long, aClass As String,GetWinText As String aClass = Space$(254) k = GetWindowText(Hwd, aClass, 254) GetWinText = StrConv(LeftB(StrConv(aClass, vbFromUnicode), k), vbUnicode)End Sub附:GetWindowText宣告如下:Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long