[AccessD] The Annoying Flash - Redux

Gustav Brock gustav at cactus.dk
Sun May 16 11:27:59 CDT 2004


Hi Rocky et all

(resume: The Annoying Flash is the Windows progress bar which pops in
front when you assign a JPEG file to a picture control in Access; when
the picture is small, you won't see any "bar" but only a flash of
"something", thus no bar at all is preferable).

Recently, I noticed this as well but under some different conditions:
A97 on WinXP where A2000 and Access XP are installed as well.

It seems that the key to change is not (at least in some cases) the
one found under HKEY_LOCAL_MACHINE (as the code below assumes) but the
equivalent key under HKEY_CURRENT_USER.

Perhaps the only safe way for your app is to change both keys. It
shouldn't do any harm. However, I've adjusted my code to change it
when needed and then set it back when the user closes the form where
pictures are selected. This is not foolproof, I know, but it has
caused no problems yet.

/gustav


> Hi Rocky,

> I have used the registry setting in code in an ADP (A2K) I am currently
> working on and it worked fine.  There was no initial change, however the
> progress box now does not appear.  I assume it was either due to a system
> restart or the compacting of the app...  I'm not sure.  But it does work.

> Regards,

> Matt Pickering
> LUPO DATA CONCEPTS LTD
> http://www.lupo.net.nz


> -----Original Message-----
> From: AccessD-owner at databaseadvisors.com
> [mailto:AccessD-owner at databaseadvisors.com]On Behalf Of Rocky Smolin -
> Beach Access Software
> Sent: Sunday, December 16, 2001 7:44 PM
> To: AccessD at databaseadvisors.com
> Cc: Gordon Bennett
> Subject: RE: [AccessD] The Annoying Flash - Redux


> Gustav et al:

> Here's a mystery.  That code which suppresses the annoying flash works in an
> A97 mdb but not in an A2K mdb.  Even if you don't use the code but manually
> change the key to No, the progress bar flash still shows when setting the
> picture property in the image box to a jpg file.  Convert the A2K mdb to A97
> and the progress bar goes away.  So it's not in the code which changes the
> registry key.  There's something about A2K which apparently is showing the
> progress bar despite the reg key setting.

> Any ideas on what's going on here?

> TIA and regards,

> Rocky Smolin
> Beach Access Software

> -----Original Message-----
> From: AccessD-owner at databaseadvisors.com
> [mailto:AccessD-owner at databaseadvisors.com]On Behalf Of Rocky Smolin -
> Beach Access Software
> Sent: Friday, December 07, 2001 9:52 PM
> To: AccessD at databaseadvisors.com
> Subject: RE: [AccessD] The Annoying Flash


> Gustav:

> That worked perfectly. Thank you.  Solves a small but annoying problem which
> will definitely improve the quality of my products.

> Best regards,

> Rocky


> -----Original Message-----
> From: AccessD-owner at databaseadvisors.com
> [mailto:AccessD-owner at databaseadvisors.com]On Behalf Of Gustav Brock
> Sent: Friday, December 07, 2001 12:28 PM
> To: AccessD at databaseadvisors.com
> Subject: Re: [AccessD] The Annoying Flash


> Hi Rocky (and Seth)

> Did some digging and found a short API routine from April last year by
> Albert van Bergen (left the list I believe). I brushed it a bit.

> Copy and paste this into a new module for testing (beware of line
> breaks):

> <code>

> Option Compare Database
> Option Explicit

> Public Const HKEY_LOCAL_MACHINE = &H80000002

> Public Const REG_SZ = 1

> Public Declare Function RegCloseKey Lib "advapi32.dll" ( _
>   ByVal hKey As Long) As Long

> Public Declare Function RegCreateKey Lib "advapi32.dll" _
>   Alias "RegCreateKeyA" ( _
>   ByVal hKey As Long, _
>   ByVal lpSubKey As String, _
>   ByRef phkResult As Long) As Long

> Public Declare Function RegSetValueEx Lib "advapi32.dll" _
>   Alias "RegSetValueExA" ( _
>   ByVal hKey As Long, _
>   ByVal lpValueName As String, _
>   ByVal Reserved As Long, _
>   ByVal dwType As Long, _
>   ByRef lpData As Any, _
>   ByVal cbData As Long) As Long

> Public Sub WriteRegistry( _
>   hKey As Long, _
>   PathVar As String, _
>   ValueVar As String, _
>   DataVar As String)

>   Dim hCurKey As Long
>   Dim Result  As Long

>   Result = RegCreateKey(hKey, PathVar, hCurKey)
>   Result = RegSetValueEx(hCurKey, ValueVar, 0, REG_SZ, ByVal DataVar,
> Len(DataVar))
>   Result = RegCloseKey(hCurKey)

> End Sub

> Public Sub ShowJpegProgressDialog(ByVal booShow As Boolean)

>   Dim PathVar   As String
>   Dim ValueVar  As String
>   Dim DataVar   As String

>   PathVar = "Software\Microsoft\Shared Tools\Graphics
> Filters\Import\JPEG\Options"
>   ValueVar = "ShowProgressDialog"
>   DataVar = IIf(booShow = True, "Yes", "No")

>   Call WriteRegistry(HKEY_LOCAL_MACHINE, PathVar, ValueVar, DataVar)

> End Sub

> </code>

> This worked for me out of the box.

> But (Seth or anyone?) - I would like to be able to retrieve the setting
> of the key too.
> Something like:

> Public Declare Function RegGetValueEx Lib "advapi32.dll" _
>   Alias "RegGetValueExA"
>   ... etc.

> How can I do that?
> The purpose would be to get the key when launching the app, set it to
> "No" while running, and then resetting it to "Yes" when closing the app
> if that was the initial setting.

> Also, could you please explain why this line from the code above
> contains "ByVal":

>   Result = RegSetValueEx(hCurKey, ValueVar, 0, REG_SZ, ByVal DataVar,
> Len(DataVar))

> I know what ByVal means but have never seen it in a call of a function.

> /gustav


>> Thanks for that.  The code solution didn't work - just make the
>> progress bar flicker a bit shorter.  But changing the key in the
>> registry did work.  Problem is, of course, it has to be changed on the
>> target machine.  Does anyone know how to get to a registry key through
>> code?
>>
>>      -----Original Message-----
>>      From: AccessD-owner at databaseadvisors.com
>>      [mailto:AccessD-owner at databaseadvisors.com]On Behalf Of
>>      Yeatman, Tony
>>      Sent: Friday, December 07, 2001 8:03 AM
>>      To: 'AccessD at databaseadvisors.com'
>>      Subject: RE: [AccessD] The Annoying Flash
>>
>>      An article at Dev Ashish's site explains how to suppress the
>>      Loading Image Dialog.
>>
>>      http://www.mvps.org/access/api/api0038.htm
>>
>>      Hope this helps.
>>
>>      Tony.




More information about the AccessD mailing list