Setting F Keys To Bring A Form Forward to the front of the User'sScreen Through Windows API

  • Thread starter nouveauricheinvestments
  • Start date
N

nouveauricheinvestments

Hi,

I borrowed some great code to manipulate the windows API and
consequently hide the access application so the user only sees the
form. The only problem is that the people using this product have on
average several (in the range of 20 - 30) other programs and windows
open (it is the nature of their work). I would like to add a short
cut to this so that say, hitting F4 will bring the activeform to the
front so the user does not have to minimize 15 different programs
trying to find it. How would I do that? I imagine I would have to do
this through the windows API as well...
 
G

Gary

Can't help you on this, but showing the form only (hiding the program) is
something I'll be needing to do shortly. Appreciate any help you can give.

Thanks.
 
N

nouveauricheinvestments

Can't help you on this, but showing the form only (hiding the program) is
something I'll be needing to do shortly. Appreciate any help you can give.

Thanks.

Sure...It's pretty easy actually, since the code is already
developed. Here is the link so you can check it out..then change it
to do specifically what you want...

http://www.mvps.org/access/api/api0019.htm
API: Manipulate Access Window
 
J

Jon Lewis

You need a global keyboard hook. This is doable (assuming your're working
in Access 2000 or later for support of the AddressOf operator) but not
advisable unless you know exactly what your're doing!

See if the following helps to create the hook:

http://groups.google.co.uk/group/mi...k=gst&q=global+keyboard+hook#6b392892c4a479fa

You could try the SetForegroundWindow API function to bring your form to the
front.

The microsoft.public.vb.winap newsgroup should have some examples

HTH

Jon
 
D

Dirk Goldgar

Hi,

I borrowed some great code to manipulate the windows API and
consequently hide the access application so the user only sees the
form. The only problem is that the people using this product have on
average several (in the range of 20 - 30) other programs and windows
open (it is the nature of their work). I would like to add a short
cut to this so that say, hitting F4 will bring the activeform to the
front so the user does not have to minimize 15 different programs
trying to find it. How would I do that? I imagine I would have to do
this through the windows API as well...


Depending on your version of Windows, you may be able to do this by creating
a desktop shortcut for the program and setting the Shortcut Key property of
that shortcut to the key you want to use. I'm not really familiar with this
approach, but I just tried it on my Vista/A2003 system and it seemed to
work.
 
R

R Tanner

Depending on your version of Windows, you may be able to do this by creating
a desktop shortcut for the program and setting the Shortcut Key property of
that shortcut to the key you want to use. I'm not really familiar with this
approach, but I just tried it on my Vista/A2003 system and it seemed to
work.

Wow...That's pretty cool...I looked at the code...I have no idea what
it's doing and I'm not that familiar with working with windows
libraries or the Windows API, but I will figure it out I'm sure...
 
R

R Tanner

Got it. Appreciate it.

Gary

k. I have the code in a module, but I'm not sure exactly how to set a
specific hot key or what it is doing. Is there by chance anyone
willing to help me by explaining a bit what Paul's code is doing? I
have a meeting with the CIO today and I really need to be able to sell
this system to him. Little tricks like this hot key are going to help
me. :)
 

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