Hi!
I have looked at MSDN but can't find an explanation for the  
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows NT x86\Drivers\Version-[x]\[Printer Driver Name]\DriverDate
REG_BINARY format.
Does anyone know how this can be converted to PB Date Format?
Cheers!
			
			
									
									Convert registry REG_BINARY DriverDate to PB Date?
- 
				techjunkie
 - Addict

 - Posts: 1126
 - Joined: Wed Oct 15, 2003 12:40 am
 - Location: Sweden
 - Contact:
 
Convert registry REG_BINARY DriverDate to PB Date?

(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
Assume the variable regValue holds the value you received from the registry.
			
			
									
									Code: Select all
fTime.FILETIME
sTime.SYSTEMTIME
; --> Here's the REG_BINARY value for my printer driver date
;     as it appears in my registry   00 c0 9f eb c5 28 c4 01
;     The result should be 2004.04.23
dtLow = $EB9FC000
dtHigh = $01C428C5
;     Comment out the previous 2 lines and uncomment the next
;     2 lines to use the REB_BINARY value you receive from your
;     RegQueryValueEx_() where regValue holds the binary date data.
;dtLow = PeekL(@regValue)
;dtHigh = PeekL(@regValue+4)
fTime\dwLowDateTime = dtLow
fTime\dwHighDateTime = dtHigh
FileTimeToSystemTime_(fTime, @sTime)
pbDate = Date(sTime\wYear, sTime\wMonth, sTime\wDay, sTime\wHour, sTime\wMinute, sTime\wSecond)
pbDate$ = FormatDate("%yyyy.%mm.%dd", pbDate)
MessageRequester("Binary date converted", pbDate$)
EndWhat goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
						PB 5.21 LTS (x86) - Windows 8.1
- 
				techjunkie
 - Addict

 - Posts: 1126
 - Joined: Wed Oct 15, 2003 12:40 am
 - Location: Sweden
 - Contact:
 
- 
				techjunkie
 - Addict

 - Posts: 1126
 - Joined: Wed Oct 15, 2003 12:40 am
 - Location: Sweden
 - Contact:
 
Hmmm... Is it possible to do the same with,
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows NT x86\Drivers\Version-[x]\[Printer Driver Name]\DriverVersion
Can't find any Interface for "Version Info".
			
			
									
									HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print\Environments\Windows NT x86\Drivers\Version-[x]\[Printer Driver Name]\DriverVersion
Can't find any Interface for "Version Info".

(\__/)
(='.'=) This is Bunny. Copy and paste Bunny into your
(")_(") signature to help him gain world domination.
See if this works for you. It's all guesswork but it returns the correct info for my driver version. 
			
			
									
									Code: Select all
verMajor = PeekW(@regBinaryValue+6)
verMinor = PeekW(@regBinaryValue+4)
verRev =  PeekW(@regBinaryValue+2)
verBuild = PeekW(@regBinaryValue)
ver$ = Str(verMajor) + "." + Str(verMinor) + "." + Str(verRev) + "." + Str(verBuild)
MessageRequester("DriverVersion", ver$)
What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
						PB 5.21 LTS (x86) - Windows 8.1
- 
				techjunkie
 - Addict

 - Posts: 1126
 - Joined: Wed Oct 15, 2003 12:40 am
 - Location: Sweden
 - Contact:
 
You're welcome techjunkie, and thank you for the kind words...
and for the offer to pay my way over to Sweden (I don't mind flying coach)...
and for promising to buy me a brewery of my very own (You'll be hired as my senior taste tester).
  
  
  
			
			
									
									and for the offer to pay my way over to Sweden (I don't mind flying coach)...
and for promising to buy me a brewery of my very own (You'll be hired as my senior taste tester).
What goes around comes around.
PB 5.21 LTS (x86) - Windows 8.1
						PB 5.21 LTS (x86) - Windows 8.1
