Solved

find handle of foreground window

Posted on 2007-12-01
4
227 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

747 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

12 Experts available now in Live!

Get 1:1 Help Now