| 
| 
| 
| #208887 - 2014-05-14 02:34 PM  Dropbox Status |  
| Allen   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   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   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   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.
 
 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   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?
 
 
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 |  |  |  |  
| 
| 
| #208918 - 2014-05-16 05:33 PM  Re: Dropbox Status
[Re:  Lonkero] |  
| ShaneEP   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.
 
 $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 |  |  |  |  
 Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
 
 | 
| 
 
| 0 registered
and 739 anonymous users online. 
 | 
 |  |