your script works ok on my W2K box :-).

It makes me curious if I can get also the
temperatures into Python script for
further processing as easy as the setting
of the checkbox is done? (I have not
much experience with this kind of
programming yet)
May I ask how did you get the
"TJvXPCheckbox" and the other
values necessary to access the program
GUI ? (as I can see, there is no source
code of SpeedFan available) ?

Claudio

"tlviewer" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> hello,
>
> If you run the Mainboard monitor, speedfan, here is
> an ActivePython script to force automatic fan control.
> http://www.almico.com/speedfan.php
>
> It's a great example of how clean the WinApi interface is
> in ActivePython. The script sets focus to the checkbox of
> interest and toggles the checkbox. AFAIK, speedfan will only
> start without fan control, requiring the user to manually
> check the checkbox to turn it on.
>
> hope someone finds it useful,
> tlviewer
>
> #!/usr/bin/python
> # author: [EMAIL PROTECTED]
> # date: April 1, 2005
> # description: turn on SpeedFan automatic fan speed
> # keywords: speedfan readings
> #import win32api as ap
>
> import win32gui as wi
> import win32ui as ui
> import win32con as wc
>
> # dialog class name
> cl = "TJvXPCheckbox"
>
> try:
> hWnd = wi.FindWindowEx( 0, 0, "TForm1", "SpeedFan 4.20")
> print hWnd
> hWnd = wi.FindWindowEx( hWnd, 0, "TPageControl", "")
> print hWnd
> hWnd = wi.FindWindowEx( hWnd, 0, "TTabSheet", "Readings")
> print hWnd
> hWnd = wi.FindWindowEx( hWnd, 0, cl, "Automatic fan speed")
>
> print hWnd
> res = wi.SetForegroundWindow(hWnd)
> res=wi.SendMessageTimeout(hWnd,wc.WM_LBUTTONDOWN,wc.MK_LBUTTON,0,2,75)
> res = wi.SendMessageTimeout( hWnd,wc.WM_LBUTTONUP, 0, 0, 2, 75 )
> print res
> except:
> pass
> #end code



-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to