473,394 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Suppress the "Loading Image" dialog when opening a report

Greetings! My situation is this. I currently have a database of
which in a form displays jpeg pictures (one at a time) which are
linked to the db and stored in a separate folder. I have set up a
report with an image control do display/print 4 pictures on a page.
When the report opens (in preview mode) the "loading image" dialog
flashes 4 times (once for each picture) which isn't a huge deal, but
is annoying.
There have been several posts in the past regarding suppressing this
dialog in relation to printing. The two approaches seem to be
modifying the registry and applying a technique from Dev Ashish at
http://www.mvps.org/access/api/api0037.htm.
My questions are this:

1. Is there some type of code floating around that can automate the
registry change?
(I need to deploy the front end database on 5 pc's and a.) I'm not
totally comfortable changing the registry and b.) I don't think I want
to go changing the registry on machines manually anyway.) Also, I
have tried this solution on my machine and it does work if you change
both the HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER registry keys.

2. I have tried unsuccessfully to implement Dev's solution to no
avail. I think I am struggling with exactly where to place the
following portion of his code example:

************* Code Start *************
' This code was originally written by Dev Ashish.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Dev Ashish
'
Private Declare Function apiGetClassName Lib "user32" _
Alias "GetClassNameA" _
(ByVal hWnd As Long, _
ByVal lpClassname As String, _
ByVal nMaxCount As Long) _
As Long

Private Declare Function apiGetWindowText Lib "user32" _
Alias "GetWindowTextA" _
(ByVal hWnd As Long, _
ByVal lpString As String, _
ByVal aint As Long) _
As Long

Private Declare Function apiGetLastActivePopup Lib "user32" _
Alias "GetLastActivePopup" _
(ByVal hWndOwnder As Long) _
As Long

Private Declare Function apiShowWindow Lib "user32" _
Alias "ShowWindow" _
(ByVal hWnd As Long, _
ByVal nCmdShow As Long) _
As Long

Private Const MAX_LEN = 255
Private Const GW_HWNDNEXT = 2
Private Const SW_HIDE = 0
Private Const SW_MINIMIZE = 6
Private Const SW_SHOWMINNOACTIVE = 7
Private Const SW_SHOWDEFAULT = 10

Sub sHideLoadingImageDialog(ByVal hWndApp As Long)
'Required: hWndAccessApp (Application handle)
'
On Error GoTo Err_Handler
Dim lnghWndChild As Long
Dim strCaption As String
Dim strClass As String
Dim lngRet As Long

'Get the last active popup in hWndApp instance
lnghWndChild = apiGetLastActivePopup(hWndApp)
strClass = fGetClassName(lnghWndChild)
strCaption = fGetCaption(lnghWndChild)
'is this the modal window?
If strClass = "#32770" And Trim(strCaption) = vbNullString Then
lngRet = apiShowWindow(lnghWndChild, SW_HIDE)
End If

Exit_Here:
Exit Sub
Err_Handler:
MsgBox "Error #: " & Err.Number & vbCrLf & Err.Description, _
vbCritical + vbOKOnly, "sHideLoadingImageDialog-Runtime Error"
Resume Exit_Here
End Sub

Private Function fGetClassName(ByVal hWnd As Long) As String
Dim strBuffer As String
Dim lngRet As Long
strBuffer = String$(32, 0)
lngRet = apiGetClassName(hWnd, strBuffer, Len(strBuffer))
If lngRet 0 Then
fGetClassName = Left$(strBuffer, lngRet)
End If
End Function

Private Function fGetCaption(ByVal hWnd As Long) As String
Dim strBuffer As String
Dim lngRet As Long
strBuffer = String$(MAX_LEN, 0)
lngRet = apiGetWindowText(hWnd, strBuffer, Len(strBuffer))
If lngRet 0 Then
fGetCaption = Left$(strBuffer, lngRet)
End If
End Function
'************ Code End ***************

I would greatly appreciate any pointers and thanks in advance for your
time.

Brian

Feb 22 '07 #1
2 2413
>Is there some type of code floating around that can automate the
>registry change?
You can perform the registry changes by using a .reg file. You can
double-click the file on each machine to apply the changes, or you can
use it in a batch file or login script via the following command:

regedit /s filename.reg

The contents of the .reg file would be as follows. (Caution: Lines may
wrap. Everything between "[" and "]" should be on the same line in the
file.)
REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Graphics Filters
\Import\JPEG\Options]
"ShowProgressDialog"="No"

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Shared Tools\Graphics Filters
\Import\JPEG\Options]
"ShowProgressDialog"="No"

On Feb 22, 12:43 am, brianflann...@tds.net wrote:
Greetings! My situation is this. I currently have a database of
which in a form displays jpeg pictures (one at a time) which are
linked to the db and stored in a separate folder. I have set up a
report with an image control do display/print 4 pictures on a page.
When the report opens (in preview mode) the "loading image" dialog
flashes 4 times (once for each picture) which isn't a huge deal, but
is annoying.
There have been several posts in the past regarding suppressing this
dialog in relation to printing. The two approaches seem to be
modifying the registry and applying a technique from Dev Ashish athttp://www.mvps.org/access/api/api0037.htm.
My questions are this:

1. Is there some type of code floating around that can automate the
registry change?
(I need to deploy the front end database on 5 pc's and a.) I'm not
totally comfortable changing the registry and b.) I don't think I want
to go changing the registry on machines manually anyway.) Also, I
have tried this solution on my machine and it does work if you change
both the HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER registry keys.

2. I have tried unsuccessfully to implement Dev's solution to no
avail. I think I am struggling with exactly where to place the
following portion of his code example:

************* Code Start *************
' This code was originally written by Dev Ashish.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'
' Code Courtesy of
' Dev Ashish
'
Private Declare Function apiGetClassName Lib "user32" _
Alias "GetClassNameA" _
(ByVal hWnd As Long, _
ByVal lpClassname As String, _
ByVal nMaxCount As Long) _
As Long

Private Declare Function apiGetWindowText Lib "user32" _
Alias "GetWindowTextA" _
(ByVal hWnd As Long, _
ByVal lpString As String, _
ByVal aint As Long) _
As Long

Private Declare Function apiGetLastActivePopup Lib "user32" _
Alias "GetLastActivePopup" _
(ByVal hWndOwnder As Long) _
As Long

Private Declare Function apiShowWindow Lib "user32" _
Alias "ShowWindow" _
(ByVal hWnd As Long, _
ByVal nCmdShow As Long) _
As Long

Private Const MAX_LEN = 255
Private Const GW_HWNDNEXT = 2
Private Const SW_HIDE = 0
Private Const SW_MINIMIZE = 6
Private Const SW_SHOWMINNOACTIVE = 7
Private Const SW_SHOWDEFAULT = 10

Sub sHideLoadingImageDialog(ByVal hWndApp As Long)
'Required: hWndAccessApp (Application handle)
'
On Error GoTo Err_Handler
Dim lnghWndChild As Long
Dim strCaption As String
Dim strClass As String
Dim lngRet As Long

'Get the last active popup in hWndApp instance
lnghWndChild = apiGetLastActivePopup(hWndApp)
strClass = fGetClassName(lnghWndChild)
strCaption = fGetCaption(lnghWndChild)
'is this the modal window?
If strClass = "#32770" And Trim(strCaption) = vbNullString Then
lngRet = apiShowWindow(lnghWndChild, SW_HIDE)
End If

Exit_Here:
Exit Sub
Err_Handler:
MsgBox "Error #: " & Err.Number & vbCrLf & Err.Description, _
vbCritical + vbOKOnly, "sHideLoadingImageDialog-Runtime Error"
Resume Exit_Here
End Sub

Private Function fGetClassName(ByVal hWnd As Long) As String
Dim strBuffer As String
Dim lngRet As Long
strBuffer = String$(32, 0)
lngRet = apiGetClassName(hWnd, strBuffer, Len(strBuffer))
If lngRet 0 Then
fGetClassName = Left$(strBuffer, lngRet)
End If
End Function

Private Function fGetCaption(ByVal hWnd As Long) As String
Dim strBuffer As String
Dim lngRet As Long
strBuffer = String$(MAX_LEN, 0)
lngRet = apiGetWindowText(hWnd, strBuffer, Len(strBuffer))
If lngRet 0 Then
fGetCaption = Left$(strBuffer, lngRet)
End If
End Function
'************ Code End ***************

I would greatly appreciate any pointers and thanks in advance for your
time.

Brian

Feb 22 '07 #2
Worked like a charm. Thanks for the advice.

Brian.
Feb 27 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Roger Shrubber | last post by:
I have a page with images that the user can drag from one frame to another. I need them to see a "ghost image" of the image they are dragging, while the original stays put. I use the onmousemove...
1
by: Stacey | last post by:
Hi, I'm hoping for a bit of advise-- I have a (relatively, from the point-of-view of this dilettante) complex script that attempts to preload certain images in order to trigger one of a series of...
3
by: Stimp | last post by:
I have two dropdowns that take a few seconds to populate (they are populated from a remote database, but the connection to the database is not the best). Is it possible to put a 'Loading...'...
2
by: dana lees | last post by:
Hi, I am developing a c# asp.net application. I have a button which when i click on i open a pdf file. Since the pdf file is very very large i would like to open a window that says "Loading...
3
by: Bri | last post by:
AC97 on WinXP, Image control on a Form and on a Report. I have followed the advice on the following MVPS page: http://www.mvps.org/access/api/api0038.htm This states that after changing the...
1
by: oanhhuynh | last post by:
Hi, I'm designing 1 form include 2 Unbound Object Frame to insert image and memo that describe the product. On database in Access have 2 fields image and description with OLE Object property ...
2
by: Curious | last post by:
There's a problem with what is displayed on a tab in my UI. At first, it's a message, "loading...". Then it should be replaced with the actual file name on the tab. Now the issue is that it...
7
by: divyac | last post by:
I want to show a Progress bar image while loading ASP.NET pages in the browser. I am using ASP.NET 2.0/C#.I want to do it in javascript and not with ajax.help me pls........
1
by: jntmac | last post by:
I cannot find the answer anywhere on the entire net: I have an image on my website. The image shows a newsletter, and the image says "Click here to register to receive our newsletter". I know...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.