WxPython

R

Raja

Hi,
I am trying to develop an application which would mainly do the
following 2 things . I would like to know how it can be achieved and
also the libraries needed for it .

i) active window tracking
In this substate, the application records the title bar
contents of the active/foreground window
and how long, in seconds, that that window is active/in
the foreground. If the same window
remains in the foreground but the title bar changes (as
happens with a web browser application) then a new record is created
for each new window title. If a window title is recorded that
was previously recorded (on the same date -- see "Data
Structures" info in section 4.4),
then the time should be added to the previously recorded
active time for that window title.
-- Example --
1) User clicks "Start" -> app enters "recording" state.
2) User opens window titled "Window 1" -> app looks for
any prior records for "Window 1"
on current date. Finding none, it creates a new
record.
3) User opens another window titled "Window 2" -> app
records total time spent in "Window 1", then looks for any prior
records for "Window 2" on current date. Finding none,
it creates a new record.
4) User re-raises/re-activates previous window "Window
1" -> app records total time spent
in "Window 2", then looks for any prior records for
"Window 1" on current date. It finds
the record created earlier, so no new record is
created.
5) User clicks "Stop" (or "Exit") -> the app adds the
time just spent in "Window 1" to the
previously recorded time spent in "Window 1". App
then returns to "ready" state.
ii) idle
In this substate, the app has detected that the computer's
screensaver is active and no time
will be recorded for the active/foreground window. This
substate is entered automatically
(from the active window tracking state) when the
screensaver activates and exited
automatically (returning to the active window tracking
state) when the screensaver is
deactivated. Note that this substate should only be
entered if the app was in the active
window tracking state when the screensaver activated.


Awaiting Your Reply,
Thank You ,
Raja.
 
C

Chris Mellon

Hi,
I am trying to develop an application which would mainly do the
following 2 things . I would like to know how it can be achieved and
also the libraries needed for it .

i) active window tracking
In this substate, the application records the title bar
contents of the active/foreground window
and how long, in seconds, that that window is active/in
the foreground. If the same window
remains in the foreground but the title bar changes (as
happens with a web browser application) then a new record is created
for each new window title. If a window title is recorded that
was previously recorded (on the same date -- see "Data
Structures" info in section 4.4),
then the time should be added to the previously recorded
active time for that window title.
-- Example --
1) User clicks "Start" -> app enters "recording" state.
2) User opens window titled "Window 1" -> app looks for
any prior records for "Window 1"
on current date. Finding none, it creates a new
record.
3) User opens another window titled "Window 2" -> app
records total time spent in "Window 1", then looks for any prior
records for "Window 2" on current date. Finding none,
it creates a new record.
4) User re-raises/re-activates previous window "Window
1" -> app records total time spent
in "Window 2", then looks for any prior records for
"Window 1" on current date. It finds
the record created earlier, so no new record is
created.
5) User clicks "Stop" (or "Exit") -> the app adds the
time just spent in "Window 1" to the
previously recorded time spent in "Window 1". App
then returns to "ready" state.
ii) idle
In this substate, the app has detected that the computer's
screensaver is active and no time
will be recorded for the active/foreground window. This
substate is entered automatically
(from the active window tracking state) when the
screensaver activates and exited
automatically (returning to the active window tracking
state) when the screensaver is
deactivated. Note that this substate should only be
entered if the app was in the active
window tracking state when the screensaver activated.


Awaiting Your Reply,
Thank You ,
Raja.


wxPython is a toolkit for writing interfaces, and most of the
functionality you want are systems tasks. wxPython can provide the UI,
but for the system calls you'll need to use the pywin32 module or
ctypes to work directly with the win32 api.
 
G

Gabriel Genellina

I am trying to develop an application which would mainly do the
following 2 things . I would like to know how it can be achieved and
also the libraries needed for it .

i) active window tracking

I'd use GetForegroundWindow+GetWindowText in a loop with a reasonable
delay (maybe 10 secs?). I can't find the former exposed on the
pywin32 package but I have an old version. Anyway you could be able
to use ctypes.

I'd watch for the WM_SYSCOMMAND (SC_SCREENSAVE) and WM_POWERBROADCAST messages.

Note that neither of these tasks has to do directly with wxPython


--
Gabriel Genellina
Softlab SRL

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top