Solved

find handle of foreground window

Posted on 2007-12-01
4
243 Views
Last Modified: 2010-05-18
the frontmost notepad, for instance.
0
Comment
Question by:Troudeloup
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 13

Expert Comment

by:josgood
ID: 20390074
In Windows, the GetForeGroundWindow API function will do the trick.  See
   http://msdn2.microsoft.com/en-us/library/ms633505.aspx
0
 

Author Comment

by:Troudeloup
ID: 20390094
how do I use the api in python?
0
 
LVL 13

Accepted Solution

by:
josgood earned 500 total points
ID: 20390105
I don't know python, so take this with a grain of salt, but a Google search leads me to believe
   win32gui.GetForegroundWindow()
is the way you do it.

Does that make sense or am I hopelessly out in left field?
0
 

Author Comment

by:Troudeloup
ID: 20390124
i think you provided a vital pointer.

i didin't know python can do that  O_o

0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question