Board index » delphi » Windows Hotkey

Windows Hotkey

Does anyone know how to intercept all keyboard messages in Windows.  I am
using TPW 1.5.  I need to setup a hotkey to bring up a postcode searcher.
Is there any simple way?

Thanks,

Bernard.
--
Bernard Blackham
b...@geocities.com
http://www.geocities.com/SiliconValley/2812

 

Re:Windows Hotkey


Quote
"Bernard Blackham" <black...@newton.dialix.com.au> wrote:
>Does anyone know how to intercept all keyboard messages in Windows.  I am
>using TPW 1.5.  I need to setup a hotkey to bring up a postcode searcher.
>Is there any simple way?

In a Windows application, you can intercept one or more of the
following Windows messages:

wm_char
wm_keydown
wm_keyup

But this only works when the application has the focus.
Look in the Windows API help for details.

Bob Ferguson.

-----------------------------------------
J.R. Ferguson, Amsterdam, The Netherlands
e-mail: j.r.fergu...@iname.com
web: www.xs4all.nl/~ferguson
Freeware for DOS and Windows

Re:Windows Hotkey


Quote
J.R. Ferguson wrote:

> "Bernard Blackham" <black...@newton.dialix.com.au> wrote:

> >Does anyone know how to intercept all keyboard messages in Windows.  I am
> >using TPW 1.5.  I need to setup a hotkey to bring up a postcode searcher.
> >Is there any simple way?

> In a Windows application, you can intercept one or more of the
> following Windows messages:

> wm_char
> wm_keydown
> wm_keyup

> But this only works when the application has the focus.
> Look in the Windows API help for details.

What if the application doesn't have the input focus?

Thanks,

Bernard.

Re:Windows Hotkey


Bernard Blackham <black...@newton.dialix.com.au> wrote in article
<01bc0fce$6d2433e0$25000...@blackham.newton.dialix.com.au>...

Quote
> Does anyone know how to intercept all keyboard messages in Windows.  I am
> using TPW 1.5.  I need to setup a hotkey to bring up a postcode searcher.
> Is there any simple way?

The recommended (and far from simple) way is setting a windows hook.
Lookup SetWindowsHookEx in your online help.

Note that SetWindowsHookEx always works, even when you don't want it to - Eg
when your program shows a messagebox.
If your behavior just needs to work when your program is active, an accelerator
should be OK.

Zweitze.
--
  Zweitze de Vries
  Cyco Software
  Rijswijk ZH, Netherlands

Other Threads