Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WM_CHANGEUISTATE and VB

13 views
Skip to first unread message

Timo Kunze

unread,
Nov 27, 2002, 8:20:38 PM11/27/02
to
Hi!

I've written an UserControl and have some problems with supporting
keyboard-cues. Now, I'm using a keyboard-hook to show keyboard-cues when the
user presses [ALT], but this method isn't straight-forward and has some
potential bug-sources. So I wanted to use WM_QUERYUISTATE and
WM_CHANGEUISTATE. But playing around with Spy++, I came to the conclusion
that these messages only work with apps written in C++ (or maybe only with
windows of class "Button" or similiar). I tried several VB-apps and none of
them received any of those 2 messages.
Am I doing something wrong or does VB block these messages?

Thanks in advance!

Timo
--
www.TimoSoft-Software.de


Sergey Merzlikin

unread,
Nov 30, 2002, 8:08:58 PM11/30/02
to
Hello!

The documentation isn't clear, but I think, an application must send
WM_UPDATEUISTATE message to its main window when it detects keyboard and/or
mouse activity and SPI_GETKEYBOARDCUES request to SystemParametersInfo
returns 1 and OS >= Win2K. The main window forwards it to controls, and they
update their look.

VB6 runtime doesn't send this message automatically, but you may help it.
Write separate invisible at runtime control which hooks keyboard (I think,
any keypress myst turn on cues, not only Alt) and mouse movement (use some
distance threshold to turn off cues) and sends WM_UPDATEUISTATE to its
parent window.

The programmer which uses your UserControl may drop the second control to
the main form, and keyboard cues would work in whole application, not only
in UserControl written by you. The events from this second control may help
the programmer to use keyboard cues in windowless controls like labels.

--
Sergey Merzlikin
http://smsoft.chat.ru

"Timo Kunze" <TKunz...@gmx.de> wrote in message
news:#y3#axnlCHA.1412@tkmsftngp04...

0 new messages