XWidgetSoft Forum
https://bbs.xwidget.com/

help on wifi signal strength widget for windows
https://bbs.xwidget.com/viewtopic.php?f=8&t=5349
Page 1 of 1

Author:  joe mcguinness [ December 12th, 2014, 4:21 am ]
Post subject:  help on wifi signal strength widget for windows

hi, could someone please tell me how to change the following vbs (i created ;)
1) so that the widget/text1 updates every second and
2) that there is no need to use a temporary text file to store the data?
atm my widget uses the vbs at 'onload'.
thanks for any help in advance...
cheers joe

Code:
dim obj_shell, var_line, obj_cmdexec, my_string, tmpfile
Sub subfn()
    set obj_shell = createobject("WScript.Shell")
    tmpfile = ""+WidgetPath+"/tmp.txt"
    return = obj_shell.Run("%comspec% /C netsh wlan show interfaces | FIND ""Signal"" > "+tmpfile,0 ,true)
    Set fso  = CreateObject("Scripting.FileSystemObject")
    set file = fso.getFile(tmpfile)
    if file.size > 0 then
       Set file = fso.OpenTextFile(tmpfile, 1)
           my_string = file.readall()
           my_string = Mid(my_string,InStr(my_string,":")+2,Len(my_string)-InStr(my_string,":")+2)
           text1.Text = my_string
           file.Close: set fso = nothing
    else
        text1.Text = "File was empty"
    end if
set my_string = nothing
set file = nothing
End Sub

Author:  digigamer [ December 16th, 2014, 1:09 am ]
Post subject:  Re: help on wifi signal strength widget for windows

http://msdn.microsoft.com/en-us/library ... 84%29.aspx

Author:  joe mcguinness [ December 19th, 2014, 10:40 pm ]
Post subject:  Re: help on wifi signal strength widget for windows

thx for the link digigamer!
i forgot to say that i already tried the exec-object. the only problem with it is that it's not possible to hide the command-shell (as far as i know).
but i managed to get rid of the update problem with an endless "do while"-loop. so this case is closed...
cheers joe

Author:  digigamer [ December 31st, 2014, 4:35 am ]
Post subject:  Re: help on wifi signal strength widget for windows

There was a console hiding approach somewhere... I just cant find it.
Avoid endless loops as they drain the CPU, at least in JScript. ~50% CPU

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/