アクティブなウィンドウのキャプションを書き換える




Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" ( _
	ByVal hWnd As Long, _
	ByVal lpString As String _
) As Long
Private Declare Function GetForegroundWindow Lib "user32" () As Long

Private Sub Timer1_Timer()
    Dim hWnd As Long
    Dim strCaption As String * 255
    
    hWnd = GetForegroundWindow
    Call SetWindowText(hWnd, Now)
End Sub