Solved

find handle of foreground window

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Socket Programming (Unix) 8 160
Unable to start eclipse ? 17 174
How to convert Structure to vector of byte and vice versa 5 38
COM server issue 2 28
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

739 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