DWUTKA at marlow.com
DWUTKA at marlow.com
Mon May 17 16:47:14 CDT 2004
Well if you've been playing Russian roulette, and you're around to talk about it, you're probably pretty good at it! <grin> Practice practice practice. <evilgrin> Sorry for the OT reply....just couldn't resist. I must disagree with the 'registry' fear though. The registry is just a database. If you interact, let's say with your company's accounting database, do you do a complete backup before you interact with it? Of course not. Then again, you don't push something out the door untested. Sure, during testing you would want a backup readily available, but I really don't see an issue with changing registry values programmatically. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of William Hindman Sent: Sunday, May 16, 2004 12:01 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] The Annoying Flash - Redux ...yikes ...certainly not disputing your facts gustav but I avoid changing the registry programmatically at almost any cost ...no more certain way to destroy a Windows computer than corrupting the registry ...and doing so programmatically from Access without backing it up first is, imnsho, an exercise in Russian Roulette ...not my favorite game :( William Hindman "The world's becoming a museum of socialist failures." John Dos Passos ----- Original Message ----- From: "Gustav Brock" <gustav at cactus.dk> To: <AccessD at databaseadvisors.com> Sent: Sunday, May 16, 2004 12:27 PM Subject: Re: [AccessD] The Annoying Flash - Redux > 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. > > -- > _______________________________________________ > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com