Image of Navigational Panel mapped to Contents / Home / Search Information About Menu & Using SBCKBD.VBX
Tech Support Question

Image of Line Break

Q. How can I do menu selection notification? In other words, it tells you when the uses has selected menu item. I want view status bar-style help. How do I do this in Visual Basic 4.0?

From: Gilson Moura Filho
Email: gilsonmf@solos.ufv.br

A. Gilson, unfortunately there is no easy way to do this in VB4 (or in VB3). There is no event that fires to indicate menu selection until you actually click the menu.

However, you can achieve it by using Desaware's SpyWorks OCX (or VBX for VB3). SpyWorks can basically hook into the message loop for any control, menu or whatever and can provide events on the messages you want, giving you much more flexibility than VB itself.

Sorry I don't have an easy answer but some problems are just like that. Have a look at Desaware's web site at www.desaware.com.

Q. I am using SBCKBD.VBX with Spyworks. Whenever I press a key, the event is fired twice.

A. SBCKBD.VBX recognises both when the key is pressed and when it is released. In the KbdHook event, check the keystate parameter to see what state the key is in, or set the KeyboardEvent property to 0 (in SpyWorks 2.1), and work with the KeyDownHook and KeyUpHook events instead.

Image of Arrow to Previous Article Image of Arrow to Next Article

[TECH SUPPORT TOC]
Image of Line Break
[HOME] [TABLE OF CONTENTS] [SEARCH]