LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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
 
LinkBack 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: Solaris10, Solaris 11, Mint, OL
Posts: 9,459

Rep: Reputation: 352Reputation: 352Reputation: 352Reputation: 352
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are 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


All times are GMT -5. The time now is 08:21 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration