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

Adding Shortcut Keys To Add-In Menu Item In VBIDE

74 views
Skip to first unread message

Allen R. Sanders

unread,
Feb 3, 2000, 3:00:00 AM2/3/00
to
I have written an add-in to be used in the Visual Basic IDE. The add-in
adds menu commands and toolbar buttons to the IDE to access the
functionality of the add-in. I'm trying to find a way to create
shortcut keys for access to the menu commands. I know there's a
ShortcutText property but that seems to require an OnAction macro. Any
ideas on how to accomplish this in VB code? Any help would be greatly
appreciated!

-Allen R. Sanders
ASan...@wiseco.com


Audimar P. Bangi

unread,
Feb 3, 2000, 3:00:00 AM2/3/00
to
Allen,

Take hold and read Mr. Francesco Balena's article in the October 1998 issue
of Visual Basic Programmer's Journal (VBPJ), entitled "Subclassing the
Visual Basic IDE". This is a very interesting and well-written article, and
it comes with a sample program that demonstrates, among other things, how to
add a shortcut key to a custom menuitem.

Here's a startup link: www.vbpj.com

Audimar
apb...@yahoo.com

"Allen R. Sanders" <ASan...@wiseco.com> wrote in message
news:DD8C7CE3FFD94B4283A804C7D7B61FB6447030@CPMSFTMSGV22...

Jean Philippe Mica

unread,
Feb 6, 2000, 3:00:00 AM2/6/00
to
Did anybody find this article ?
If you, please post the complete URL
TIA


"Audimar P. Bangi" <apb...@unity.ncsu.edu> wrote in message
news:ODkUvVpb$GA.88@cppssbbsa05...

Darrell Speck

unread,
Feb 6, 2000, 3:00:00 AM2/6/00
to
You can get the code (after free registration) from vbpj.com. Click on the
Locator+ at the top and type-in the code 'VBPJ1098'. That will download a
zip file with all the code in that issue. You want bb1098.zip.

To get the text of the article, you can sign up for "Premier Club" which
allows you download articles - they are currently offering a free 30-day
membership. But I think the code is all you need. CHotKey.cls encapulates
what you want to do.

Good luck,
Darrell Speck, MCSD


"Jean Philippe Mica" <jp....@developpeur.org> wrote in message
news:eC4OBDMc$GA.256@cppssbbsa05...

Donald A. Herman

unread,
Feb 6, 2000, 3:00:00 AM2/6/00
to

Jean Philippe Mica

unread,
Feb 6, 2000, 3:00:00 AM2/6/00
to
Thanks a lot to both of you, that will do the trick I hope
JP

"Donald A. Herman" <dhe...@pcom.net> wrote in message
news:#AYDHhNc$GA.296@cppssbbsa05...

Clint Carter

unread,
Feb 16, 2000, 3:00:00 AM2/16/00
to
Darrel Speck helped me with this article in the past on using Short Cut
Keys.. Thanks Darrel.

One thing bit me at first that may get you too. The short cut keys
never worked for me while in debug. I have to run my application
to check out the keys working. Took me a few days of pulling my
hair to figure that out.

Hard lessons are the best ones though.

Good Luck.

Clint Carter
President
CodeAvionics Software
http://www.codeavionics.com
Visual Basic IDE Power Tools

Clint Carter

unread,
Feb 16, 2000, 3:00:00 AM2/16/00
to

Clint Carter

unread,
Feb 16, 2000, 3:00:00 AM2/16/00
to
The ONLY way to do this is through Win32 API.

The OnAction macro is only for VBA stuff.

I believe you need the RegisterHotKey api.

waty

unread,
Feb 16, 2000, 3:00:00 AM2/16/00
to
I use shortcut using an easy way.
I use a temporary form with a time, and in the time, I check for
the key pressed using the following code

Attribute VB_Name = "Shortcut_Module"
'
#VBIDEUtils#*****************************************************
*******
' * Programmer Name : Waty Thierry
' * Web Site : www.geocities.com/ResearchTriangle/6311/
' * E-Mail : waty.t...@usa.net
' * Date : 23/08/99
' * Time : 13:33
' * Module Name : Shortcut_Module
' * Module Filename : Shortcut.bas
'
*****************************************************************
*****
' * Comments :
' *
' *
'
*****************************************************************
*****

Option Explicit

Private Declare Function GetAsyncKeyState Lib "user32" (ByVal
vKey As Long) As Integer

Public Sub ShortCutTreatment()
'
#VBIDEUtils#*****************************************************
*******
' * Programmer Name : Waty Thierry
' * Web Site :
www.geocities.com/ResearchTriangle/6311/
' * E-Mail : waty.t...@usa.net
' * Date : 23/08/99
' * Time : 13:33
' * Module Name : Shortcut_Module
' * Module Filename : Shortcut.bas
' * Procedure Name : ShortCutTreatment
' * Parameters :
'
*****************************************************************
*****
' * Comments :
' *
' *
'
*****************************************************************
*****

If (GetAsyncKeyState(vbKeyControl)) Then
If GetAsyncKeyState(Asc("[")) Or GetAsyncKeyState(Asc
("]")) Then Call GetPending
If GetAsyncKeyState(Asc("K")) Then Call ClearDebug

' ..... And so .....

End If

End Sub

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!


cjf.ni...@gmail.com

unread,
Mar 27, 2012, 9:50:06 AM3/27/12
to Donald A. Herman
On Sunday, 6 February 2000 08:00:00 UTC, Donald A. Herman wrote:
> http://www.devx.com/premier/mgznarch/vbpj/1998/10oct98/bb1098.pdf
> http://www.devx.com/premier/mgznarch/vbpj/code/1998/10oct98/bb1098p.zip

I realise it's been a long time but is there any chance you have either of these files? The links are now dead.

Tragically I've been asked to dust off VB6 and I'm writing an addin to reduce the pain slightly.

Cheers

-Chris

simon.pau...@gmail.com

unread,
Oct 25, 2018, 1:04:25 PM10/25/18
to
Did you ever find this? I have the magazine, but the article doesn't contain all the source code.
0 new messages