LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   determining active x window (http://www.linuxquestions.org/questions/programming-9/determining-active-x-window-219873/)

tcorreia 08-19-2004 05:18 PM

determining active x window
 
I am trying to write some code to determine the active x window and was wondering if there is any easy way to do this. I tried using xwinifo and xev but I can't figure out a slick way to determine the current active x window. Any ideas?

Thanks,
Tim

jlliagre 08-22-2004 05:52 AM

This should work:
Code:

#include <X11/Xlib.h>
main()
{
        Window focus;
        int revert;
        Display *display=XOpenDisplay((char*)0);
        if(display)
        {
                XGetInputFocus(display, &focus, &revert);
                printf("window 0x%x has the focus\n", focus);
        }
}



All times are GMT -5. The time now is 09:03 PM.