LOTUSSCRIPT 言語
GetActiveWindow は、現在アクティブになっているウィンドウのハンドル (16 ビット対応の Windows では Integer 型、32 ビット Windows では Long 型) を返します。GetWindowText は、ウィンドウのタイトルバーのテキストを返します。
Dim winTitle As String * 80 %If WIN16 ' 16-bit Windows Dim activeWin As Integer ' Window handles are Integer. Declare Function GetActiveWindow% Lib "User" () Declare Function GetWindowText% Lib "User" _ (ByVal hWnd%, ByVal lpstr$, ByVal i%) %ElseIf WIN32 ' 32-bit Windows Dim activeWin As Long ' Window handles are Long. Declare Function GetActiveWindow& Lib "User32" () Declare Function GetWindowText% Lib "User32" _ Alias "GetWindowTextA" _ (ByVal hWnd&, ByVal lpstr$, ByVal i&) %End If
' Print the name of the currently active window. activeWin = GetActiveWindow() ' Returns an Integer or a Long. Call GetWindowText(ActiveWin, winTitle$, 80) Print winTitle$
関連項目