[AccessD] OT: Need an example

Susan Harkins harkinsss at bellsouth.net
Thu Dec 1 14:03:36 CST 2005


Um... You want to explain that? :) Just a brief explanation? Not familiar
with any of the below. 

Susan H. 

How about the good old ShowProgressDialog when converting pictures?

Main code below.

/gustav

Public Sub ShowJpegProgressDialog()

' Retrieves or resets registry setting of JPEG value for ShowProgressDialog.

' The initial call will retrieve the value from the registry.
' Subsequent calls will write the value back.

' Usage:
'   At opening of application (main form):
'     Call ShowJpegProgressDialog
'
'   Do stuff like changing the setting to False:
'     Call ShowJpegProgressDialog_Set(False)
'
'   At closing of application (main form):
'     Call ShowJpegProgressDialog

' 2002-01-12. Cactus Data ApS, CPH
' 2004-08-02. Adjusted with check for WinXP.

  Static booRegValue  As Boolean
  Static booRetrieved As Boolean
  
  If booRetrieved = False Then
    ' Retrieve value.
    Call ShowJpegProgressDialog_Get(booRegValue)
    booRetrieved = True
  Else
    ' Rewrite previously retrieved value.
    Call ShowJpegProgressDialog_Set(booRegValue)
  End If

End Sub


Public Function GetShowJpegProgressDialogStatus() As Boolean

' Demo.
  
  Call ShowJpegProgressDialog_Get(GetShowJpegProgressDialogStatus)
  
End Function

Public Sub ShowJpegProgressDialog_Get(ByRef booShow As Boolean)

  Dim hKeyVar   As Long
  Dim PathVar   As String
  Dim ValueVar  As String
  Dim DataVar   As String
  
  If IsWinXP = True Then
    hKeyVar = HKEY_CURRENT_USER
  Else
    hKeyVar = HKEY_LOCAL_MACHINE
  End If
  PathVar = "Software\Microsoft\Shared Tools\Graphics
Filters\Import\JPEG\Options"
  ValueVar = "ShowProgressDialog"
  
  Call ReadRegistry(hKeyVar, PathVar, ValueVar, DataVar)
  booShow = (StrComp(DataVar, "Yes", vbTextCompare) = 0)

End Sub

Public Sub ShowJpegProgressDialog_Set(ByVal booShow As Boolean)

  Dim hKeyVar   As Long
  Dim PathVar   As String
  Dim ValueVar  As String
  Dim DataVar   As String
  
  If IsWinXP = True Then
    hKeyVar = HKEY_CURRENT_USER
  Else
    hKeyVar = HKEY_LOCAL_MACHINE
  End If
  PathVar = "Software\Microsoft\Shared Tools\Graphics
Filters\Import\JPEG\Options"
  ValueVar = "ShowProgressDialog"
  DataVar = IIf(booShow = True, "Yes", "No")
  
  Call WriteRegistry(hKeyVar, PathVar, ValueVar, DataVar)

End Sub


>>> harkinsss at bellsouth.net 01-12-2005 18:30 >>>
I'm writing about maintaining settings using the Registry -- I know how to
do it, but would like suggestions on an example that would allow the reader
to experience the process without endangering anything. Needs to be an
Access setting. 


--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.10/189 - Release Date: 11/30/2005
 




More information about the AccessD mailing list