images in the background?

Y

Yuri Alonzo

is there a way to put an image in the background of msaccess, not in a Form
or in a Report?

My client wants to "see" his logo in the background

Thanks in advance
 
D

Damon Heron

I am running 2007 and set the lebans db to 2003 format, and it doesn't do
anything.
As a simpler alternative, how about just make a form with the bmp image as
the backgrd.
Set it as loaded when db is open, AutoCenter =yes, borderstyle none,
no controls, no min/max buttons, etc. On form resize,

DoCmd.MoveSize 0, 0, 15260, 10160 (some experimentation required -depending
on screen size)

Set all of your forms to popup.

The only thing needed is when you exit the app, the background form should
be closed also.
Here is a function to make sure all your forms are closed:

Public Function CloseAllOpenForms()
Dim frm As Object
Dim fNum As Integer
Set frm = Forms!frmOpening
For fNum = Forms.Count - 1 To 0 Step -1
DoCmd.Close
Next fNum
Set frm = Nothing
End Function

Damon
 
T

tina

Arvin, is there a way to retrieve the "background" filepath - when you open
Properties from the shortcut menu on the desktop you see a dialog showing
the selected file from a listbox, not a filepath - so i don't know where the
actual filepath is stored. i'm thinking to synchronize the software window
background with the desktop background. tia, tina
 
A

Arvin Meyer MVP

Hi Tina,

Stephen's code is in a module with a function named:

SetMDIBackGroundImage(strFilePath As String)

What I do is force the logo into the middle of a large bitmap and put it in
a folder where the front-end is stored. Then I just use a hidden form on
startup with code that starts the MDI background function.
 
T

tina

hi back, Arvin, and thanks for responding. but i'm afraid i'm not
understanding - or perhaps i asked the question poorly.

when i want to change the background on my PC's desktop, i rightclick on the
desktop and choose Properties from the shortcut menu (in Win2KPro, and
WinXP, anyway). a dialog opens with several tabs including Background, which
shows a preview of the current background, and allows you to pick another
background picture file from a listbox. or you can click a Browse button to
find another picture file; the default filepath in the OpenFile dialog on my
home PC is C:\WINNT\Web\Wallpaper\. and of course when i choose a picture
file, Windows must be saving that filepath somewhere, so it can display the
right background when i boot up the PC. but the picture file could
presumably be anywhere, not necessarily the default filepath. i'm wondering
if you, or anyone else, knows how to retrieve that stored filepath, which
i'm guessing is in the registry somewhere - but i haven't a clue how to find
or retrieve it.

if i can retrieve the filepath, i should be able to use Stephen's code
(which, like everything else he puts out, is so cool) to assign it to the
Access window background at runtime, so it always matches whatever
background picture is currently being displayed on the desktop.

if you answered the question, and i'm just not getting it, would you mind
spelling it out in short words for my sleep deprived brain? <props eyelids
open with toothpicks, then bows> tia, tina
 
A

Arvin Meyer MVP

I fell asleep early last night so I didn't start answering questions until
today.

As far as I know, the paths to the backgrounds in the listbox are stored in
a specific place, defined by the installation of Office. Mine for Office XP
are at:

C:\Program Files\Microsoft Office\Office10\Bitmaps\Styles\

Form images are embedded in the form, so you don't need to look them up each
time. That said, the MDI background is not, and must be entered each time so
they are hard coded. That doesn't have to be carved in stone though. Since
you are the programmer, you are the goddess of what happens in the program.
You could prepare the images (remember they must be sized of resolution if
there's a bitmap logo in the center) and put the paths in a table, then have
the user select one (store the select in a boolean), then look up that path
at runtime and access the file.
 
T

tina

comments inline.

Arvin Meyer MVP said:
I fell asleep early last night so I didn't start answering questions until
today.

no problem, Arvin. i appreciate your time and help, as always.
As far as I know, the paths to the backgrounds in the listbox are stored in
a specific place, defined by the installation of Office. Mine for Office XP
are at:

C:\Program Files\Microsoft Office\Office10\Bitmaps\Styles\

okay, that's where the picture files are stored. but once you choose a
picture to display as the desktop background, that picture displays every
time you boot up your PC - until you choose another one. so Windows has to
be storing the filepath of the selected picture file somewhere, and
accessing the information each time. *that's* the information i want to find
and retrieve programmatically.
Form images are embedded in the form, so you don't need to look them up each
time. That said, the MDI background is not, and must be entered each time so
they are hard coded. That doesn't have to be carved in stone though. Since
you are the programmer, you are the goddess of what happens in the program.
You could prepare the images (remember they must be sized of resolution if
there's a bitmap logo in the center) and put the paths in a table, then have
the user select one (store the select in a boolean), then look up that path
at runtime and access the file.

a goddess....hmm, i like the sound of that! <g>
actually, i don't want to hard code the filepath at all, anywhere. i want to
write code for a specific database, that will run (probably from an AutoExec
macro) and look up the filepath of the current picture being displayed on
the desktop, as i described above, and then run Stephen's code, using that
filepath to assign the same picture to the MDI background. so whenever the
user changes the background of the desktop on his/her PC, the next time s/he
opens the db, that same picture will show as the MDI background,
automatically.

any ideas on how i can find and retrieve the filepath? i keep thinking it
must be in the registry somewhere, but i haven't a clue how to find it and
call it out.
 
H

Hans Up

tina said:
okay, that's where the picture files are stored. but once you choose a
picture to display as the desktop background, that picture displays every
time you boot up your PC - until you choose another one. so Windows has to
be storing the filepath of the selected picture file somewhere, and
accessing the information each time. *that's* the information i want to find
and retrieve programmatically.

The file path is saved in a registry key. *Which* key appears to depend
on whether you're using active desktop to handle the background image.

Look at this page (I split the URL across 2 lines):

http://windowsitpro.com/article/articleid/16534
/where-are-the-active-desktop-background-image-settings-located-in-the-registry.html
actually, i don't want to hard code the filepath at all, anywhere. i want to
write code for a specific database, that will run (probably from an AutoExec
macro) and look up the filepath of the current picture being displayed on
the desktop, as i described above, and then run Stephen's code, using that
filepath to assign the same picture to the MDI background. so whenever the
user changes the background of the desktop on his/her PC, the next time s/he
opens the db, that same picture will show as the MDI background,
automatically.

any ideas on how i can find and retrieve the filepath? i keep thinking it
must be in the registry somewhere, but i haven't a clue how to find it and
call it out.

There may be a complication. AFAICT, Stephen's code will only accept
BMP format images. However, if your user has active desktop enabled,
she might be using a different image format as the background.

You might be able to adapt the code from this page to retrieve the value
of the correct registry key, then convert to BMP if needed:

http://www.vb-helper.com/howto_backer.html

Hope that was helpful,
Hans
 
A

Arvin Meyer MVP

okay, that's where the picture files are stored. but once you choose a
picture to display as the desktop background, that picture displays every
time you boot up your PC - until you choose another one. so Windows has to
be storing the filepath of the selected picture file somewhere, and
accessing the information each time. *that's* the information i want to
find
and retrieve programmatically.

Yes, that would be the registry
a goddess....hmm, i like the sound of that! <g>
actually, i don't want to hard code the filepath at all, anywhere. i want
to
write code for a specific database, that will run (probably from an
AutoExec
macro) and look up the filepath of the current picture being displayed on
the desktop, as i described above, and then run Stephen's code, using that
filepath to assign the same picture to the MDI background. so whenever the
user changes the background of the desktop on his/her PC, the next time
s/he
opens the db, that same picture will show as the MDI background,
automatically.

any ideas on how i can find and retrieve the filepath? i keep thinking it
must be in the registry somewhere, but i haven't a clue how to find it and
call it out.

HKEY_CURRENT_USER\Control Panel\Desktop\Wallpaper

Here's how you read a value from the registry using Access:

http://www.mvps.org/access/api/api0015.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top