'############################################################### '函数作用:取得当前激活窗品句柄及标题 '############################################################### Declare Function GetActiveWindow Lib "user32" () As Long Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal Hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long Function Ac_Caption() As String Dim ACaption As String Dim Leng As Long ACaption = String$(255, vbnulchar) Leng = Len(ACaption) If GetWindowText(GetActiveWindow, ACaption, Leng) > 0 Then Ac_Caption = ACaption End Function |
|