Google 網路論壇不再支援新的 Usenet 貼文或訂閱項目,但過往內容仍可供查看。

WM_CHANGEUISTATE and VB

瀏覽次數:13 次
跳到第一則未讀訊息

Timo Kunze

未讀,
2002年11月27日 晚上8:20:382002/11/27
收件者:
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

未讀,
2002年11月30日 晚上8:08:582002/11/30
收件者:
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 則新訊息