By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,278 Members | 1,136 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,278 IT Pros & Developers. It's quick & easy.

WxPython

P: n/a
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.

Dec 3 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On 3 Dec 2006 04:14:08 -0800, Raja <ro********@gmail.comwrote:
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.
Dec 4 '06 #2

P: n/a
At Sunday 3/12/2006 09:14, Raja wrote:
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.
ii) idle
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
Dec 4 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.