Page 1 of 2 12>
Topic Options
#208887 - 2014-05-14 02:34 PM Dropbox Status
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
I have a need to get the status of Dropbox, ie Idle, Synching, etc.

As far as I can tell, Dropbox does not offer any method to get this information directly. I just happened to find the following information at the AutoIT forums, and wonder if anyone has any ideas how we could use this with kix?

http://www.autoitscript.com/forum/topic/142644-getread-dropbox-status/

Top
#208888 - 2014-05-14 02:36 PM Re: Dropbox Status [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Well, the dll they refer to, is no longer available for download, so this may have become much harder. \:\(
Top
#208889 - 2014-05-14 04:01 PM Re: Dropbox Status [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Here is another thread where it appears someone had it working until dropbox updated the client. The author then used autoit to check the status, but I don't know where to start to try to convert it.

https://forums.dropbox.com/topic.php?id=29075&page=2&replies=4

Arend, have you messed with getting icons from the tray with dynawrapper or is there a way to use autoit script in com?

Top
#208891 - 2014-05-14 10:08 PM Re: Dropbox Status [Re: Allen]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
I think the key is in converting the binary values from the IconStreams value into text. It contains the tool tip display text, which could tell you what dropbox is doing. Here is one I found in vbs that at least displays the text. Just not sure how to convert it to kix.

 Code:
const HKEY_CURRENT_USER = &H80000001

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")

strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\TrayNotify"
strValueName = "IconStreams"

oReg.GetBinaryValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue

WScript.Echo RegBinaryToString(dwValue)

function RegBinaryToString(arrValue)  
 strInfo=""  
  for i=0 to ubound(arrValue)  
   if arrValue(i)<>0 then strInfo=strInfo & chr(arrValue(i))  
  next  
 RegBinaryToString=strInfo  
end function


Oh, and the location of the IconStreams data seems to differ with the operating system. This code was made to work on XP.


Edited by ShaneEP (2014-05-14 10:09 PM)

Top
#208894 - 2014-05-15 01:17 AM Re: Dropbox Status [Re: ShaneEP]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Thanks Shane... I did a reg search and found the following path on Win8.1, but this returned nothing but garbage. Did you actually run the script on xp? If so, what id it return?

 Code:
const HKEY_CURRENT_USER = &H80000001

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")

'strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\TrayNotify"
strKeyPath = "Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify"


strValueName = "IconStreams"

oReg.GetBinaryValue HKEY_CURRENT_USER,strKeyPath,strValueName,dwValue

WScript.Echo RegBinaryToString(dwValue)

function RegBinaryToString(arrValue)  
 strInfo=""  
  for i=0 to ubound(arrValue)  
   if arrValue(i)<>0 then strInfo=strInfo & chr(arrValue(i))  
  next  
 RegBinaryToString=strInfo  
end function

Top
#208895 - 2014-05-15 01:19 AM Re: Dropbox Status [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Lonk, might be a few more tweaks that need to be made... see the errors in Shanes code? and in my post, while I realize it is vbscript, it removed the single quote i had in front of the commented out first strKeyPath.
Top
#208897 - 2014-05-15 03:24 AM Re: Dropbox Status [Re: Allen]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Yea I ran it on XP, it seemed to get all the info with a few random chars mixed in. Looked like it would work well enough though.

I just tried it on my win 8.1, and got mostly garbage as well. The info was in clear text in win xp when looking at it in regedit...but appears to be a bit obfuscated in win 8. Go figure.

Top
#208899 - 2014-05-15 12:59 PM Re: Dropbox Status [Re: Allen]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
Yea Allen. I know exactly what happened again. the board decided to modify my HTML again.
_________________________
!

download KiXnet

Top
#208902 - 2014-05-15 01:36 PM Re: Dropbox Status [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
guys, why you use wmi instead of readvalue()? that long vbs instead of simple kixtart that works for xp, win7 and win8?

 Code:
$aKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\TrayNotify","Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify"
$regVal = readvalue("HKCU\"+$aKeyPath[0],"IconStreams") + readvalue("HKCU\"+$aKeyPath[1],"IconStreams")

$regval ?
get $
_________________________
!

download KiXnet

Top
#208904 - 2014-05-15 03:03 PM Re: Dropbox Status [Re: Lonkero]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Just testing the vbs that Shane found before going to the effort of converting it.
Top
#208905 - 2014-05-15 03:15 PM Re: Dropbox Status [Re: Allen]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Just tested your code Lonk, and it returns a mess of data. Any idea what to do with it, so that it spits out something useful? (I'm not asking you to do it, but just give me a direction.)
Top
#208907 - 2014-05-15 06:22 PM Re: Dropbox Status [Re: Allen]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, given that I refuse to use dropbox, someone who uses it needs to read the value to a text file for example, when:
a) dropbox is not in the taskbar
b) when it is but not synced
c) when it is synced
_________________________
!

download KiXnet

Top
#208908 - 2014-05-15 09:54 PM Re: Dropbox Status [Re: Lonkero]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
I guesss I wasn't specific eh? The VBS above appears to get a array of binary values (ArrValue) and convert it to a string. Your code appears to get a string of binary data. Any idea how to convert that so it is something besides a lump of data?
Top
#208909 - 2014-05-16 12:39 AM Re: Dropbox Status [Re: Allen]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
read my above post.
_________________________
!

download KiXnet

Top
#208918 - 2014-05-16 05:33 PM Re: Dropbox Status [Re: Lonkero]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
This works on XP...But it takes 10-15 seconds to complete. And still not sure it'll work as well on win 8.

 Code:
$regVal = readvalue("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer TrayNotify","IconStreams") + readvalue("HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify","IconStreams")

$nul = messagebox(RegBinaryToString($regval),"",0)

function RegBinaryToString($values)
   $strInfo = ""
   for $i=1 to Len($values) step 2
      $value = SubStr($values,$i,2)
      if $value<>0
         $strInfo=$strInfo + chr(Val("&"+$value))
      endif
   next  
   $RegBinaryToString=$strInfo
EndFunction


Edited by ShaneEP (2014-05-16 08:09 PM)

Top
#208920 - 2014-05-16 06:03 PM Re: Dropbox Status [Re: ShaneEP]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
Shane, nevermind.

Edited by Lonkero (2014-05-16 06:14 PM)
_________________________
!

download KiXnet

Top
#208921 - 2014-05-16 06:17 PM Re: Dropbox Status [Re: Lonkero]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
change your readvalue to:
 Code:
$regVal = readvalue("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer TrayNotify","IconStreams") + readvalue("HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify","IconStreams")


and at least it will read correct also on win8
_________________________
!

download KiXnet

Top
#208922 - 2014-05-16 08:09 PM Re: Dropbox Status [Re: Lonkero]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Ah yea forgot to add that back in. Edited the above code.
Top
#208923 - 2014-05-16 08:10 PM Re: Dropbox Status [Re: Lonkero]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
At least with the key provided for Win8, I'm getting mangled results. I'm going to see if I can find another key in the reg for Win8.

Curious Shane, what do the results look like on XP?



Thanks for your help thus far.

Top
#208924 - 2014-05-16 08:18 PM Re: Dropbox Status [Re: Allen]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yes, I want to know what the stream looks like as well. both binary and string.

my take on it is, we can make this way better, if we actually get an understanding how it works. not the whole stream needs to be processed, for one.
_________________________
!

download KiXnet

Top
Page 1 of 2 12>


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 739 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.081 seconds in which 0.031 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org