--- In [email protected], "swzoh" <[EMAIL PROTECTED]> wrote:

A version using event instead of loop.
Better enable the shortcut evaluation.

diskperf -y

-------------------- HddLed.PowerPro --------------------------------
;do("diskperf.exe","-y") // may need to execute it once
static LED,hDD,nRet,nRd,nWt,dp,eh

if(!cl.exists("LED") || !cl.GetBarHandle("LED"))do
LED=cl.create("LED",1).newproperties("topmost");;+
.setrect(0,0,25,25).show
hDD=dll.call("CreateFile|s- ui ui ui ui ui ui";;+
,?"\\.\PhysicalDrive0",0,3,0,3,0,0)

dp=dll.create_struct("h h h h h ui ui ui ui h ui i i i i ui";;+
,repeat("|",16))
dp.set_member_names("BytesRead","BytesWritten","","","";;+
,"ReadCount","WriteCount","","","","","","","","","")

eh=event.createms(500,0;;+
,cb(scriptfolder++?"\"++scriptname++"@Counter"))

else
eh=eh.destroy
led.close
dp.release
dll.call("CloseHandle|ui",hDD)
endif
quit

@Counter
if(LED.GetBackColor != "0 0 0")
LED.addproperties("back: 0 0 0").refresh

dll.call("DeviceIoControl|ui ui ui ui t* ui ui* ui";;+
,hDD,0x70020,0,0,dp,88,"nRet",0)

if(nRd != dp.ReadCount || nWt != dp.WriteCount)do
LED.addproperties("back: 0 255 0").refresh
nRd=dp.ReadCount
nWt=dp.WriteCount
endif
quit
----------------------------------------------------------------------

Sean






Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/power-pro/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to