Get Active Window Title in X

Get active window title in X11 Haskell library

This is possible using getInputFocus and fetchName.

The code would look something like

getActiveWindowTitle :: Display -> IO (Maybe String)
getActiveWindowTitle display = do
(window, _) = getInputFocus display
fetchName display window

Get active window title in X

xdotool can do that.

xdotool getactivewindow

Get the title of the current active Window/Document in Mac OS X

As far as I know your best bet is wrapping an AppleScript. But AppleScript is magic to me so I leave it as an exercise for the questioner :-)

This might help a little: A script to resize frontmost two windows to fill screen - Mac OS X Hints

Get current active Window title in C

I think you can use GetForegroundWindow() to get a handle to the window the user is using and then use GetWindowText() to get the title:

HWND foreground = GetForegroundWindow();
if (foreground)
{
char window_title[256];
GetWindowText(foreground, window_title, 256);
}

c# - Get current window title

Can you stick it in a loop on another thread. Have two variables: previousWindow and currentWindow. Keep comparing them, when they change - you update your log file.



Related Topics



Leave a reply



Submit