Solved

find handle of foreground window

Posted on 2007-12-01
4
230 Views
Last Modified: 2010-05-18
the frontmost notepad, for instance.
0
Comment
Question by:Troudeloup
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

863 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now