LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-19-2004, 05:18 PM   #1
tcorreia
LQ Newbie
 
Registered: Aug 2004
Posts: 2

Rep: Reputation: 0
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
 
Old 08-22-2004, 05:52 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
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);
        }
}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to connect Linux machine with Window Active Directory hanybeee Linux - Networking 1 10-22-2005 04:16 PM
Determining the Active Virtual Console MasterPi Linux - General 5 05-02-2005 11:11 PM
tput - determining window size subu_s Programming 2 12-06-2004 10:46 PM
Cannot Resize, Move my active window in KDE 3.2? DigitalKid2004 Linux - Newbie 0 09-20-2004 12:19 PM
determining active x window tcorreia Linux - General 1 08-20-2004 03:55 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration